Use STM32F103C8 with TFT 320QVT 9341

empirejrz
Tue Jun 27, 2017 6:40 am
Good day everyone. I am beginner. I want to use STM32F103C8. Please introduce about How to connect STM32F103C8 with TFT 320QVT 9341 and library for use it?

Image
Image
Image
Image


empirejrz
Tue Jun 27, 2017 6:45 am
My connection is
PA0 = DB8
PA1 = DB9
PA2 = DB10
PA3 = DB11
PA4 = DB12
PA5 = DB13
PA6 = DB14
PA7 = DB15

RS = PB6
WR = PB5
RD = PB4
CS = PB7
RST = PB8


stevestrong
Tue Jun 27, 2017 6:53 am
I cannot see the images.
i assume it is 8 bit parallel TFT.
Just search the forum for “ili9341 8bit”.

empirejrz
Tue Jun 27, 2017 7:31 am
I download library Adafruit_TFTLCD_8bit_STM32-master and change Adafruit_TFTLCD_8bit_STM32.h

#define TFT_DATA_PORT GPIOA
// Port data bits D0..D7:
// enable only one from below lines corresponding to your HW setup:
#define TFT_DATA_LOW_NIBBLE 1 // take the lower 8 bits: 0..7
//#define TFT_DATA_HIGH_NIBBLE 1 // take the higher 8 bits: 8..15

//Control pins |RD |WR |RS |CS |RST|
#define TFT_CNTRL_PORT GPIOB
#define TFT_RD PB4
#define TFT_WR PB5
#define TFT_RS PB6
#define TFT_CS PB7
#define TFT_RST PB8 //PB0

#define TFT_RD_MASK BIT0 // digitalPinToBitMask(TFT_RD) //
#define TFT_WR_MASK BIT1 // digitalPinToBitMask(TFT_WR) //
#define TFT_RS_MASK BIT2 // digitalPinToBitMask(TFT_RS) //
#define TFT_CS_MASK BIT3 // digitalPinToBitMask(TFT_CS) //

So my LCD not show anything but It has information to serial port.


stevestrong
Tue Jun 27, 2017 12:11 pm
The “TFT_.._MASK” is the bit number of the IO port.
So if you define
#define TFT_RD PB4 // port B bit 4

empirejrz
Wed Jun 28, 2017 1:09 am
I bought the display link below.
http://www.lazada.co.th/32-inch-ssd1289 … .html?ff=1

empirejrz
Wed Jun 28, 2017 1:29 am
I can do it. Thank you very much. I take your advice.

I change
//Control pins |RD |WR |RS |CS |RST|
#define TFT_CNTRL_PORT GPIOB
#define TFT_RD PB4
#define TFT_WR PB5
#define TFT_RS PB6
#define TFT_CS PB7
#define TFT_RST PB8 //PB0

#define TFT_RD_MASK BIT4 // digitalPinToBitMask(TFT_RD) //
#define TFT_WR_MASK BIT5 // digitalPinToBitMask(TFT_WR) //
#define TFT_RS_MASK BIT6 // digitalPinToBitMask(TFT_RS) //
#define TFT_CS_MASK BIT7 // digitalPinToBitMask(TFT_CS) //


empirejrz
Wed Jun 28, 2017 1:50 am
I want to use touchscreen. I use library link below.

https://github.com/stevstrong/TouchScreen_STM32

My serial port print information.
Image

Pin of the LCD Touch is
T_IRQ
T_DO
T_DIN
T_CS
T_CLK


stevestrong
Wed Jun 28, 2017 8:45 am
It seems that your LCD controller is not an ILI9341, but SSD1289.

This controller type is not supported by my library, but can be added.
For initialization sequences please have a look at: https://github.com/prenticedavid/MCUFRIEND_kbv.

The touch controller is an SPI driven one, you have to detect what kind of chip is that.
Because my touch library is handling only 4-wire resistive signals and not specialized chips, please search the internet for an SPI touch library.


empirejrz
Thu Jun 29, 2017 3:05 am
Thank you. I waiting new STM32F103RBT6 item because It has pins not enough. I want to use SPI for SD Card and Touchscreen.

Behind of my LCD

Image


stevestrong
Thu Jun 29, 2017 6:27 am
You have to detect what kind of chip is I2, the touch controller, and load a library for that.

david.prentice
Thu Jun 29, 2017 12:22 pm
Your TFT display uses a 16-bit data bus + 5 control signals = 21 GPIO.
Your SD and XPT2046 use SPI i.e. 3 SPI + 2 CS + 1 IRQ = 6 GPIO

In other words, you are using every available GPIO on a BluePill or MapleMini.

