STM32F103C8 & TFT (ili9325)

Working libraries, libraries being ported and related hardware
david.prentice
Posts: 68
Joined: Wed Nov 16, 2016 8:52 am

Re: STM32F103C8 & TFT (ili9325)

Postby david.prentice » Fri Dec 02, 2016 6:22 pm

michael_l wrote:I have one of these but it is 3.95" - never tried it yet. I hope to get it working with help of this thread :-)

There are some discussions on forums that say it would have ili9488


MCUFRIEND_kbv should work with NUCLEO-F103 board. You need the Beta library from GitHub.
The LCD_ID_readreg.ino sketch will identify which controller is actually mounted on your Shield.

David.

david.prentice
Posts: 68
Joined: Wed Nov 16, 2016 8:52 am

Re: STM32F103C8 & TFT (ili9325)

Postby david.prentice » Tue Dec 06, 2016 10:05 pm

My IteadMaple arrived in the post this afternoon.
I installed the Maple drivers via the Batch File in the Installation Folder.

The Bootloader would say that it had run but then whinge that it could not reset (or something).

So I changed the Linker file from ld/Flash.ld to ld/jtag.ld to make it run at 0x800000.
Attached the STLink from a NUCLEO board to the Maple SWD pins.
And upload/debug with Rowley.

Is the regular Maple bootloader supposed to be flaky? (I am using Win7-32 on a Laptop)
Should I install the "replacement" Bootloader? Does that work ok?

It is handy to debug via Rowley/STLink. But I would prefer to use a bootloader for regular sketches.

Oh, MCUFRIEND_kbv works on the IteadMaple.

David.

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F103C8 & TFT (ili9325)

Postby RogerClark » Tue Dec 06, 2016 10:59 pm

The old bootloader is normally OK, but you could also try the new one

I have an iTeadMaple but I can't recall the last time I updated the bootloader, as I don't use that board very much.

Note. DFU often displays an error after the upload is complete. This is a problem with DFU and not the bootloader.
The same thing happens when I use dfu-util to upload to the STM32F4 using its own built in hardware USB DFU bootloader, and I also get the same error using other people's bootloaders (like the BlackMagic Probe dfu updater)

neresus
Posts: 9
Joined: Mon Mar 06, 2017 12:57 am

Re: STM32F103C8 & TFT (ili9325)

Postby neresus » Mon Mar 06, 2017 1:14 am

hello

Can help me someone with wiring?
I have mcufriend 2,4" TFT which identifiers like 0x1010
LCD D0-D7 is connected to PB0-PB7
LCD_RD - PA4
LCD_WR - PA5
LCD_RS - PA6
LCD_CS - PA7
LCD_RST - PA8

I use Adafruit_TFTLCD_8bit_STM32 from steve strong.
graphic test prints data to serial console and LCD is flickering but nothing is shown.
LCD is good I tested it on arduino uno and it works (not touch screen because I dont have time to calibrate it).

stevestrong
Posts: 894
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F103C8 & TFT (ili9325)

Postby stevestrong » Mon Mar 06, 2017 9:09 am

@neresus
Please use this sketch from David (with adapted wiring) and post here the resulted serial monitor log.

Be aware that PB4 may be reserved for debug port if you upload via SWI or serial 1 (PA9/10).
For upload via USB DFU get the latest commit from the repository, in particular https://github.com/rogerclarkmelbourne/ ... boards.txt.

Also, post here the header file adapted to your wiring.

neresus
Posts: 9
Joined: Mon Mar 06, 2017 12:57 am

Re: STM32F103C8 & TFT (ili9325)

Postby neresus » Mon Mar 06, 2017 2:36 pm

stevestrong wrote:@neresus
Please use this sketch from David (with adapted wiring) and post here the resulted serial monitor log.

Be aware that PB4 may be reserved for debug port if you upload via SWI or serial 1 (PA9/10).
For upload via USB DFU get the latest commit from the repository, in particular https://github.com/rogerclarkmelbourne/ ... boards.txt.

Also, post here the header file adapted to your wiring.


