RA8875 library

Status
Not open for further replies.

sumotoy

Well-known member
After long development process (mainly going around tons of chip bugs) the library for RA8875 it's almost usable:
https://github.com/sumotoy/RA8875

Recently I added support for user fonts that render fast, but library support almost all RA features including internal fonts, ROM fonts, SPI Flash. Of course it works really fast with all Teensy's and it's fully compatible with Audio Board.
Apart the infamous bugs, the RA885 chip it's the only one that let you drive large displays (max 800x480) with touch screen and using very few processor resources.
Actually the only drawback it's send images fast due RA hardware limitations and use a SPI isolator circuit if you want to use other SPI devices.
Here's a pretty exaustive wiki https://github.com/sumotoy/RA8875/wiki
 
You are amazing. Many, many thanks from someone who admires your work and wishes he could have as big a impact regarding libraries.
 
Thanks!
dpharris, library works virtually with any display RA8875 based chip, drived in SPI mode.
Currently all Adafruit RA8875 variants and all BuyDisplay (eastrising) RA8875 variants. Only Waveshare has a product that on paper can be set for SPI but it's not true so avoid it.
I'm not affiliated to any vendors but I think that 5" capacitive touch from buyDisplay it's my preferred. The 7" it's also good if you like big things but it's a current sucker so forget battery.
All the buyDisplay has sd holder but it's totally useless, even with SPI isolator circuit, but has Font Rom option, Flash Option (not easy to use), extensive pinouts and keypad connector.
The adafruit lacks of several features but has a 4050 for 5V compatibility, not very useful with Teensy. I will go for capacitive touch, it's more fun!
Current version works perfectly with all Teensy's and support alternative pins for 3 and 3.1/3.2 and second SPI channel for LC.
Works with all 8 Bit arduino's, DUE (include alternative SPI mode) and recently I have tested and worked with ESP wifi chip.
 
Last edited:
Which exactly?
Thx
David

The 7" its here:
http://www.buydisplay.com/default/7-inch-lcd-module-capacitive-touch-screen-panel-i2c-spi-serial

The 5":
http://www.buydisplay.com/default/5-inch-tft-lcd-module-800x480-display-w-controller-i2c-serial-spi

You need to choose this options:
1) Pin Header connection 4-wire SPI
2) 5V option (or 3V3 if you feel more confortable) This is just supply since RA8875 works always at 3V3
The 5" can work only at 3V3 even if they offer 5V! It doesn't have space for the regulator because it's covered by display connector.
3) Capacitive or resistive touch (I will go for capacitive)
4) Micro SD card (none, useless)
5) Font Chip. Most are for chinese but someone told me that ER3301-1 it's for latin, not verified. It cost 1.30US.

The adafruit:
https://www.adafruit.com/products/1590
This is only the board, then you need a screen!
5" 800x480 resistive https://www.adafruit.com/products/1596
7" 800x480 resistive https://www.adafruit.com/products/2354
I cannot find any capacitive Touch Screen option for adafruit.

The Eastrising cost from 39US to 43US , the adafruit 39US+47US(or 40US) and no capacitive, I got both solutions and they look almost the same but second one cost double and I don't like to deal with ultrathis flat cables.
The Adafruit 4050 chip created some problems with the SPI isolator and audio board, haved to desolder, it was added for 5V mcu compatibility and useless with teensy.

It's really important that if you need to use layers in full 16bit mode you cannot go over 480x272 or the library will fall down to 8bit color depth.
Adafruit offer a 4.3" at that resolution, eastrising has a 5", it's importan choose the right display size with RA8875 since you cannot change resolution by settings!
Over 480x272 you can still use layers but only at 8Bit, if you are not using layers you can work at 16bit at any resolution, at 8bit bpp the RA8875 has an internal hardware 16bit color emulator for graphic accellerated functions that works pretty well but it's not enabled for pixel stream that remain always at 8bit.


Again, I'm not affiliated to any company, I've buy all displays and get one for free from an user.
 
Last edited:
You need to choose this options:
[ ...]
5) Font Chip. Most are for chinese but someone told me that ER3301-1 it's for latin, not verified. It cost 1.30US.

oh, hadn't seen this in the other thread. so should i get one and populate U7 (i think it is on ER-TFT070-5), or is this optional?
 
