I have the RA8875 (1590) module and a TFT 5 " (1596) screen with touchscreen from Adafruit.
at the beginning did not work despite the connection with my teensy 3.6 and the RA8875 was correct, I realized that the readData () function used by the function readReg () always returned the value 0xFF in the code of the file Adafruit_RA8875.cpp.
I am using arduino 1.8.8 and Adafruit_RA8875 v1.0.4 and teensy 3.6.
my wired connection is ok from teensy 3.6
CS = 10
RESET = 9
SCK = 13
MOSI = 11
MISO = 12
INT = 3
I was able to modify some code of the Adafruit_RA8875.cpp library so that the examples work like buildTest and textMode bypassing functions to avoid using the readData () function, but for the touchscreen I can't.
what i do not understand is the writeData () and writeReg () functions work perfectly, it's only the functions of reading registers readData() that return always 0xFF for all registers.
the code below does not work because they use readData ().
Code: Select all
uint8_t Adafruit_RA8875::readData(void)
{
digitalWrite(_cs, LOW);
spi_begin();
SPI.transfer(RA8875_DATAREAD);
uint8_t x = SPI.transfer(0x0);
spi_end();
digitalWrite(_cs, HIGH);
return x;
}
Code: Select all
uint8_t Adafruit_RA8875::readReg(uint8_t reg)
{
writeCommand(reg);
return readData();
}
I was forced to comment the following code otherwise the code was not executed because the return value is always 0xFF
Code: Select all
uint8_t x = readReg(0x0);
Serial.print("x = 0x"); Serial.println(x,HEX);
/* if (x != 0x75) {
return false;
} */
thanks for your help.