STM32F103C8 & TFT (ili9325)

Working libraries, libraries being ported and related hardware
mausi_mick
Posts: 138
Joined: Fri Aug 12, 2016 1:40 pm

Re: STM32F103C8 & TFT (ili9325)

Post by mausi_mick » Thu Nov 24, 2016 5:15 pm

Hi David,

now I have only the problem by the compile to find the penguin in the icons.ino:

undefined reference to `penguin'


excuse me, where is the connection in the source to icons.ino ?

mausi_mick
Posts: 138
Joined: Fri Aug 12, 2016 1:40 pm

Re: STM32F103C8 & TFT (ili9325)

Post by mausi_mick » Thu Nov 24, 2016 5:27 pm

Hi stevestrong,

I tested it with ILI9325 and changed also your .cpp file :

if ((id == 0x9325) || (id == 0x9327) || (id == 0x9328)) {
driver = ID_932X;
...

but no success.
But I don't know, if I have to set TFT_DATA_NIBBLE to 0 or 8 ??
and if I have to take fast bit toggling in the .h file

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

Re: STM32F103C8 & TFT (ili9325)

Post by david.prentice » Thu Nov 24, 2016 5:50 pm

@Steve,

If you compare the public readID() from the two libraries that I linked to, you see why you would not identify the ILI9341, ILI9327, HX8357-D

I also see why begin(0x9341) does not get very far !

There are several approaches for a TFT library:
1. individual library for each controller and interface (and possibly each platform)
2. common code with conditional modules e.g. UTFT
3. identify ID. Implement differences at runtime. e.g. Adafruit_TFTLCD, MCUFRIEND_kbv, ...
4. Only identify ID. Build unique ID class with a Template. e.g. u8glib

(1) is a maintenance nightmare
(2) works ok. slow, limited functionality. wastes a lot of Flash memory on a Uno. Fine for Mega, Due, ...
(3) wastes a lot of Flash memory on a Uno. Fine for Mega, Due, ...
(4) relies on the punter identifying the controller.

I am happy to help with your questions. I suggest that you think through your design strategy.
The Adafruit started with HX8347 and ILI9325. The others have grown. Do you want to keep the HX8347 ?

David.

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

Re: STM32F103C8 & TFT (ili9325)

Post by stevestrong » Thu Nov 24, 2016 7:11 pm

@David,
thanks for your comment, now I realized the mistake I made. ;)
I just corrected the readID function by replacing the "readReg()" by "readReg32()" in the github repo.
I have chosen the first strategy (the nightmare 8-), just hoping that users willing to use this lib will also contribute with at least gathering info about the controller they want to be supported. So everybody contributes with a bit of work.

@mausi_mick
Sorry, but it seems that the Adafruit lib (so as mine) is not configured to read out the ID for 9327 controller yet.
And even if it could, it seems that some more information is missing how to initialize it.
As I don't have such a board, it would be your task to figure out what is needed to configure the chip (ask David?).
Once you have that information, I could implement it in my lib.
Btw, the data nibble should be 0 if you use the lower 8 bits (as indicated in the source code), otherwise 1.
For the first try I would use the slower method (digitalWrite). If that works, then you could try the faster method.
Please pay attention to the reset line! It is crucial that the controller gets a reset at the beginning!

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

Re: STM32F103C8 & TFT (ili9325)

Post by david.prentice » Thu Nov 24, 2016 8:37 pm

@Steve,

Have you looked at UTFT?

It has a specific initlcd() and a setxy() for each controller. Stored on separate disk files.
And an array of sizes, interfaces for each "model".

You can add a new controller or a new interface very easily.
You don't even need to know too much about the initlcd() sequences.
As long as you can draw in Portrait mode, any transformations are handled in Software. e.g. LANDSCAPE

Actually, Adafruit_TFTLCD does some transformations in software. When EVERY controller is capable of drawing in hardware.

Adafruit_TFTLCD takes advantage of C++ heritability etc. e.g. graphics in Adafruit_GFX.h, printing in Print.h
And has a consistent intuitive set of method()s. UTFT is a dog's breakfast.

If you are intending to produce separate libraries, you could do one for the (almost obsolete) ILI9325.
And concentrate standard methods for MIPI controllers in anther library. Possibly some different initlcd() i.e. begin() in Adafruit terminology

David.

mausi_mick
Posts: 138
Joined: Fri Aug 12, 2016 1:40 pm

Re: STM32F103C8 & TFT (ili9325)

Post by mausi_mick » Fri Nov 25, 2016 3:23 am

stevestrong,

thanks for your information and your engagement.

everon
Posts: 1
Joined: Thu Dec 01, 2016 5:02 pm

Re: STM32F103C8 & TFT (ili9325)

Post by everon » Thu Dec 01, 2016 6:27 pm

Hello


Does anyone have a library and example for STM32F103 an this diplay on picture?
Display works with the Arduino Uno and Mcufriend_kbv library.
Attachments
LcdDisplay.jpg
LcdDisplay.jpg (232.76 KiB) Viewed 664 times

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

Re: STM32F103C8 & TFT (ili9325)

Post by stevestrong » Thu Dec 01, 2016 6:30 pm

If you read this thread from the beginning, you should be able to find the needed info.

michael_l
Posts: 337
Joined: Mon Aug 24, 2015 6:11 pm

Re: STM32F103C8 & TFT (ili9325)

Post by michael_l » Thu Dec 01, 2016 9:40 pm

everon wrote:Hello


Does anyone have a library and example for STM32F103 an this diplay on picture?
Display works with the Arduino Uno and Mcufriend_kbv library.
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

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

Re: STM32F103C8 & TFT (ili9325)

Post by david.prentice » Fri Dec 02, 2016 6:18 pm

everon wrote:Hello

Does anyone have a library and example for STM32F103 an this diplay on picture?
Display works with the Arduino Uno and Mcufriend_kbv library.
Yes, it should work on a NUCLEO-F103 board too.
If you have a Maple (with Arduino headers), I will post the necessary driver.

If you have a small "Pill" board, I have no idea how you choose to do the wiring.
I leave it up to you to write your own SPECIAL.

David.

Post Reply