RA8876LiteTeensy For Teensy T36 and T40

Good morning all :D

@mjs513 - You know me, I got a bone stuck in my teeth ;)
You should try first before you take in the PR: https://github.com/mjs513/Ra8876LiteTeensy/pull/12

But I think I hacked up most places to support rotation 3...

I have not done anything with the status bar like stuff. But the simple rotation test program appears to function (I think)

I added a few more primitives being output to see that they were updated.
 
Good morning all :D

@mjs513 - You know me, I got a bone stuck in my teeth ;)
You should try first before you take in the PR: https://github.com/mjs513/Ra8876LiteTeensy/pull/12

But I think I hacked up most places to support rotation 3...

I have not done anything with the status bar like stuff. But the simple rotation test program appears to function (I think)

I added a few more primitives being output to see that they were updated.

Had a feeling :)

Unfortunately all of a sudden my IDE doesn't want to start - gets up to the point about installing packages and then quits on me - no traces in task manager either. Yes I restarted the computer as well.
 
Sounds like time, to reinstall IDE and Teensyduino...

P.S. - I did add a status text output to the rotation test and I think it is working....

Again for OUR fonts not THEIR fonts... Probably should test their fonts at some point
 
Sounds like time, to reinstall IDE and Teensyduino...

P.S. - I did add a status text output to the rotation test and I think it is working....

Again for OUR fonts not THEIR fonts... Probably should test their fonts at some point

Did that and still the same problem. Ran Arduino_debug and got this but not sure, sounds like a Java issue?
Code:
F:\arduino-1.8.12>arduino_debug
Set log4j store directory C:\Users\Merli\AppData\Local\Arduino15
Loading configuration...
Initializing packages...
java.lang.NullPointerException
        at cc.arduino.contributions.packages.ContributionsIndexer.parseIndex(ContributionsIndexer.java:134)
        at processing.app.BaseNoGui.initPackages(BaseNoGui.java:504)
        at processing.app.Base.<init>(Base.java:273)
        at processing.app.Base.main(Base.java:150)
 
Ok Resolved my problem - Deleted arduino15 folder and IDE started and reinitialized I guess
 
I ran into something like that a few years ago.

What I ended up doing, was some of the following steps: Note: I know more details here than you need, but in case someone else...

a) open a folder window, and go to temp directory: %temp% and delete everything that looks like Arduino. Actually I would clear most everything... Also I sometimes check to make sure my disk is not full.

b) Clear out your Arduino15 directory... On my machine this is: C:\Users\kurte\AppData\Local\Arduino15
This is where all of the Extra boards get installed... Also where preferences.txt is...
My first test is often just to rename this directory to something else and see if starts up OK...

c) Remove most/all of your installed libraries: Again on my machine this is at: C:\Users\kurte\Documents\Arduino\libraries
Again first try is to see if I rename this folder does it come up... If so, I then create a new library folder and move the ones over I think I need...

d) like c) but the whole sketch folder to something else... I had to do this once... I probably should do a variation of this again and move a bunch of sketches I know I will probably never need to some other directory, like I have something like Arduino_old or Arduino_save...

e) Actually this might be a1) If you have a virus protection app installed, try to disable it and see if it runs... Also sometimes maybe have to reinstall with virus protector disabled. Example yesterday when I first tried updated TyCommander, Norton decided to remove half of the apps...

I hope one of these gets you there.

OOPS - Looks like you resolved it before I finished typing... Maybe will leave it here in case someone else runs into something like this.
 
I ran into something like that a few years ago.

What I ended up doing, was some of the following steps: Note: I know more details here than you need, but in case someone else...

a) open a folder window, and go to temp directory: %temp% and delete everything that looks like Arduino. Actually I would clear most everything... Also I sometimes check to make sure my disk is not full.

b) Clear out your Arduino15 directory... On my machine this is: C:\Users\kurte\AppData\Local\Arduino15
This is where all of the Extra boards get installed... Also where preferences.txt is...
My first test is often just to rename this directory to something else and see if starts up OK...

c) Remove most/all of your installed libraries: Again on my machine this is at: C:\Users\kurte\Documents\Arduino\libraries
Again first try is to see if I rename this folder does it come up... If so, I then create a new library folder and move the ones over I think I need...

