2025-02-08 12:18 PM
Hi there. I require assistance to ensure the proper operation of GT9271.
After properly RESETting the GT9271, and issuing the 0XBA I2C address, the device keeps pulling the INT pin without any touch on the LCD display (1024x600). I really feel a lack of information, and the datasheet does not give a good description of the registers.
This is my code!
#include <main.h>
#include <DLY.h>
#include <stdint.h>
uint8_t FLAG_TP, CXY_BFR[4];
uint16_t TPX, TPY;
uint8_t TP_CNF_INIT[]= //188b
{
0X00, //REGISTER_HIGH
0X00, //REGISTER LOW
0X81, //0X8047 -> 0b10000001
0X00, //0X8048 -> 0b00000000 X-> OUTPUT MAX LOW BYTE
0X04, //0X8049 -> 0b00000100 X-> OUTPUT MAX HIGH BYTE (0X0400 = 1024)
0X58, //0X804A -> 0b01011000 Y-> OUTPUT MAX LOW BYTE
0X02, //0X804B -> 0b00000010 Y-> OUTPUT MAX HIGH BYTE (0X0258 = 600)
0X01, //0X804C -> 0b00001010 TOUCH NUMBER -> 1 POINT ONLY
0X00, //0X804D -> 0B00000000 INT FALLING EDGE
0X20, //0X804E ->
0X01, //0X804F ->
0X08, //0X8050 ->
0X28, //0X8051 ->
0X05, //0X8052 ->
0X50, //0X8053 ->
0X3C, //0X8054 ->
0X0F, //0X8055 ->
0X05, //0X8056 ->
0X00, //0X8057 ->
0X00, //0X8058 ->
0X00, //0X8059 ->
0X00, //0X805A ->
0X00, //0X805B ->
0X00, //0X805C ->
0X00, //0X805D ->
0X00, //0X805E ->
0X00, //0X805F ->
0X00, //0X8060 ->
0X00, //0X8061 ->
0X89, //0X8062 ->
0X2A, //0X8063 ->
0X0B, //0X8064 ->
0X2D, //0X8065 ->
0X2B, //0X8066 ->
0X0F, //0X8067 ->
0X0A, //0X8068 ->
0X00, //0X8069 ->
0X00, //0X806A ->
0X01, //0X806B ->
0XA9, //0X806C ->
0X03, //0X806D ->
0X2D, //0X806E ->
0X00, //0X806F ->
0X01, //0X8070 ->
0X00, //0X8071 ->
0X00, //0X8072 ->
0X00, //0X8073 ->
0X03, //0X8074 ->
0X00, //0X8075 ->
0X00, //0X8076 ->
0X00, //0X8077 ->
0X00, //0X8078 ->
0X00, //0X8079 ->
0X21, //0X807A ->
0X59, //0X807B ->
0X94, //0X807C ->
0XC5, //0X807D ->
0X02, //0X807E ->
0X07, //0X807F ->
0X00, //0X8080 ->
0X00, //0X8081 ->
0X04, //0X8082 ->
0X93, //0X8083 ->
0X24, //0X8084 ->
0X00, //0X8085 ->
0X7D, //0X8086 ->
0X2C, //0X8087 ->
0X00, //0X8088 ->
0X6B, //0X8089 ->
0X36, //0X808A ->
0X00, //0X808B ->
0X5D, //0X808C ->
0X42, //0X808D ->
0X00, //0X808E ->
0X53, //0X808F ->
0X50, //0X8090 ->
0X00, //0X8091 ->
0X53, //0X8092 ->
0X00, //0X8093 ->
0X00, //0X8094 ->
0X00, //0X8095 ->
0X00, //0X8096 ->
0X00, //0X8097 ->
0X00, //0X8098 ->
0X00, //0X8099 ->
0X00, //0X809A ->
0X00, //0X809B ->
0X00, //0X809C ->
0X00, //0X809D ->
0X00, //0X809E ->
0X00, //0X809F ->
0X00, //0X80A0 ->
0X00, //0X80A1 ->
0X00, //0X80A2 ->
0X00, //0X80A3 ->
0X00, //0X80A4 ->
0X00, //0X80A5 ->
0X00, //0X80A6 ->
0X00, //0X80A7 ->
0X00, //0X80A8 ->
0X00, //0X80A9 ->
0X00, //0X80AA ->
0X00, //0X80AB ->
0X00, //0X80AC ->
0X00, //0X80AD ->
0X00, //0X80AE ->
0X00, //0X80AF ->
0X00, //0X80B0 ->
0X00, //0X80B1 ->
0X00, //0X80B2 ->
0X00, //0X80B3 ->
0X00, //0X80B4 ->
0X00, //0X80B5 ->
0X00, //0X80B6 ->
0X02, //0X80B7 ->
0X04, //0X80B8 ->
0X06, //0X80B9 ->
0X08, //0X80BA ->
0X0A, //0X80BB ->
0X0C, //0X80BC ->
0X0E, //0X80BD ->
0X10, //0X80BE ->
0X12, //0X80BF ->
0X14, //0X80C0 ->
0X16, //0X80C1 ->
0XFF, //0X80C2 ->
0XFF, //0X80C3 ->
0XFF, //0X80C4 ->
0X00, //0X80C5 ->
0X00, //0X80C6 ->
0X00, //0X80C7 ->
0X00, //0X80C8 ->
0X00, //0X80C9 ->
0X00, //0X80CA ->
0X00, //0X80CB ->
0X00, //0X80CC ->
0X00, //0X80CD ->
0X00, //0X80CE ->
0X00, //0X80CF ->
0X00, //0X80D0 ->
0X00, //0X80D1 ->
0X00, //0X80D2 ->
0X00, //0X80D3 ->
0X00, //0X80D4 ->
0X00, //0X80D5 ->
0X02, //0X80D6 ->
0X04, //0X80D7 ->
0X06, //0X80D8 ->
0X08, //0X80D9 ->
0X0A, //0X80DA ->
0X0F, //0X80DB ->
0X10, //0X80DC ->
0X12, //0X80DD ->
0X16, //0X80DE ->
0X18, //0X80DF ->
0X1C, //0X80E0 ->
0X1D, //0X80E1 ->
0X1E, //0X80E2 ->
0X1F, //0X80E3 ->
0X20, //0X80E4 ->
0X21, //0X80E5 ->
0X22, //0X80E6 ->
0X24, //0X80E7 ->
0XFF, //0X80E8 ->
0XFF, //0X80E9 ->
0XFF, //0X80EA ->
0XFF, //0X80EB ->
0XFF, //0X80EC ->
0XFF, //0X80ED ->
0XFF, //0X80EE ->
0X00, //0X80EF ->
0X00, //0X80F0 ->
0X00, //0X80F1 ->
0X00, //0X80F2 ->
0X00, //0X80F3 ->
0X00, //0X80F4 ->
0X00, //0X80F5 ->
0X00, //0X80F6 ->
0X00, //0X80F7 ->
0X00, //0X80F8 ->
0X00, //0X80F9 ->
0X00, //0X80FA ->
0X00, //0X80FB ->
0X00, //0X80FC ->
0X00, //0X80FD ->
0X00, //0X80FE ->
0XD6, //0X80FF ->
0X01 //0X8100 ->
};
void TP_RESET() //RESET GT9721 AND DEVICE ADDRESS = 0XBA
{
GPIOB -> BSRR = 1<<(14+16); //TP_RST RESET -> PB14
DEL_MS(25);
GPIOB -> BSRR = 1<<14; //TP_RST SET -> PB14
DEL_MS(50); //ADDRESS SET 0XBA
DEL_MS(50); //ADDRESS SET 0XBA
}
void TP_INIT() //GT9721 INITIALIZATION
{
TP_CNF_INIT[0]=0X80; //FIRST REGISTER ADDRESS
TP_CNF_INIT[1]=0X47; //SECOND REGISTER ADDRESS
HAL_I2C_Master_Transmit(&hi2c1, GT9271_ADDR_W, TP_CNF_INIT, sizeof(TP_CNF_INIT), 100);
}
void TP_GET_XY() //GET TP X + Y COORDNATES
{
TP_CNF_INIT[0]=0X81; //FIRST REGISTER ADDRESS
TP_CNF_INIT[1]=0X50; //SECOND REGISTER ADDRESS
HAL_I2C_Master_Transmit(&hi2c1, GT9271_ADDR_W, TP_CNF_INIT, 2, 100);
HAL_I2C_Master_Receive(&hi2c1, GT9271_ADDR_R, CXY_BFR, 4, 100);
TPX=(CXY_BFR[1]<<8) + CXY_BFR[0];
TPY=(CXY_BFR[3]<<8) + CXY_BFR[2];
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13); //TEST ONLY
FLAG_TP=0X00;
}
As you can see, it keeps trigring INT pin withouT any reason.
Please help me to proper configure the GT9721 to my lcd, ER-TFTM101-1.
Thank you!
2025-02-08 12:48 PM
Are you aware that you are asking for support for a Goodix GT9271 touch controller in the community of STMicroelectronics?
Doesn't Goodix have a forum where you can ask?
Good luck!
/Peter
2025-02-08 02:04 PM
Yes! I am aware!
Goodix does not support me; instead, they tell me to ask for help with the LCD vendor. If someone could help me, I would really appreciate.
Regards,
2025-02-09 02:28 AM
Ahm… STMicroelectronics is also not an LCD manufacturer.
2025-02-09 08:06 AM - edited 2025-02-09 08:08 AM
Peter BENSCH, thank you!
I am reaching this forum because the best STM programmers are here. I do believe that lots of developers here have the solution for this correct initialization procedure, at least the ones who don't follow the "libraries."
If this topic is boring you, please advise; I will be glad to delete it and apologize for the mistake. If not, please let someone who passed through this problem help me; once that GOODIX datasheet is a mess, they cannot even discern between the words "who" and "how.".
I need help! I don't have the necessary information to solve a problem and this is blocking me from going further in my development. If you can help, thank you; if you cannot, thank you the same way!
Regards!
2025-02-09 10:08 AM - edited 2025-02-09 10:08 AM
Ah, I see. In my unbiased opinion, stackoverflow would probably be better suited to your question, but let's see if someone comes up with something helpful.
Good luck!
/Peter
2025-02-09 01:45 PM
Perhaps attach the panel data sheet you're working from.
Confirm you're looking at the right pin, and configuring it correctly. Perhaps dump all the registers, check if there's a WHO AM I type register.
Sure you're looking at the touch controller interrupt and not that of the display controller?
2025-02-09 01:52 PM
This is the Rev 04 document, it's better than the mess that is Rev 00
https://www.orientdisplay.com/wp-content/uploads/2022/08/GT9271.pdf
Other forum's or Arduino library implementations might be enlightening.
https://forum.pjrc.com/index.php?threads/goodix-gt9271-touch-screen-coordinates-inverted.75113/
2025-02-10 05:40 AM - edited 2025-02-10 05:48 AM
Mr. Peter BENSCH Thank you for the tip, but I really HATE Arduino... It is my fault for sure. I refuse to look for an answer in these locations. It seems to me that they don't understand very well what they are doing.
Mr. Tesla DeLorean Thank you! I assure you that the LCD is working pretty fine; absolutely no issues with it. The touch controller has nothing to do with the RA8876 LCD processor, and it is working fine.
GOODIX did not answer, but BUYDISPLAY does. It seems to me that the BUYDISPLAY is a decent supplier, with high-quality products, and they sent me a new initialization sequence that I will test within this week. If it works, I will post here because this may help others to make the GT9271 work fine with the 1024×600 LCD.
By the way, the LCD datasheet does not show much, just the basics, but it is pretty well explained. The LCD model is ER-TFTM101-1, a pretty nice and well-done piece of equipment.
Let's see how it goes!
Nice day for all!
2025-02-10 06:57 AM
https://www.buydisplay.com/download/manual/ER-TFTM101-1_Datasheet.pdf
Only mentions XPT2046
Show wiring for YOUR implementation
The GOODIX chip is like a decade old, not entirely surprised the support is lack luster.
Arduino or Linux drivers might be illustrative of initialization or issues. Especially if interrupts need special consideration, and commented about observed behaviour.