Go Down

Topic: STM32F103C8T6 with 3.97" TFT with GxTFT library (Read 815 times) previous topic - next topic

AntonioTesta

Dear friends,

I am trying to put one 3.97" TFT with OTM8009A controller (link 1 bellow) to work with a STM32F103C8T6 (link2 bellow), using GxTFT library (link 3 bellow). I am using the following pins to connect them:

TFT signals D0, D1, D2, D3, D4, D5, D6, D7 connected to PB8, PB9, PB10, PB11, PB12, PB13, PB14, PB15
TFT signals RD, WR, RS, CS connected to PA0, PA1, PA2, PA3
TFT reset signal connected to STM32 reset. VCC (3.3v) and GND properly connected

The problem is how to know where and what changes should be done in the libraries to make the TFT/STM running right !

Does anybody know if there is a step by step script (for dummies) to implement the necessary changes on GxTFT library ?

Any help will be very very appreciated.

1) https://www.aliexpress.com/item/3-97-Inch-TFT-IPS-Touch-LCD-Display-Screen-Module-High-Resolution-800-480-3-97/32960038183.html

2) https://pt.aliexpress.com/item/32525208361.html

3) https://github.com/ZinggJM/GxTFT



ZinggJM

Hi Antonio,

I have only experience with this TFT display using 16bit parallel interface.
The display has solder jumpers to select the bus width.
I do not know if the behaviour of the controller changes if 8bit bus width is used.
With 16bit the controller requires 16bit commands instead of the usual 8bit standard MIPI commands.

So most likely your display will not work with 8bit bus with my controller driver for OTM8009A, as this driver is special for 16bit commands.

Note also, that most of my GxIO drivers do not support 16bit commands, they send 16bit commands per default as 2x8bit.

I do not have the capacity to support the use of my GxTFT library for other configurations than the ones I used myself, as my main activity is for the support of e-paper displays.

As far as I know MCUFRIEND_kbv also supports OTM8009A, but I don't know if it uses 8bit or 16bit commands. And I think displays with OTM8009A can vary considerably and use or need different initialization code.

I do have the same display as you, bought recently from the same seller for a test with Arduino Due, to support an other user with a modified IO driver: GxIO_DUE_P16_rDUINO. The display turned out to be identical to the one I already had.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

david_prentice

#2
Jun 20, 2019, 04:27 pm Last Edit: Jun 20, 2019, 04:29 pm by david_prentice
MIPI controllers always use 8-bit commands.   Regardless of the bus width.

It is only the pixel data that uses the full width of the bus.

An 8-bit bus needs multiple writes to transmit a 16-bit pixel.

I don't think that I do support OTM8009A.
I do support 8080-8 and 8080-16 parallel interfaces.   I STRONGLY recommend that you use 8080-8 with your pin-starved BluePill.
If you are prepared to give feedback,   I will add OTM8009A.

David.

AntonioTesta

#3
Jun 20, 2019, 05:14 pm Last Edit: Jun 20, 2019, 05:43 pm by AntonioTesta
David, thanks for your reply. Unfortunatelly I can not use your suggestion for use 8080 since my hardware project is ready and it uses a generic blue pill STM32F103C8T6 with that 3.97" TFT OTM8009A controller configured to work with 8 bits. So I think I will be in a deep trouble If I do not find a solution... But thanks anyway PS: Do you intend to add the OTM8009A in your library ?

AntonioTesta

Jean-Marc, thanks for replay. I will try to find something in mcufriend libraries. Also I am studing what kind of modifications I need to implement on your GxIO drivers to work as I desire. Thanks so much for help.

Antonio

david_prentice

8080-8 is just a name for the 8-bit parallel bus.   

Your link does not show the pcb properly.   Jean-Marc says that you can select 8080-8 or 8080-16 interface.

ZinggJM

David, Antonio,

This display needs a lengthy initialization sequence, with many commands that exist only as 16bit commands. It does not work without. Some may even be missing in the controller specs.

I assume, these commands can be sent as 2x8bit, but I have never tried, and have no test setup, cable bundle or shield, and no 8bit GxIO driver ready to check. And right now I have no time to test, as we get guests in the coming weeks, and it is gardening and holiday season.
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

AntonioTesta

8080-8 is just a name for the 8-bit parallel bus.   

Your link does not show the pcb properly.   Jean-Marc says that you can select 8080-8 or 8080-16 interface.
Sorry... That links points to portuguese pages.
The correct ones are:


STM32F103C8T6 -> https://www.aliexpress.com/item/32891197661.html

3.97" TFT OTM8009A -> https://www.aliexpress.com/item/32948485780.html

ZinggJM

David, thanks for your reply. Unfortunatelly I can not use your suggestion for use 8080 since my hardware project is ready and it uses a generic blue pill STM32F103C8T6 with that 3.97" TFT OTM8009A controller configured to work with 8 bits. So I think I will be in a deep trouble If I do not find a solution... But thanks anyway PS: Do you intend to add the OTM8009A in your library ?
@AntonioTesta,

I am interested in finding out how this display works with 8bit interface.

I can find out if it works with the existing controller driver with a GxIO P8 variant of either GxIO_DUE_P16_DUESHIELD (which seems to be GxIO_DUE_P8_DUESHIELD_H), or GxIO_STM32F407ZGM4_P16.

If it works I could create a GxIO_STM32_P8_PB8H for you, with minimal effort, but without test.

But I don't yet know how fast I can do this, and if it fails I would need to postpone it.

Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

AntonioTesta

@AntonioTesta,

I am interested in finding out how this display works with 8bit interface.