d) like c) but the whole sketch folder to something else... I had to do this once... I probably should do a variation of this again and move a bunch of sketches I know I will probably never need to some other directory, like I have something like Arduino_old or Arduino_save...

e) Actually this might be a1) If you have a virus protection app installed, try to disable it and see if it runs... Also sometimes maybe have to reinstall with virus protector disabled. Example yesterday when I first tried updated TyCommander, Norton decided to remove half of the apps...

I hope one of these gets you there.

OOPS - Looks like you resolved it before I finished typing... Maybe will leave it here in case someone else runs into something like this.

I would go ahead and leave it or maybe add it to the Wiki. Never came across this one before so it was a new one on me.

RA8876: Internal font doesn't rotate and looks like may have a problem with the anti-alias fonts in different rotations
 
Yes looks like some issues still.

I just updated the setRotation in the ILI_Ada_fontTest4

And I see we have some issues to fix. Not sure yet what all of them are, but there are several.
 
A few things
1. Anti-alias fonts working now.
2. Rotating internal fonts don't think we can there from here. You would probably have to do it like its done in RA8875 by actually drawing pixels.

Loosing IDE everytime I close it and then try to open. Only thing that works is if I use the IDE installer.

EDIT: Take that back happening again. Something strange going on. May have to put it up on GitHub.
 
After digging through the RA8875 library for a few months now, I'm really appreciating the info in this thread. I'm working with the 5" TFT/Captouch/RA8875 display from buydisplay with a T3.6.

Question for the group, and I hope it's not too off topic, but it takes about 1.2s to draw a 800x480 bitmap (on an SD card using SDIO) to the screen. I was hoping to speed this up by loading bitmaps to the second layer and then use BTE to copy them over to the active layer, however RA8875 memory limits you to 8bit color when you use 2 layers at this resolution. I tried to load the bitmap data into a .h file and load it from program memory, but this didn't seem to speed things up at all. I've tried changing the SPIMaxSPeed but the default 18mhz seems to be the fastest option.

Is there a way to speed this up that I am not considering (overclock the Teensy3.6? Adjust some SPI setting?). Would it be better to find a 5" TFT with RA8876 so that I can use the larger program memory/layers and still be 16/24bit color?
 
Yes, the RA8875 cannot handle as much SPI speed as the -6.

Work out the speed yourself. What is 800x480x3x8? That's the minimum number of bits you need to send - just the data. Then divide by 18MHz. That will give you a time. No other speed matters - the speed of the Teensy or the program memory is not a factor.

The -6 library was very inefficient at sending images when I started looking at it a few months back. It would send bytes one-at-a-time with a command byte. So it had to send double the amount of data. To make it even slower, it asked the RA8876 if it was ready in between each data byte. My pull requests have increased the speed significantly by removing this extra overhead. The RA8875 library is equally efficient under most circumstances, but you should do the calculation yourself to make sure that it is really sending only your data and not too much more.

The -6 will make it faster due to the faster SPI speeds. But only 2 or 3 times faster. It has a lot more memory so if you can pre-load the images then you can do a lot more of them. If you can simplify your image so that there are some areas of solid color then you can use graphics primitives to draw those areas thousands of times faster than sending the bytes.

DMA transfers can increase the speed because your Teensy can do other things while the image is loading. But it can't write anything to the TFT until the DMA finishes.
 
Thanks Morgan. Do you know if either library can successfully address (write/read) external flash memory on the buydisplay board? The RA8875 datasheet mentions how to read from it, but not how to write. Also because this is an SPI connection between RA8875 and the flash memory, would it be limited to the same 18MHz?

buydisp.jpg
 
You need to think of working with that memory as you talking to the RA8875 and telling it what to write. "Write an 'A'" "Did you write it yet?" "OK, write a 'B'"...

So loading into the flash memory is going to be slower than normal memory. With some work, it could be made almost as efficient as normal memory. BUT the SPI speed used to talk to that chip is subject to the same limitations as the main SPI interface. As far as I can tell from the datasheeet, it cannot be faster. I've never used it but I have used the font ROM and it seems slow compared to directly loading bulk data.

Then you're subject to the same speed limitation when you try to get that image back off the flash chip and into the RA8875 working memory. If the SPI is slower like I think, then it's going to be slower than sending it from the Teensy directly.

