I’ve been trying to interface a STM32F103C blue pill (china bought) with a ILI9341 but to no luck.
CS=PA2
D/C=PA1
MOSI=PA7
MISO=PA6
SCK=PA5
VCC 3.3V/5V (the unit is 5V compatible, tried both)
triple checked the connections
tried the second display still nothing
What I am using to test the display: https://github.com/rogerclarkmelbourne/ … cstest.ino
arduino_stm32 as of when?
arduino ide version?
operating system?
it’s a blue pill, R10 is 10k please check? no is good, 1k5 is excellent. yes, well some enumerate, some don’t, some can’t decide.
(at some point maybe replace 10k with 1k5 smt, add a 1k8 smt on top or add a1k8( leads) to appropriate pins.)
(usb ports and hubs appear to influence it as well, with one of my 7 port hubs devices are seen ok in the first 4, a bit weird after)
have you programmed the blink sketch and it works?
repeat with half the low time and double high time, as expected? ( some boards have the 1hz blink already in)
you edited the graphics test for your cs and d/c pins? connected the backlight (with a resistor?? to ?? 3v3?? to 5v??)
is there a ‘suggest you purchase’ paragraph anywhere?
you have ordered a st-link usb stick (about $2 .. $4, maybe 2 and definitely another pill, history and forum would maybe suggest a Baite multi-pack of Mini’s ) ?
soldering iron ?? solder?? flux?? Baites are typically supplied with headers unsoldered; also modules.
also some dupont 40 wire strips all 10cm, each of female – male, female – female, male – male?
all 3 means doubling to what you want in length and of course dupont’s give you 10 colours
sadly the female sockets are good for maybe 3 insertions, one way, rotate 90, hope
i tend to to apply a rubber band in a 9 loop around the wires and hook the other side of board/bread board, so
add bag of rubber bands
hth
stephen
The board was tested with blink and serial communication. The board gets recognized by the system and can be flashed via USB. (see reflection
)
I flashed the graphic test via usb and serial but to no luck.
At first I tried custom pin configuration but since I was not getting any success I just wired the lcd to the board like the sketch is already configured so I do not have to edit the sketch all the time.
the unit is running at 72mhz.
the backlight resistor is irrelevant as you would be able to see the output with an external light. but yeah, backlight was connected to 5v with 4k7, 3.3v even 3.3v directly.
Many displays are supposed to be an ILI9341 but they aren’t.
What exactly means “no luck”?
Could you read the ID successfully?
What is shown in the serial monitor?
Do you own a scope to check the SPI signals?
https://www.aliexpress.com/item/2-4-240 … e32a7c1489
OUTPUT:
Display Power Mode: 0x0
MADCTL Mode: 0x0
Pixel Format: 0x0
Image Format: 0x0
Self Diagnostic: 0x0
Benchmark Time (microseconds)
Screen fill 170820
Text 43020
Lines 243833
Horiz/Vert Lines 15845
Rectangles (outline) 11599
Rectangles (filled) 355071
Circles (filled) 144677
Circles (outline) 173061
Triangles (outline) 60156
Triangles (filled) 166877
Rounded rects (outline) 59812
Rounded rects (filled) 416086
Done!
The display does not display anything (both lcd units)…and no, sorry I do not have a oscilloscope to debug this.
The default setting in the demo sketch uses pins of Adafruit shield, which can be totally inappropriate in your case.
Also, be sure that you define the pins using “PAx” style instead of pure numbers.
I would recommend to use the RST line, too:
#define TFT_DC PA1
#define TFT_CS PA2
#define TFT_RST PA3
Adafruit_ILI9341_STM tft = Adafruit_ILI9341_STM(TFT_CS, TFT_DC, TFT_RST);D/C=PA1
RST=PA3
MOSI=PA7
MISO=PA6
SCK=PA5
Screen is black.
tried both constructors
Adafruit_ILI9341_STM tft = Adafruit_ILI9341_STM(TFT_CS, TFT_DC, TFT_RST);
and
Adafruit_ILI9341_STM tft = Adafruit_ILI9341_STM(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
The unit is 5v compatible and tried both 5v and 3.3v. the unit does not have any 3.3V converter on the back.
I am trying to get an arduino uno to display on the screen….but any idea is welcome.
Will try to compile the library on STM32 and see the result.
As BennehBoy said, it should run with standard Adafruit GFX lib, as my ILI9486 lib does as well.
tft.setCursor(0, 0);
tft.setTextColor(ILI9341_WHITE); tft.setTextSize(1);
tft.println(“Hello World!”);
I get compiler errors on setCursor, setTextColor, println and so on.
As BennehBoy said, it should run with standard Adafruit GFX lib, as my ILI9486 lib does as well.
https://github.com/stevstrong/Arduino_S … raries/SPI
because it includes some features which are not yet committed in the official STM32duino repo.
tft.setCursor(0, 0);
tft.setTextColor(ILI9341_WHITE); tft.setTextSize(1);
tft.println(“Hello World!”);
I get compiler errors on setCursor, setTextColor, println and so on.
Not working via USB bootloader upload and 3.3v.
Programmed via serial…
Will try to compile the library on STM32 and see the result.
Not working via USB bootloader upload and 3.3v.
Programmed via serial…
Programming via USB I could get the Blink to run (standard test on board upon arrival) outputed some serial text.
What I observed:
1) smt32flash can’t wake the device after DFU flash
2) flashed sketch via USB will not run = black screen
flashing the sketch via serial = works like a charm
Btw, do you select the different upload methods in the IDE menu? For USB upload you have to select “Stm32duino bootloader”.
Ok, i just realised you are on Mac os, and selected the right upload method.
I have to pas, i have no Mac, so i cannot help you any further.
I have been playing around with a 2.8″ SPI display with the ILI9341 standard. After much searching I found this thread. (There is a lot of threads about this…but none exactly how to create some kind of baseline and get your display working with Blue Pill)
Backgound –
I am using a Blue Pill board (64K) and manage/updates it through a ST-Link. So far it was working great!
However, I had problems to get the display to work – it was just showing a complete white screen. However I could see that my program was running and the screen was flashing when pressing the reset button on Blue Pill.
The connectors used:
#include "SPI.h
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341_STM.h"
#define TFT_DC PC14
#define TFT_CS PC15
#define TFT_RST PA3
//Ref these pins are connected also / If not connected there is no way to get it going at all...
//#define TFT_MOSI PA7
//#define TFT_MISO PA6
//#define TFT_CLK PA5
Adafruit_ILI9341_STM tft = Adafruit_ILI9341_STM(TFT_CS, TFT_DC);
///plus the screen code from Adafruit…



