RA8876LiteTeensy For Teensy T36 and T40

Clear as muddy water until I play with it some :) But on the serious side. I was looking at that and trying to figure out how to say draw something to the page (buffer) and then upon completion update the screen.

So say I did
Code:
selectScreen(PAGE1_START_ADDR)
then did a bunch of draw commands it still seems to draw immediately. But looking at the code the last line says to
Code:
 Rebuild the display
so do I comment that out and then use
Code:
buildTextScreen();
when ready to draw to update the screen? This is where my confusion lies?

EDIT:
Guess I am trying to equate the page buffers to what we use for say the ili9341 or other similar display, i.e.
Code:
tft.useFrameBuffer
,,,,,,
tft.updateScreen

So basically how do you draw to the buffer then display it. Cant get my head around it,.
 
Last edited:
@mjs513 - I think I understand what you are after. You want to draw on a page that is not being displayed in the background and after you are finished drawing, display that page.
If I am right. To be honest I never have tried that. But I believe it will be done either switching the canvas or the active page. Probably the canvas page.

I will have to experiment with that. I brings up some interesting possibilities.

I have your version of Ra8876LiteTeensy working on my T4 now. I can't believe what you have accomplished so far:)
 
@mjs513 - I think I understand what you are after. You want to draw on a page that is not being displayed in the background and after you are finished drawing, display that page.
If I am right. To be honest I never have tried that. But I believe it will be done either switching the canvas or the active page. Probably the canvas page.

I will have to experiment with that. I brings up some interesting possibilities.
Thanks for 1) figuring out what I was asking and 2) thanks for experimenting to see how it would work. Going through the manual now but......

I have your version of Ra8876LiteTeensy working on my T4 now. I can't believe what you have accomplished so far:)
Thanks. Biggest challenge at first was figuring out what you had where. Once I did that the rest wasn't too bad to do. @KurtE taught me a whole bunch of stuff working on the different display libraries so wasn't too bad, just time consuming.
 
Thanks for 1) figuring out what I was asking and 2) thanks for experimenting to see how it would work. Going through the manual now but......

Thanks. Biggest challenge at first was figuring out what you had where. Once I did that the rest wasn't too bad to do. @KurtE taught me a whole bunch of stuff working on the different display libraries so wasn't too bad, just time consuming.

It look like you have modified and tried the piptest.ino sketch. I ran that on my T4 with a pipdelay = 0 and was getting a loop time of 1400 to 1500 ms. This was a lot slower than ~432 ms in the original driver. I changed lines 147 and 159 from 'tft.print(c);' to 'tft.write(c,1)' and was back at ~423 ms. Don't know what the difference is.
 
Last edited:
@wwatson
Didn't notice the times but the change is when using print its going through the Print Stream when using write directly it goes directly to the display. Was playing to see if it works. Advantage of using print, printf and println you don't have to worry about converting to strings but it is slower.

EDIT: you also could just use write(c). Both forms are supported - probably should add that to the list of things changed.
 
@wwatson
Didn't notice the times but the change is when using print its going through the Print Stream when using write directly it goes directly to the display. Was playing to see if it works. Advantage of using print, printf and println you don't have to worry about converting to strings but it is slower.

EDIT: you also could just use write(c). Both forms are supported - probably should add that to the list of things changed.

Got it. Thanks
Now to do some testing with screen pages.
 
Folks thing I figured it out by reading the manual and the flow chart :)

Code:
void RA8876_t3:: useCanvas()
{
	canvasImageStartAddress(PAGE2_START_ADDR);
	canvasImageWidth(_width);
	activeWindowXY(0, 0);
	ramAccessPrepare();
	check2dBusy();
}

do any drawing to screen - wont update until you do update screen, I think

Code:
void RA8876_t3:: updateScreen() {
	displayImageStartAddress(PAGE2_START_ADDR);
	displayImageWidth(_width);
	displayWindowStartXY(0,0);
}
 
Sounds somewhat reasonable...

Sure would be nice if they had the how to convert RA8875 code to work on RA8876...

With RA8875 you could use could choose which page to use, but you could also OR the pages or use one to lighten...

I know I should RTFM (in more details), but will probably procrastinate doing that until mine arrives... (Still no change in the shipping location since the 17th)
 