My MCUFRIEND_kbv library supports the ILI9341 in both 8-bit and 16-bit mode.
I have privately posted a 16-bit SPECIAL for a BluePill. Of course, having made the effort to write it for them, they do not give you any feedback.

Quite honestly, you could use Mega or Due with commercial 40-pin Adapter Shields.

If your Display has a configurable 8-bit/16-bit solder-bridge, I suggest that you select 8-bit data bus.
It does not look as if there is a solder-bridge on your blue pcb. You would need to access the SMD R1/R2 on the the flexi-ribbon.
The display will work plenty fast enough. And you can choose sensible pins.

David.


empirejrz
Tue Jul 11, 2017 2:45 am
if I used to STM32F303VC Discovery board. Can i use Adafruit_TFTLCD_8bit_STM32 libery ?

david.prentice
Tue Jul 11, 2017 8:32 am
It looks as if the STM32F303VC Discovery has got lots of pins. But it also has lots of LEDs, Sensors, … connected to these pins.
You will have to study the manual. Choose enough spare pins for your display. Then configure accordingly.

Not only is there a lot of wires to connect, but you will need to write a suitable write function for the 16-bit data bus. This is very easy if you can find an unused 16-bit PORT. It is a nightmare when you use random pins from different ports.

The only “plug and play” solutions are:
1. Mega + 40-pin Adapter Shield + 3.3V 40-pin Display.
2. Due + 40-pin Adapter Shield + 3.3V 40-pin Display.

3. Mega/Due + Mega Display Shield. i.e. you buy a new Display
4. Uno/Mega/Due/Zero/Nucleo/IteadMaple + Uno Display Shield. i.e. you buy a new Display

David.


empirejrz
Tue Jul 11, 2017 8:42 am
Thank you very much to help me.

vincent47
Sat Jul 22, 2017 10:43 am
hi can anyone help me interface tft 320qvt 9341 with stm32f401re using 8bit or 16bit parallel mode .. i dont know what library to use for the lcd and touch controller..thanks

david.prentice
Sat Jul 22, 2017 12:06 pm
As far as I know, the TFT320QVT_9341 is only 16-bit. If you can configure for 8-bit life would be a lot easier.

There is nothing very complicated with driving an ILI9341. There will be several libraries.
The problem comes with “choosing” the wiring. I suggest that you just use whatever wiring the example has.

If you are determined to do it differently, try to put the data bus on a single PORT.
Control pins are easy to move.

Incidentally, the ST Core has a Nucleo-F303RE but not a Discovery F303VC. The Maple Core seems to have STM32F3 Discovery.

The thread is about using a 40-pin 16-bit 3.3V displays with a BluePill board.
I have just received a BluePill and 40pin header socket. So I soldered the board and header to some Protoboard. Plugged my home-made Adapter into a 16-bit SSD1963 display. MCUFRIEND_kbv works fine. Just like it works on a Due with Adapter Shield.
I have not tested the Touch and SD yet. There will be few GPIO pins left for anything else.

As I have mentioned before. If you test your wiring first, I do not mind writing a SPECIAL for you.
However this does involve you to do some testing and provide feedback.

David.


zmemw16
Sat Jul 22, 2017 12:12 pm
why am i seeing echos around here ? yesterday or day before it was software serial and hardware serial questions… … …

please just open a new topic in a relevant forum and not post to any threads mentioning something or other about your issue.
have you tried a search, maybe for ‘qvt’ gives this one http://www.stm32duino.com/viewtopic.php … =qvt#p8114 & the first reply to that post points to some potentially useful code snippet(s)

stephen


david.prentice
Sat Jul 22, 2017 2:22 pm
My apologies. I was replying to empirejrz with a Discovery-F303
I should have replied to vincent47 with a F401RE.

Both posters asked about the TFT 320QVT_9341

The same comment applies. Is there a Core for F401RE ?
If there is an “official” Core, I will post a SPECIAL.

If your questions do not apply to “Arduino” style code, say so.
This Forum is supposed to be about Arduino Libraries

David.


vincent47
Sat Jul 22, 2017 3:12 pm
sorry if Im in the wrong thread, my board is stm32 nucleo-64 development board with stm32f401re mcu, I need to interface tft 320qvt_ili9341 but i dont know what library to use or how to port arduino libraries to make it work with my board, i want to learn how to this but i dont know where to begin, any hint or advice is very much appreciated.. :D

stevestrong
Mon Jul 24, 2017 8:21 am
If the 401 has FSMC, then you could use the actually available Arduino_STM32 core for 407, it has the FSMC adapted for 16 bit parallel access LCDs.
Search the forum for FSMC.

Leave a Reply

Your email address will not be published. Required fields are marked *