The flash chip only makes sense if you've got lots of medium-to-small images and you can efficiently use the time that the RA8875 is working on transfers to do something else with the Teensy. A big screen update which requires loading two or more images out of flash will force your Teensy to wait for the first image to transfer before it can send the command to transfer the second image.
 
Reading the RA8875 datasheet, looks like the flash SPI interface supports dual and quad lines, potentially doubling or quadrupling the SPI speed. What I don’t see, is how to write data TO the flash chip. Buydisplay sells these flash chips meant for their displays:

https://www.buydisplay.com/new-winbond-ic-chip-flash-128m-bit-w25q128jv-sop8-package

It’s datasheet says it supports up to 400MHz SPI. But without a documented write register I’m not sure what we can do with it.
 
The chip may support 400MHz but the RA8875 only has a limited system clock speed.

Since there doesn't seem to be a write command in the RA8875 register list then perhaps the flash ROM is read-only. (That's why it's called a ROM?) So you would have to program it before soldering it onto the RA8875 carrier board.

There does appear to be a couple of faster SPI modes available to talk to the flash chip. They seem to turn the MOSI line bidirectional so that it can send back 8 bits in only 4 clock cycles. I've never seen that used anywhere. At best, it could double the speed of loading data off the flash chip.
 
Ok, upon further research it looks like the only option is to pre-program the flash memory and then solder it to the board. Not very practical, the least buydisplay could have done was put ICP headers in there, but I also don't see why they wouldn't have programmed the RA8875 to be able to transfer data to the flash chip (the chip they sell can be re-programmed/erased, and the RA8875 datasheet calls if flash).

Apologies for cluttering this thread, I've got my answers. Thanks @MorganS!
 
You can't just put headers on. The Raio chip controls those wires. You can't have another master driving the lines. The Raio chip is equally badly-behaved on the regular SPI bus.

Yes, there's a few things that we wish Raio would have done better. This is not even close to the top of the list. Obviously it isn't important to their real customers who buy in units of thousands.
 
I guys, hopefully you can point out the daft thing im doing. ive downloaded the library from https://github.com/mjs513/Ra8876LiteTeensy

When i open the graphics example and click build i get this error


Code:
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI9341_t3/font_Arial.h:4:0,

                 from C:\Users\Trev\Documents\Arduino\graphics\graphics.ino:8:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\ILI9341_t3/ILI9341_t3.h:170:3: error: conflicting declaration 'typedef struct ILI9341_t3_font_t ILI9341_t3_font_t'

 } ILI9341_t3_font_t;

   ^

In file included from C:\Users\Trev\Documents\Arduino\libraries\Ra8876LiteTeensy\src/RA8876_t3.h:79:0,

                 from C:\Users\Trev\Documents\Arduino\graphics\graphics.ino:7:

C:\Users\Trev\Documents\Arduino\libraries\Ra8876LiteTeensy\src/_fonts.h:25:3: note: previous declaration as 'typedef struct ILI9341_t3_font_t ILI9341_t3_font_t'

 } ILI9341_t3_font_t;

   ^

Error compiling for board Teensy 3.6.

and if i open the example Gauges and click build i get


Code:
C:\Users\Trev\Documents\Arduino\libraries\Ra8876LiteTeensy\examples\gauges\gauges.ino:8:25: fatal error: Ra8876_Lite.h: No such file or directory

compilation terminated.

Error compiling for board Teensy 3.6.


so i went to https://www.buydisplay.com/serial-spi-arduino-10-1-tft-lcd-display-shield-ra8876-for-due and downloaded the example Libraries+Examples for SPI 10.1" Arduino Shield with Capacitive Touch
which had Ra8876_Lite and put a Ra8876_Lite folder into the arduino library folder and then coppied the content of that library folder into that one i made. but when i compile it then i get


Code:
In file included from C:\Users\Trev\Documents\Arduino\libraries\Ra8876LiteTeensy\examples\UserDefinedFonts\UserDefinedFonts.ino:3:0:

C:\Users\Trev\Documents\Arduino\libraries\RA8876_Lite/Ra8876_Lite.h:14:21: warning: extra tokens at end of #ifndef directive

 #ifndef _RA8876_LITE.H

                     ^