As I said, Font Rom are mainly for 2,3,4bit languages (chinese, etc.), an user told me that ER3301-1 it's for latin but I cannot verify this.
To be honest, I never used FONT rom chip, I choosed (for mistake) and fitted all the chinese ones so I got only chinese glyps on screen. An interesting experiment would be analyze the font rom, discover how font it's stored and how RA8875 read glyps data in order to be able to create a proprietary font chip!
Font Rom stays in a secondary bus of the RA8875 and doesn't use CPU resources.
 
To be honest, I never used FONT rom chip, I choosed (for mistake) and fitted all the chinese ones so I got only chinese glyps on screen.

ah, ok. thanks .. i missed the "not verified" (after "You need to choose ...")
 
Sumotoy, Thanks very much for your great library!
I have a 5" display (800x480) from BuyDisplay.com with the capacitive Touch Screen option.
The connector for the touch is a FPC type connector with 6 "pins".
can you point me to any documentation on what the "pin out" for those 6 lines are?
Thanks for your help.
regards, Whit
 
Normally buydisplay has trougholes as well just near the FPC connector so you can use one of them.
Regarding connections, try wiki I wroted time ago, if you need more help drop me an email.
 
sumotoy, thanks for your reply.
here are photos of the capacitive touch connector.
all the electronics are on the FPC, nothing on the main board.
and no FPC connector near where the FPC comes out.
I will make a board to hold a Teensy, and connect to the capacitive touch FPC, and the main board.
but I have not been able to locate any documentation on "pin out" of the capacitive touch FPC.
Thanks again.
Regards, Whit
ER-TFTM050-3_CapTouch_1a.jpgER-TFTM050-3_CapTouch_2a.jpg
 
WAIT, I found something in the "notes" of the engineering drawing for the capacitive touch panel.

if anybody needs this info:
pin-1 SCL (pin 1 is on the side near the edge of the display)
pin-2 SDA
pin-3 VDD (3.3 volts)
pin-4 WAKE
pin-4 INT
pin-6 GND

sumotoy, when I build my board (and use your great library), I will post a photo..

regards,
Whit
 
Ouch! Thanks for posting photo, I have the same display but everithing it's solder on the board. I really hate FPC, my solder it's too big and my eyes are not as well as before, they should post notes about this before sell!
Good you are able to handle this, I will scream.
You need connect every pin except WAKE.
 
Of course it works really fast with all Teensy's and it's fully compatible with Audio Board.

So the 5.0" screen from BuyDisplay is 100% compatible using the 4-wire SPI using alternate pins while also using the Audio Adapter Board?
With the MISO SPI issue, is there added electronics that are needed or something that needs to be modded?
 
Last edited:
So the 5.0" screen from BuyDisplay is 100% compatible using the 4-wire SPI using alternate pins while also using the Audio Adapter Board?
With the MISO SPI issue, is there added electronics that are needed or something that needs to be modded?

Well that depends.

If you're using no other SPI devices, which means no SD card on the audio board and no 8-pin memory chip soldered on the bottom side, and no other SPI other than the RA8875 is connected, then I'd say there's a pretty good chance it will work. Just make sure SPI.setMOSI(7) and SPI.setSCK(14) are called before you call RA8875.begin(). Then those pins will be used.

As soon as you try to use any other SPI stuff with the RA8875, things get dicey.

The first problem is the RA8875 doesn't properly tri-state its MISO pin. You may need to add a tri-state buffer. Pullup resistors on the CS pins are also a good idea.

The other lurking problem might be lack of SPI transactions used in the RA8875 library. That's not a big deal if you always access every SPI device from your sketch. But as soon as you use the audio library to access the SD card or a flash chip, or if you try to use a SPI-based radio module with an interrupt, you really need SPI transactions used properly in all the code accessing every SPI device. Without proper transactions, it may work for a while, but sooner or later a conflict will occur and your program will usually lock up.
 
My library use SPI transaction from long time, I think it's one of the coolest features that Paul bring to us! This fixed a lot of things in RA8875 library, some internal function can work at full SPI speed but some other not, using SPI transaction I'm able to use all the features at the max speed possible.
It's possible work with audio board but you need to follow wiki here.
Unfortunatly the miso it's not the only problem, the RA8875 has issues on SCLK as well so you need a complete isolator as described in wiki.

I have tested it and produced a video together with Teensy 3.1 and audioboard, it was a spectrum analyzer and signal generator on a 7" display and worked pretty well.
Keep the isolator described in wiki very near Teensy, or the SD card on the audioboard will not work well!
 
