2017-11-12 05:44 AM
Hi guys,
I am completely new to the STM32 stuff (I've done some projects with Arduinos) and I ran into some problems.
I am developing with an STM32L152RE board on Windows 10.
I did successfully the basic tutorials.
Now, I want to use a display. One problem with my Arduino projects was, that the painting the display is quite slow. So I would like to improve that with the STM32 family.
For that purpose I've a 2.4' SPI display with ILI9341 controller. In addition I've an Arduino Uno compatible shield. I connected the display with the shield and the shield with the STM32. As far as I understood the description the STM32 has a UNO R3 compatible pinout, right?
Here you can find more details about the hardware:
Then, I've created a new project in the WebIDE. I added latest mbed library. In addition I've added the SPI_TFT_ILI9341 library (
https://os.mbed.com/users/dreschpe/code/SPI_TFT_ILI9341/
). First I encountered some problems, due to the 'stm32l1xx_dma.h' dependency. I read that the dependency is deprecated, so I commented all the &sharpif that would be used for including the hardware specific file (SPI_TFT_ILI9341_NUCLEO.cpp).Here is my code:
&sharpinclude 'mbed.h'
&sharpinclude 'SPI_TFT_ILI9341.h'&sharpinclude 'Arial28x28.h'SPI_TFT_ILI9341 TFT(D11, D12, D13, D10, D9, D8, 'TFT'); // (mosi, miso, sck, cs, reset, dc)
int main()
{ TFT.set_orientation(3); // ???????? ?????????? ??????? TFT.background(Blue); // ???????? ???? ???? (????? ???????) TFT.foreground(0xFFFF); // ???????? ???? ?????? (??? ? ??????? rgb565) TFT.cls(); // ???????? ????? ?????? ???? TFT.set_font((unsigned char*) Arial28x28); // ???????? ??? ????? TFT.locate(30, 100); // ?????????? ?????? ?????? (???????????, ?????????) TFT.printf('Hello habrahabr.ru'); // ??????? ?? ?????}I am following the instructions found here:
http://geek-mag.com/posts/258852/
The display background light is working, but the display itself does not do anything.
I would have expected, that the background will be painted blue and some text will appear in white.Can anybody please point me in the right direction?
I am quite new to the hardware stuff ... :)
Thanks
#spi #ili9341 #display2017-11-12 12:34 PM
I found out, that the display is using the 8080-16bit interface by default.
It is possible switch the interface by soldering some JPs. Of course I can do that, but I thought it may be easier to use the 8080-16 interface.
Still, I have some problems to figure out the right pins.
In the meantime I switched the library to UniGraphic. It's still based on the same code, but it seems to be more convenient.
https://os.mbed.com/teams/GraphicsDisplay/code/UniGraphic/
Can anybody please help me figuring out how the wiring is setup and which pins I've to use.
Here is the updated code:
#define PIN_WR D14
#define PIN_DC_TFT D15#define PIN_CS_TFT D10
#define PIN_RESET_TFT D9ILI9341 TFT(PAR_16, PortA,
PIN_CS_TFT, PIN_RESET_TFT, PIN_DC_TFT, PIN_WR, PIN_RESET_TFT, 'Adafruit2.8') ;I've the feeling that it's completely wrong.
Especially the 2nd parameter confuses me. I understand that the library expects 16 wires/pins (16 bit) for sending data. I also found out that there are 'shortcuts' to address several ports with one keyword. But I do not know which pins exactly are included in PortA?
Thanks