Here it is:


Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 93 25 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 00 00 00 Manufacturer ID
reg(0x0009) 00 00 00 00 00 Status Register
reg(0x000A) 00 00 Get Power Mode
reg(0x000C) 00 00 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 00 00 00 00 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 00 Inversion Control
reg(0x00B6) 00 00 00 00 00 Display Control
reg(0x00B7) 00 00 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 00 00 00 00 00 00 00 00 Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 00 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 8B 08 8B 08 8B NVM Read
reg(0x00D3) 10 00 10 00 ILI9341, ILI9488
reg(0x00D4) 00 01 00 01 Novatek ID
reg(0x00DA) 00 00 RDID1
reg(0x00DB) 00 00 RDID2
reg(0x00DC) 00 00 RDID3
reg(0x00E0) 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 GAMMA-P
reg(0x00E1) 0C 14 0C 14 0C 14 0C 14 0C 14 0C 14 0C 14 0C 14 GAMMA-N
reg(0x00EF) 06 08 06 08 06 08 ILI9327
reg(0x00F2) 00 07 00 07 00 07 00 07 00 07 00 07 Adjust Control 2
reg(0x00F6) 00 FF 00 FF Interface Control

this is what I add to graphictest for stm32:
#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_TFTLCD_8bit_STM32.h> // Hardware-specific library

//#define TFT_CNTRL_PORT GPIOA
#define LCD_RD PA4
#define LCD_WR PA5
#define LCD_RS PA6
#define LCD_CS PA7
#define LCD_RST PA8
//#define TFT_DATA_PORT GPIOB

#define LCD_D0 PB0
#define LCD_D1 PB1
#define LCD_D2 PB2
#define LCD_D3 PB3
#define LCD_D4 PB4
#define LCD_D5 PB5
#define LCD_D6 PB6
#define LCD_D7 PB7

on boards.txt kdiff3 shows:
your: genericSTM32F103C.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER
my: genericSTM32F103C.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1

stevestrong
Posts: 894
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F103C8 & TFT (ili9325)

Postby stevestrong » Mon Mar 06, 2017 4:31 pm

neresus wrote:reg(0x0000) 93 25 ID: ILI9320, ILI9325, ILI9335, ...

OK, so your controller is ILI9325, and it seems that all port B pins toggle correctly.
Bad news: I have no init sequence for ILI9325, my controller being ILI9328. Forcing the ID=0x9328 may work for 9325 as well, but I cannot guarantee.
good news: David's library supports this controller type, the init sequence being available here.
If you want to use this controller with original Adafruit API (my lib), then you should generate new .h and .cpp files and add them to my lib.

neresus wrote: -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1

You should remove this from your boards.txt file (current official Arduino_STM32 repo from Roger has removed this already), because this would reserve PB4 for debug port, in which case PB4 won't toggle.

neresus
Posts: 9
Joined: Mon Mar 06, 2017 12:57 am

Re: STM32F103C8 & TFT (ili9325)

Postby neresus » Tue Mar 07, 2017 12:06 am

no luck with LCD.
I change initialization sequence but display still only flickering. On next try I will check wiring again and whole 9325 code, still hope than I miss something.

neresus
Posts: 9
Joined: Mon Mar 06, 2017 12:57 am

Re: STM32F103C8 & TFT (ili9325)

Postby neresus » Tue Mar 07, 2017 11:47 pm

I change wiring to:
#define TFT_CNTRL_PORT GPIOB
#define LCD_RD PB3
#define LCD_WR PB4
#define LCD_RS PB5
#define LCD_CS PB6
#define LCD_RST PB7
#define TFT_DATA_PORT GPIOA

#define LCD_D0 PA0
#define LCD_D1 PA1
#define LCD_D2 PA2
#define LCD_D3 PA3
#define LCD_D4 PA4
#define LCD_D5 PA5
#define LCD_D6 PA6
#define LCD_D7 PA7

and tested three different initialization sequences for older versions 9325 and still no luck with it. any suggestions someone?

stevestrong
Posts: 894
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F103C8 & TFT (ili9325)

Postby stevestrong » Wed Mar 08, 2017 7:20 am

The wiring should be changed in the header file:

Code: Select all

Adafruit_TFTLCD_8bit_STM32.h


Return to “Libraries & Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest