RA8875 not found !

Status
Not open for further replies.
the screen works well because I managed to display a color throughout the screen, I think the module is defective, because in the beginning before receiving the screen adafruit 5 ", I had another screen and I I realized that the RA8875 module was very hot.
 
Those photos have better light, but I do not see any photo that lets me trace which wire connects where. How do you imagine that I or anyone else here could possibly help you from those photos? They show only the ends of identical-looking wires.

However, I can see you STILL have nothing connected to the 5V power from Teensy. Looks like you didn't follow my advice from msg #23, where I suggested:

Compare your wires to the 3rd photo on msg #15. Notice the RA8875 "VIN" pin connects differently on yours than on the known-good photo.

Look, I gave you 3 good photos. I really am trying help you....

In the 3rd photo, *YOU* can try to follow which wires connect to which pins. It is easy to see all the wires in my photo. The hardware I showed definitely does work properly. You need to connect your hardware the same way.

Please, do yourself a favor and put some real work into comparing your wires to the known-good wires in my photo.

If you do share more photos, please try to imagine if you were viewing these photos and trying to help. Hopefully you can understand how useless photos are when all the wires are the same color and you do not show the full length of the wire. Nobody can see which wires really connect to which pins.
 
i have only four color:
red, gray, brown and blue.

my connection from RA8875 to teensy 3.6:

red is connected to 3.3v from teensy
gray is connected to GND from teensy
brown is connected to SCK pin 13 from teensy
one dark blue is connected to MISO pin 12 from teensy
one other dark blue is connected to MOSI pin 11 from teensy
one light blue is connected to CS pin 10 from teensy
one other light blue is connected to RST pin 9 from teensy
one dark blue is connected to INT pin 3 from teensy

in your case VIN from RA8875 is connected to 5v from teensy, its because you have external power, in my case, for instance, i have not external power, is for that my VIN
from RA8875 is connected to output 3.3v from teensy powered by USB. The ground from my RA8875 is connected to the GND from teensy. in your case i don't see any connexion from GND,
may be i have problems in my eyes.

i can't connect VIN from teensy to VIN from my module RA8875 because is powered by USB. the ouput 3.3v from teensy is for power RA8875.

on the other hand if I have an external power supply, actually I have to connect the RA8875 pin VIN on the teensy VIN pin (5v) as in your picture.


20190119_210209.jpg

20190119_210214.jpg

20190119_212031.jpg
 
Another possibility is that the wires are not soldered physically, but I can not do it because Monday I would return the module RA8875 where I bought it, that's why I have to test before sending it to to know if it is really the module RA8875 which is defective.
 
What I do not understand is why when I put the command tft.fillScreen (RA8875_RED), the screen comes red, and stops without executing the following commands.

or maybe there is a library conflict, because I also have libraries for stm32 and esp8266, but the Adafruit_RA8875 and Adafruit_GFX libraries exist only once, I do not have duplicates
 
you have right, puttin VIN from RA8875 to 5v from teensy, the program can loaded, but i have always screen blank.
 
may be i found the problem on code from Adafruit_RA8875.cpp
the code for problem is below

Code:
/**************************************************************************/
/*!
      Waits for screen to finish by polling the status!
*/
/**************************************************************************/
boolean Adafruit_RA8875::waitPoll(uint8_t regname, uint8_t waitflag) {
  /* Wait for the command to finish */
  while (1)
  {
    uint8_t temp = readReg(regname);
    if (!(temp & waitflag))
      return true;
  }   
  return false; // MEMEFIX: yeah i know, unreached! - add timeout?
}

the code above appear on method fillScreen, drawRect, drawVurce, ...

when i comment the code, buildertest run until tft.fillScreen(RA8875_MAGENTA);

Code:
/**************************************************************************/
/*!
      Waits for screen to finish by polling the status!
*/
/**************************************************************************/
boolean Adafruit_RA8875::waitPoll(uint8_t regname, uint8_t waitflag) {
  /* Wait for the command to finish */
 /* while (1)
  {
    uint8_t temp = readReg(regname);
    if (!(temp & waitflag))
      return true;
  }   */
  return false; // MEMEFIX: yeah i know, unreached! - add timeout?
}

20190119_235155.jpg

now, when i comment the code where tft.fillScreen appear on buildTest

Code:
 // Play with PWM
  for (uint8_t i=255; i!=0; i-=5 ) 
  {
    tft.PWM1out(i); 
    delay(10);
  }  
  for (uint8_t i=0; i!=255; i+=5 ) 
  {
    tft.PWM1out(i); 
    delay(10);
  }
  tft.PWM1out(255); 
  
 /* tft.fillScreen(RA8875_RED);
  delay(500);
  tft.fillScreen(RA8875_YELLOW);
  delay(500);
  tft.fillScreen(RA8875_GREEN);
  delay(500);
  tft.fillScreen(RA8875_CYAN);
  delay(500);
  tft.fillScreen(RA8875_MAGENTA);
  delay(500);
  tft.fillScreen(RA8875_BLACK);*/
  
  // Try some GFX acceleration!
  tft.drawCircle(100, 100, 50, RA8875_BLACK);
  tft.fillCircle(100, 100, 49, RA8875_GREEN);
  
....

i have the screen below:

20190119_235331.jpg


I almost solved my problem, maybe the RA8875 module is not defective, i need to investigate more time
on the code waitPoll, a register is read, but as I said at the beginning, the RA8875 module always returns 0xFF, maybe it's related to that.
i have problem with registers from RA8875.
 
i have replaced the code from Adafruit_RA8875.cpp for waitPoll by the code below

Code:
/**************************************************************************/
/*!
      Waits for screen to finish by polling the status!
*/
/**************************************************************************/
boolean Adafruit_RA8875::waitPoll(uint8_t regname, uint8_t waitflag) {
  /* Wait for the command to finish */
 /* while (1)
  {
    uint8_t temp = readReg(regname);
    if (!(temp & waitflag))
      return true;
  }   */
  delay(20);
  return false; // MEMEFIX: yeah i know, unreached! - add timeout?
}

now the code run execpted touchscreen (this is another problem)

[ATTACH=CONFIG]15680._xfImport[/ATTACH]

so i think that

the screen is ok it work
the wire connection is ok
RA8875 have problem with register, is for that wich return always 0xFF
touchscreen not work, i need to test all example from adafruit_RA8875
 
I tested using the copy of Adafruit_RA8875 which Teensyduino installs. It worked perfectly without any changes. The only change I made was editing the display size, since I tested with the larger display.
 
i have tested with librarie from teensyduino is a same it don't work i need to modify method waitPoll and comment the code
Code:
/*  if (x != 0x75) {
        return false;
    } */

textMode not work too, i suspect register from RA8875, because textMode read register and write to register

Code:
/**************************************************************************/
/*!
      Sets the display in text mode (as opposed to graphics mode)
*/
/**************************************************************************/
void Adafruit_RA8875::textMode(void) 
{
  /* Set text mode */
  writeCommand(RA8875_MWCR0);
  uint8_t temp = readData();
  temp |= RA8875_MWCR0_TXTMODE; // Set bit 7
  writeData(temp);
  
  /* Select the internal (ROM) font */
  writeCommand(0x21);
  temp = readData();
  temp &= ~((1<<7) | (1<<5)); // Clear bits 7 and 5
  writeData(temp);  
}
 
after modifying the library, textMode works, the hardest will be the touchscreen.

20190120_084532.jpg


all in all, I think, the module is not defective, i hope.

the problem comes from readData() to read spi data after a writing command to spi (writeCommand(xxx)).

I do not know why the method below does not work

Code:
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;
}
 
Last edited:
With RA8875, the SPI speed is set by this code in Adafruit's library.

Code:
#if defined (ARDUINO_ARCH_ARC32)
  uint32_t spi_speed = 12000000;
#else
  uint32_t spi_speed = 4000000;
#endif

Ultimately this is used with SPI.beginTransaction(), which gives you the best speed which does not exceed the number specified.


On Teensy 3.6, the SPI speeds are integer division of F_BUS, where the smallest integer is 2. F_BUS is 60 MHz when Teensy 3.6 runs at 180 MHz.
 
on the code from file Adafruit_RA8875.h, there are defined hex values for RA8875_CMDWRITE, RA8875_CMDREAD, RA8875_DATAWRITE, and RA8875_DATAREAD. these values are transferred directly to the RA8875 through the function SPI.transfer.

Can I ask how you found these value for command read/write and data read/write? there is nothing in the datasheet.

thanks.
 
I did not write Adafruit's library. Kevin Townsend & Limor Fried wrote it.

I merely tested it on Teensy. In the very early RA8875 days I contributed 1 very small timing fix, which they merged into the library years ago. Otherwise, none of this code is my doing. I only tested it and documented that it does indeed work. I really can not answer these sorts of questions about their code, nor about the RA8875 display (which is not a PJRC product). I can only answer questions about Teensy.

Maybe try asking these questions specifically about Adafruit's library and their products on Adafruit's forum?
 
I understand and thanks you for your responses.

what i do not understand is why the function writeReg() and writeData () work well but that readData () does not work, it always returns the value 0xFF for any register, that's why the touchscreen does not n work, I could modify some code to avoid using readData () but not for the use of the touchscreen, unfortunately I can not use the forum of Adafruit because I bought the module RA8875 at a competitor and the forum adafruit is reserved for the customer who buys at their home

thanks.
 
can I use the internal teensy 3.6 sd card without the problem of tristate miso, I think the sdcard uses sdio, is that it?
there is no problem with RA8875 ?

thanks.
 
it's normal that when i remove wire miso from teensy to RA8875, buildtest and textmode work, excepted my problem of readData() ?
else is possible that miso pin from RA8875 is dead ?
 
You are asking strange questions... Why don’t you simply hook up your logic analyzer or your oscilloscope to see what happens with these pins?

Even the cheapest logic analyzers (Saleae Logic clones can be found on Amazon from 8€) can scan 8 pins at a time and directly decode the data protocol (UART, I2C, SPI, etc).
 
there is no problem with RA8875 ?

RA8875 does not properly disable its MISO pin when its CS signal is high. This is a known problem with RA8875.

https://forums.adafruit.com/viewtopic.php?f=47&t=60533&start=45#p323058

You will need to add a tri-state buffer between the RA8875 and other chips.

Notice on Adafruit's project page:

https://www.adafruit.com/product/1590

Please note! The RA8875 does not tri-state the MISO pin, it should not share that pin with any other SPI device (including an SD card reader) without the use of a 74HC125 or similar
 
Even the cheapest logic analyzers (Saleae Logic clones can be found on Amazon from 8€) can scan 8 pins at a time and directly decode the data protocol (UART, I2C, SPI, etc).

This sort of work really needs an oscilloscope, usually with a pair of resistors so the high-Z state can be seen as the signal "floating" at some voltage neither logic low or high.

Using only a logic analyzer, you really can't tell when the signal is floating. The Saleae analyzers are great for many things, but for this scenario they're powerless to show you what you need to see. Trying to use one can really give you a false sense of what's happening on the SPI bus.

There is also a simple way to test using 2 resistors and a voltmeter. I wrote a blog article about this many years ago. Sadly, that site has removed all the old blog. I'm going to republish it soon on PJRC. Here's a link to the Internet Archive of the old article.

https://web.archive.org/web/2016110...rg/blog/paul/better_spi_bus_design_in_3_steps
 
Last edited:
FWIW, I figured out this RA8875 problem just a little over 4 years ago (November 2014)... back before replacing my worn-out workbench.

Here's the photo where you can see the old workbench, worn from years of building PCBs and testing Arduino libraries.... ;)

attachment.php
 
Last edited:
Status
Not open for further replies.
Back
Top