Use STM32F103C8 with TFT 320QVT 9341

Working libraries, libraries being ported and related hardware
empirejrz
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Use STM32F103C8 with TFT 320QVT 9341

Post by 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
Last edited by empirejrz on Tue Jun 27, 2017 7:03 am, edited 1 time in total.

empirejrz
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by 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
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by 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
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by 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
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by stevestrong » Tue Jun 27, 2017 12:11 pm

The "TFT_.._MASK" is the bit number of the IO port.
So if you define

Code: Select all

#define TFT_RD PB4 // port B bit 4
then you should have

Code: Select all

#define TFT_RD_MASK BIT4 // bit 4
Can you post a link where did you buy the display?

empirejrz
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by empirejrz » Wed Jun 28, 2017 1:09 am


empirejrz
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by empirejrz » Wed Jun 28, 2017 1:29 am

I can do it. Thank you very much. I take your advice.

I change

Code: Select all

//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) //  
Image
Last edited by empirejrz on Wed Jun 28, 2017 3:52 am, edited 1 time in total.

empirejrz
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by 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
Posts: 1829
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by 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
Posts: 9
Joined: Tue Jun 27, 2017 3:06 am

Re: Use STM32F103C8 with TFT 320QVT 9341

Post by 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

Post Reply