I can find out if it works with the existing controller driver with a GxIO P8 variant of either GxIO_DUE_P16_DUESHIELD (which seems to be GxIO_DUE_P8_DUESHIELD_H), or GxIO_STM32F407ZGM4_P16.

If it works I could create a GxIO_STM32_P8_PB8H for you, with minimal effort, but without test.

But I don't yet know how fast I can do this, and if it fails I would need to postpone it.

Jean-Marc
Great... and how can I help you in this job ?

ZinggJM

#10
Jun 21, 2019, 01:24 pm Last Edit: Jun 21, 2019, 02:56 pm by ZinggJM Reason: interim info
First with patience, and then with testing with GxIO_STM32_P8_PB8H. I will keep you informed here in this topic.

I add some interim information here:

Note that the inking on the bus-width jumpers may be wrong, and the components and layout slightly different from the picture on the web-site. I think they added a backlight control circuit.
The inking on the last picture on the web-site seems correct, top-down: R4, R5, R7, R6.
Selected is R5, R6 for 16bit.

https://www.aliexpress.com/item/3-97-Inch-TFT-IPS-Touch-LCD-Display-Screen-Module-High-Resolution-800-480-3-97/32960038183.html
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

AntonioTesta

First with patience, and then with testing with GxIO_STM32_P8_PB8H. I will keep you informed here in this topic.
I will be waiting very calm, like a first time father to be waiting for his baby !!! rsrsrs

AntonioTesta

Jean-Marc, I was pushing the 3.97 TFT OTM8009A vendor asking him to inform some way to get his TFT and STM32 working together. He send me the link bellow. I do not know If you had access to the same package.  Please take a look and see if that material would help. I am affraid not !!!

http://download1491.mediafire.com/cbgcqd2m41gg/9jkwo69bqeps3ec/3.97%E5%AF%B8IPS_800X480.zip

Thanks, Antonio

ZinggJM

#13
Jun 22, 2019, 04:53 pm Last Edit: Jun 22, 2019, 05:06 pm by ZinggJM
Antonio,

Thanks for the link. I didn't check if it contains exactly the same as the zip-file I got from the manufacturer, but I took a look at the code, and the code is the same. Same initialization code with the same 16bit commands, same code for address window setting.

Sending 16bit commands as 2 x 8bit commands does not work. Therefore for 8 bit interface a different controller code would be needed.

I will take a closer look at this, but this will take more time.



It looks like any command goes to the IR register. For MIPI code commands it seems clear what to send in the case of 8 bit interface, but for the other 16bit commands this is not yet clear for me, how to set the second part of the index.

e.g.

Code: [Select]
void GxCTRL_OTM8009A::setWindowAddress(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
{
  IO.writeCommand16(0x2A00);
  IO.writeData16(x0 >> 8);
  IO.writeCommand16(0x2A01);
  IO.writeData16(x0 & 0x00ff);
  IO.writeCommand16(0x2A02);
  IO.writeData16(x1 >> 8);
  IO.writeCommand16(0x2A03);
  IO.writeData16(x1 & 0x00ff);
  IO.writeCommand16(0x2B00);
  IO.writeData16(y0 >> 8);
  IO.writeCommand16(0x2B01);
  IO.writeData16(y0 & 0x00ff);
  IO.writeCommand16(0x2B02);
  IO.writeData16(y1 >> 8);
  IO.writeCommand16(0x2B03);
  IO.writeData16(y1 & 0x00ff);
  IO.writeCommand16(0x2C00);
}


Code: [Select]
void GxCTRL_OTM8009A_P8::setWindowAddress(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)
{
  IO.writeCommand(0x2A);
  IO.writeData(x0 >> 8);
  IO.writeData(x0 & 0x00ff);
  IO.writeData(x1 >> 8);
  IO.writeData(x1 & 0x00ff);
  IO.writeCommand(0x2B);
  IO.writeData(y0 >> 8);
  IO.writeData(y0 & 0x00ff);
  IO.writeData(y1 >> 8);
  IO.writeData(y1 & 0x00ff);
  IO.writeCommand(0x2C);
}



Jean-Marc
No personal message please; any question may be useful for other users. Use code tags for code. Make links clickable with URL tags. Provide links to the product in question.

AntonioTesta

Jean-Marc,

Meanwhile I am trying to test TFT3.97 8900A configured to 16 bits mode with generic STM32103C8T6. I connect them exactly as shown in GxIO/GxIO_STM32F103C8T6_P16_TIKY.h. Now I am trying to run one exemple  such GxTFT_Tiky_graphicstest or GxTFT_graphicstest or GxTFT_myTFTs_graphicstest.

I have included or uncomment on them the following:

#include <GxIO/GxIO_STM32F103C8T6_P16_TIKY/GxIO_STM32F103C8T6_P16_TIKY.h>
#include <GxCTRL/GxCTRL_OTM8009A/GxCTRL_OTM8009A.h>
#include "myTFTs/my_3.97_800x480_OTM8009A_STM32F407ZGM4_FSMC.h"

But all of them issue an error message:

--------------------------------------------
C:\Users\...\Documents\Arduino\libraries\GxTFT-master\src\GxIO\GxIO_SPI\GxIO_SPI.cpp: In member function 'virtual void GxIO_SPI::writeData16(uint16_t, uint32_t)':

C:\Users\...\Documents\Arduino\libraries\GxTFT-master\src\GxIO\GxIO_SPI\GxIO_SPI.cpp:224:11: error: 'class SPIClass' has no member named 'transfer16'

IOSPI.transfer16(d);
--------------------------------------------

It seams someone is trying to send data to SPI interface, that I am not using... Any idea about the reason for this ? Do I made some mistake in configuration ?

Thanks, Antonio


Go Up