About a year ago I built a project around a ER-TFTM101-1 purchased from buydisplay.com. I included a capacitive touch-screen and the GT30L32S4W (aka ER3304-1) font ROM. I hacked up the RA8876 driver, keeping only what I needed. I'm including some photos of the project, a "Literary clock" like http://literaryclock.com. My biggest change to the RA8876 driver was detecting and properly handling characters with descenders, like 'g', 'j', 'p', and 'y'. The included photos show the before and after the code change.

Before:
20190331_101300-crop.jpg

After:
20190407_091222-crop.jpg

A video of the clock in operation is at https://www.youtube.com/watch?v=YcSkkDHdfg0

I'm happy to share the code if you're interested.
 
Sounds somewhat reasonable...

Sure would be nice if they had the how to convert RA8875 code to work on RA8876...

With RA8875 you could use could choose which page to use, but you could also OR the pages or use one to lighten...

I know I should RTFM (in more details), but will probably procrastinate doing that until mine arrives... (Still no change in the shipping location since the 17th)

It does doesn't it. I did forget to add " activeWindowWH(_width, _height);" after "activeWindowXY(0, 0);" but doesn't seem to work :( I am missing something. Not many examples out there.
 
Got a whole screen frame buffer working. Probably can make it faster but this works at least for now:
Code:
void RA8876_t3:: useCanvas()
{
	displayImageStartAddress(PAGE1_START_ADDR);
	displayImageWidth(_width);
	displayWindowStartXY(0,0);
	
	canvasImageStartAddress(PAGE2_START_ADDR);
	canvasImageWidth(_width);
	activeWindowXY(0, 0);
	activeWindowWH(_width, _height);
	check2dBusy();
	ramAccessPrepare();
}

void RA8876_t3:: updateScreen() {
	bteMemoryCopy(PAGE2_START_ADDR,_width,0,0,
				  PAGE1_START_ADDR,_width, 0,0,
				 _width,_height);	
}

Know what you are saying about compatibility to the RA8875 but think that is going to be last on the list :)

EDIT: UPDATE Functions
 
Last edited:
Ok - made a little video for you all using the canvas trick. First part is with Gourand Shading which takes forever to update and display but with a Facet Shader about 2/3s in takes a lot less time. Left it in real time:
 
About a year ago I built a project around a ER-TFTM101-1 purchased from buydisplay.com. I included a capacitive touch-screen and the GT30L32S4W (aka ER3304-1) font ROM. I hacked up the RA8876 driver, keeping only what I needed. I'm including some photos of the project, a "Literary clock" like http://literaryclock.com. My biggest change to the RA8876 driver was detecting and properly handling characters with descenders, like 'g', 'j', 'p', and 'y'. The included photos show the before and after the code change.

Before:

After:

A video of the clock in operation is at https://www.youtube.com/watch?v=YcSkkDHdfg0

I'm happy to share the code if you're interested.

That's way cool. I don't have a font rom on mine so cant test it but if you would like to share maybe we can take a look and incorporate what you did for the font roms. Be honest - haven't gotten that far yet with the rework :)
 
@mjs513 - WOW! Color me impressed. I never thought that would be possible through SPI on the RA8876.
 
@wwatson - thanks. Guess that's what happens when you don't know better. :) But seriously, @KurtE demonstrated that you could use PSRAM for a framebuffer so figured if you could do it on a ILI9488 using SPI you could do it on the RA8876 with its extra memory. Just had to break the code. Not sure if that's the effective way but it does seem to work. Just wish I could get over 38Mhz on the RA8876.

You have to give it a try with some of your stuff or come up with your own test case.
 
My 7" RA8876 arrived today - DHL quoted Monday and delivered 4/30 Thursday instead - box not open yet - it was in China when ordered placed 4/26.

Digikey delivered two tiny displays … have to find the thread that made me order those with fresh Winbond Flash for T_4.1's.
 
@wwatson - thanks. Guess that's what happens when you don't know better. :) But seriously, @KurtE demonstrated that you could use PSRAM for a framebuffer so figured if you could do it on a ILI9488 using SPI you could do it on the RA8876 with its extra memory. Just had to break the code. Not sure if that's the effective way but it does seem to work. Just wish I could get over 38Mhz on the RA8876.

You have to give it a try with some of your stuff or come up with your own test case.