C:\Users\Trev\Documents\Arduino\libraries\RA8876_Lite/Ra8876_Lite.h:15:21: warning: ISO C++11 requires whitespace after the macro name

 #define _RA8876_LITE.H

                     ^

UserDefinedFonts: In function 'void setup()':
UserDefinedFonts:54: error: 'class RA8876_t3' has no member named 'setTextAt'
  tft.setTextAt(0,0);

      ^

UserDefinedFonts:60: error: 'class RA8876_t3' has no member named 'setTextColorFG'
  tft.setTextColorFG(myColors[1] , myColors[0]);



Can someone tell me where im going wrong?
 
@gotty101

Ok lets start at the beginning.

1. You need to reinstall the RA8876 library from github: https://github.com/mjs513/Ra8876LiteTeensy. Then delete the RA8876Lite that you installed for Due. The two libraries are not compatible. We made a lot of changes to the Raio RA8876Lite library so it would have additional capabilities like using the ILI9341 or Adafruit GFX fonts. That is why you are getting the errors in your second set of errors.

2. I also just fixed an error associated with using the lib on the T3.6 so definitely download the latest version.

3. In your first set of errors for the RA8876LiteTeensy is a result of the fact that the arial font referenced in the example is not included with the RA8876LiteTeensy library. To resolve copy the ILI9341_fonts library from: https://github.com/mjs513/ILI9341_fonts, and put it in your libraries folder.

Hope this helps and explains what is going on.
 
Hi mjs513,


Thanks for the reply. So i did what you said and it compiles \o/

Thank you for your help

Trev
 

Attachments

  • libs.jpg
    libs.jpg
    20.4 KB · Views: 64
Hello,

I'm just started to play with RA8876 chipset. I bought an 7" from buydisplay.com. Reference is ER-TFTM070-6. There is no touch Panel on my model as I don't need it for my project.

First : this module draw 0,65A, witch is really too much for T4.0 regulator.
Second : Even if I ordered a 4-wire SPI model from buydisplay, it come with jumpers misconfiguration (just something I want other to know before scratching head while looking at the code)

After having solved these hardware things, all is OK with "graphics" sketch. Fast, really fast. There is some flicker on the screen, but I guess that this was not the scope of the sketch to avoid it.

One thing I notice about @mjs513 library is that there are not concordance between the pins used in the "readme.txt" and the one used in examples. I would advice to make them the same ;-)

Also, in "gauges" example, there is a reference to "#include "Ra8876_Lite.h" which is no longer in the library ;-)

Thank you for this library.
Manu
 
@manu - Thanks

Yes - As you mentioned, the display pulls more amperage than 3.3v regulator on the T3.x or T4.x will like to provide, which is why I ordered mine configured for +5v. And so far it has worked fine off of USB power with the Teensy...

How did yours come jumpered? Mine did properly come jumpered for 4 wire SPI as I ordered it. Mine also came configured for using external back light. I modified mine to use the internal PWM.

At the current time it is hard to fully say which is the "Official" branch, hopefully that will resolve. I know that there @mjs513 has issued a PR back to the original owner @wwatson to update his master branch to the our updated stuff.

As mentioned the Readme file is still sort of in the in between state. I believe most of the sketches that we have worked on have different pins than is shown in the Readme.
The two main pins that are probably different include:
a) Reset - Mine are set to 9
b) Backlight - I think some of the sketches are set to 7 - but as I mentioned on my setup I don't use a back light pin instead, I turn on backlight with:
tft.backlight(true);

And if you go through some of the examples and find errors and fix them, it would be great if you issued a PR or mention them here or ...

Thanks again...
Looks like maybe I need to plug mine back in to adapter board.
 
@KurtE - Thank too.
I didn't notice that there are several libraries :confused: I was thinking that you work hand in hand with mjs513.

My display had a strange configuration => a strange mix between 4-wire SPI and 3-wire SPI. I only redo all jumpers to match 4-wire SPI ones.
I didn't tried RA8876 PWM BackLight control yet, but I will soon as it is part of my project to allow software brightness control.

You're 5V way to go is a good catch as it may lower my desk load by removing the power supply for the screen ;-) I'll have a look at the jumper configuration required for 5V (J29) and have a deep look at the board components to figure out if all is OK for going to 5V. What I must also tell is that RA8876 seem really more tolerant to voltage shift than RA8875.
 
Back
Top