Last edited:
Well that depends.

If you're using no other SPI devices, which means no SD card on the audio board and no 8-pin memory chip soldered on the bottom side, and no other SPI other than the RA8875 is connected, then I'd say there's a pretty good chance it will work. Just make sure SPI.setMOSI(7) and SPI.setSCK(14) are called before you call RA8875.begin(). Then those pins will be used.

As soon as you try to use any other SPI stuff with the RA8875, things get dicey.

The first problem is the RA8875 doesn't properly tri-state its MISO pin. You may need to add a tri-state buffer. Pullup resistors on the CS pins are also a good idea.

The other lurking problem might be lack of SPI transactions used in the RA8875 library. That's not a big deal if you always access every SPI device from your sketch. But as soon as you use the audio library to access the SD card or a flash chip, or if you try to use a SPI-based radio module with an interrupt, you really need SPI transactions used properly in all the code accessing every SPI device. Without proper transactions, it may work for a while, but sooner or later a conflict will occur and your program will usually lock up.

Thanks for the explanation. I probably won't be using the SD card reader at the moment, so I guess I'll be okay.

It's people like you, sumotoy, and others who make this technology advance as far as it has already. Keep up the good work guys, it's very much appreciated.
 
Absolutely yes, it's a true honor for me! Teensy it's my preferred toy from long time...
Also there's a new version of TFT_ILI9163C, more stable and possibility of custom users fonts
 
Normally buydisplay has trougholes as well just near the FPC connector so you can use one of them.
Regarding connections, try wiki I wroted time ago, if you need more help drop me an email.

So I just got my ER 5" display with capacitive touch with connector. That connector is SMALL! What do I do with this thing? The pins are too small to solder. And where do the pins go, to the Teensy board?

6pin_fpc_connector.jpg

Do you think I'll need something like this to make it easier?
http://www.adafruit.com/products/1325

I'm looking for something like this, but with 6 pins. This one is so close.
http://www.adafruit.com/products/334
 
Last edited:
When you ordered the display did you select 'Pin Header Connection'?
I have several display from eastrising and all flexible header are already mounted on PCB and accessible in the pin side.
Maybe eastrising changed display type, just wondering why you are the second one that got an fcc connector (that I hate as well)
I found this on ebay, maybe help.
 
When you ordered the display did you select 'Pin Header Connection'?
I have several display from eastrising and all flexible header are already mounted on PCB and accessible in the pin side.
Maybe eastrising changed display type, just wondering why you are the second one that got an fcc connector (that I hate as well)
I found this on ebay, maybe help.

I just ordered some of those breakout boards. I think they'll help.

I did select the 5" Capacitive Touch Panel with Connector. And I guess I got exactly what was in the picture.
5-inch-capacitive-touch-with-controller_1_4.jpg

I had also selected the Pin Header Connection-4-Wire SPI which the 8 pins are soldered and installed.

pinheader-sd-8p_3.jpg
 
Last edited:
pin-1 SCL (pin 1 is on the side near the edge of the display)
pin-2 SDA
pin-3 VDD (3.3 volts)
pin-4 WAKE
pin-5 INT
pin-6 GND

Okay, now I'm trying to figure out how these pins relate to everything else? Where do these 6 touch screen pins go? Do they connect back into the display, or do they connect to the Teensy?

I'm also trying to connect the display to the Teensy and can't find any info on the pins I should use to connect to the Teensy. I'm using an Audio Shield but I won't be using the SD Card.

I found the wiki picture of the TFTM050-3 display, still not clear on the pin #s they go to the Teensy while using Audio Shield, and it's not clear on the 6 touch screen pins. For SPI connection can I use any pin on the Teensy labeled CS as long as I label it in the software? And the wiki says SCLK, is that the same on the Teensy as SCK (pin 13 & 14)?

Also, can I power the 5" display from the Teensy 3.3v output? I don't have any other 3.3v source, just have the 5v powering the Teensy.
 
Last edited:
I'm trying to power up the display and run the drawingTest example, but it looks like the display never powers up. I'm using the 3.3v from the Teensy to the SPI power and ground pins. I believe I've connected the alt pins correctly and the ran the appropriate set commands.
cs 20, mosi 7, miso 8, sck 14
 
Last edited:
Status
Not open for further replies.
Back
Top