Yes I will. But first I am going try to get the SPI speed up to the 50 MHz that the RA8876 is rated at. You are running at 38Mhz. I am running at 34Mhz. Lead length I think is a factor. But what would be nice is if there was a board that had a 40 pin female adapter with a socket for one of the T4.x. Shortest leads possible. With MISO isolation and TS connection capabilities. The RA8876 device can be used in several ways including parallel busing. With the ability of the T4.X to 16bit data transfers (recently found) could a 8080 or 6800 bus be emulated?
 
I'm including the RA8876 code I'm using for the literary clock.
I use the touch screen on the clock to set options, like brightness, daylight savings time, and font (new times roman or arial).
 

Attachments

  • RA8876.cpp
    28.3 KB · Views: 133
  • RA8876.h
    17.3 KB · Views: 79
@dundakitty - thanks for posting the code. Was looking through and besides the fonts like what you did for the clock frequencies!

@wwatson - just did some rework on the SPI functions to change them to SPI.transfer16s but still can't get over 39Mhz (yeah pushed it up a MHz).
 
@dundakitty - thanks for posting the code. Was looking through and besides the fonts like what you did for the clock frequencies!

@wwatson - just did some rework on the SPI functions to change them to SPI.transfer16s but still can't get over 39Mhz (yeah pushed it up a MHz).

Got the RA8876 running at 47MHz:) I finally received my 3" male/female jumper wires. Today I wired up the RA8876 to the T4.x with the 3" jumper wires untwisted and unshielded and was able to successfully run all of the demos at 47MHz. This was without doing the SPI.transfer16s. Three off from 50 MHz I can live with for now.

Edit: Will try with SPI.transfer16 mod.
 
Got the RA8876 running at 47MHz:) I finally received my 3" male/female jumper wires. Today I wired up the RA8876 to the T4.x with the 3" jumper wires untwisted and unshielded and was able to successfully run all of the demos at 47MHz. This was without doing the SPI.transfer16s. Three off from 50 MHz I can live with for now.

Edit: Will try with SPI.transfer16 mod.

Just changed to 3inch wires and yep - got it up to 47mhz as well and that's with the transfer16s so it just a function of wire length for the display. Like you said 47mhz can be lived with.
 
Just changed to 3inch wires and yep - got it up to 47mhz as well and that's with the transfer16s so it just a function of wire length for the display. Like you said 47mhz can be lived with.

I seem to have a problem with T4.1 that I will elaborate on on the T4.1 beta thread. It's kind of strange but I'm sure it's something I have missed or do not understand.
 
Ok. But interesting. All my testing and dev on the Lib has been using a T4.1? Will look over there
 
PCB Design Published

But what would be nice is if there was a board that had a 40 pin female adapter with a socket for one of the T4.x. Shortest leads possible. With MISO isolation and TS connection capabilities. The RA8876 device can be used in several ways including parallel busing. With the ability of the T4.X to 16bit data transfers (recently found) could a 8080 or 6800 bus be emulated?

Here is the board you are dreaming of... https://oshpark.com/shared_projects/nYL18hj4

This connects a Teensy 3.x or 4.x to any one of the BuyDisplay displays - both RA8875 or RA8876. It connects the I2C bus for a capacative touchscreen. (If you have a resistive touchscreen, then it's probably accessible through the RAiO chip's interface.) If you use one of the "big" Teensys, they will overhang the board.

I did not put a lot of connections on the board. The goal was to make it small. I put some flat-cable (FFC) connectors on to add some satellite boards which hold buttons and encoder knobs. Those boards are not published publicly yet. Because I wanted to experiment, I've put a FFC connector on to hook up the T4.0 SD connector. You can put an SD card on this board or you can FFC over to the BuyDisplay board's SD card FFC. (Note you can't directly plug a T4.0 FFC to the display board as the pins are different.) For the T4, this gives you access to a second SPI port, if you didn't want to use a memory card but you did want another SPI input.

Then, because there was space, I put footprints on for two QWIIC (SparkFun) connectors. Add sensors or knobs, buttons or even a keypad that way. Or use long breadboard headers on the Teensy and hang jumper wires on the back to connect to whatever you need.

Attached is a PDF schematic so you know where all the pins go to.

I'm going to look into using the T4 parallel bus. I would love to get 8 or 16 bits flowing at 30-50MHz. That's enough for real-time video. Unfortunately the Teensy 4.1 doesn't expose the correct pins for the NXP chip's native LCD interface.
 

Attachments

  • LCD Adapter V4.1.pdf
    147.6 KB · Views: 188
Back
Top