RA8875 from Buydisplay

Status
Not open for further replies.
Thanks, I went ahead and ordered some from BuyDisplay...

And: being a gluten for punishment also ordered replacement board as I was already paying for shipping :lol:
 
Last edited:
@KurtE
i was about to post an issue over on Github for sumotoy's library and your last issue you posted there lead me here. I am interested if you all have decided if someone else is going to permanently host a fork that is maintained since sumotoy isn't maintaining it anymore.
I have used hundreds of the RA8875 displays(from buydisplay) over the last couple years with T3.2 and T3.5's and would be interested in submitting some bug fixes in the library if its going to be maintained by someone. As you mentioned in an earlier post here, it would also be nice to get it to a state so that Teensyduino gets packaged with a newer maintained version.
PS. I just got the RA8875 to read images via DMA from external flash and its wicked fast as compared to what I've been able to do in the past by pushing images from Teensy over SPI. During that process, i found an error in the library's "_updateActiveWindow" function. Its setting the Active window Horizontal Endpoints to RA8875_WIDTH which is 800. It should be setting it to 799. This was causing the DMA image transfer to be skewed on an angle because every line would progressively be off by pixel.
 
Hi @Gremlin and @mjs513 and @PaulStoffregen - I am hoping that we find a good place to host some of these display driver updates.

Currently a few of us have been playing around with them and have them working pretty well on the Teensy boards. @mjs513 has our sort of official version up at
The Fork/Branch: https://github.com/mjs513/RA8875/tree/RA8875_t4

It would be great if you could issue a PR to him or me (If me, I would simply PR it back to him with any other changes I find). Currently waiting for parts to hopefully repair my 4.3" 800x480 display (I smoked the backlight circuit) as well as a replacement... Will then probably make sure I can run two of the displays on one T4 or T3.5/6. Can already run the displays and can already do resistive touch, but have not tried capacitive touch which may need me to run I2C on two different Wire objects...
 
Now that I have a few of these displays sitting around:

I now think I might have a 4 working Buydisplay RA8875 displays. 2 5" (one 480x272 resistive touch, one 800x400 capacitive, lost connector) and 2 4.3" capacitive touch

Thought I might do some quick and dirty T4 (maybe support for t3x) board for making it easier to play with one of these boards...

First off wondering if anyone has already done this?

Trying to decide if it should be about same size of display, or maybe just the height of board and wide enough to hold Teensy and some other stuff. Not sure yet what stuff. Probably breakout pins for all easy to get to pins, including bottom surface mount. Not sure yet about SDCards...

Actually a simple board like a working version of Tall dogs breakout with a 2x20 connector that fits the 4.3" size correctly and if convenient an extra 2x8 that hits the 5" version and if it can align properly maybe jumpers to setup to get INT and Reset pins in other connector area...

Thoughts?
 
I like your idea. I have often wished for display breakout boards for 3.2 and 3.6 to tidy-up my breadboard prototyping. If you can make it work well stand-alone but also still bread-board compatible even better! (this might not be feasible with a big display I guess).

(EDIT: I'm not sure how valid the below suggestion is, considering you have Touch functionality but maybe you can incorporate this as an alternative on the touch pins, or potentially as an addition, using other pins.)

If you have free real estate on the board and can still access with the display in place, consider pads for a 5-way joystick such as SKRHABE010 which has a 9.5mm x 9.5mm footprint.

I use this part on a board i had made that carries an spi display and a T3.6.

Maybe an analogue joystick would be more useful to the average user and may compliment touch functonality better, but I just needed a way to navigate numerous menu lists and be able to accurately navigate to single pixel positions on screen. Touch for me was also not ideal for gloved hands, oily fingers, and outdoor rain....
 
Quick update... I played around a little with Diptrace and have a first pass board...

T4-RA8875-3D.jpg

May try a second pass using the castellated board to see how that lays out...

Edit - Yes I know I need to choose my different outline for T4 as to remove a few extra holes...
 
Thanks,

I hacked up another version of it today that uses the castellated breakout board... Also added some jumpers so in theory I can try other SPI pins, like SPI1 and SPI2...

But I think I may need to do a few more things, like maybe I need PU resistors on the Wire pins for getting the touch data? Need to look that up...

Maybe also should make The wire pins configurable... Need to see how hard that would be...

T4-RA8875-3D-C.jpg
 
ADC’s ? How about a DAC or two? Only thing I see missing from the 4. Or maybe some of those spots like for external memory on the audio sheild . I am also a bit worried if the 4is overclocked there might not be a lot iv spare 3.3v for some projects. Anyway that’s probably too much feature creep. The Tennsy fits a lot of projects just because it doesn’t have too much you don’t use. I do find my self going for a board with built in wireless and battery over the Teensy more these days.
 
Sorry, right now I am not looking to keep adding that type of functionality (ADC, DAC) to this board. Mainly playing with it to play more with these boards and then if something else comes up, maybe make a revision with additional things... And as normal, I will put this up on my github with the dip trace sources as well as zip file with gerber/drill...

I can probably easy add one or two more 3.3v/GND pins without much work, as that area is pretty clear...

I changed some of the setup now to allow the I2C Pins to be configurable like the SPI ones were in previous picture. I changed default CS pin to 9 instead of 10, as to
work with Audio board. Moved reset to 30. Combined the two different interrupt pins I had to 1 (32), but it is configurable 3 different ways to hopefully work with a different displays.
5" with Resistive touch 4.3" Capacitive touch and hopefully 4.3" Resistive (don't have one of those...).

The only other thing I am thinking about is if to try to buffer the MISO pin, so can hopefully work with AUDIO board... Although could jumper board to use different SPI...

I am not sure if I want to go to the full extent of: https://github.com/sumotoy/RA8875/wiki/Fix-compatibility-with-other-SPI-devices

But wondering if could just do MISO...
 
Sorry, right now I am not looking to keep adding that type of functionality (ADC, DAC) to this board. Mainly playing with it to play more with these boards and then if something else comes up, maybe make a revision with additional things... And as normal, I will put this up on my github with the dip trace sources as well as zip file with gerber/drill...

I can probably easy add one or two more 3.3v/GND pins without much work, as that area is pretty clear...

I changed some of the setup now to allow the I2C Pins to be configurable like the SPI ones were in previous picture. I changed default CS pin to 9 instead of 10, as to
work with Audio board. Moved reset to 30. Combined the two different interrupt pins I had to 1 (32), but it is configurable 3 different ways to hopefully work with a different displays.
5" with Resistive touch 4.3" Capacitive touch and hopefully 4.3" Resistive (don't have one of those...).

The only other thing I am thinking about is if to try to buffer the MISO pin, so can hopefully work with AUDIO board... Although could jumper board to use different SPI...

I am not sure if I want to go to the full extent of: https://github.com/sumotoy/RA8875/wiki/Fix-compatibility-with-other-SPI-devices

But wondering if could just do MISO...


Kurt,
That's a pity because you design a nice board but the Teensy need also input.... the most important part is than not added. Please consider this because the new T4 has not decent A/D input.
Best regards,
Johan
 
Sorry, I know that there are many of you who would like more Analog stuff.

Maybe in another edition. And/or maybe someone could do a daughter board to add some of this stuff.

As I mentioned, I did rework some of the board to hopefully allow multiple devices on the SPI buss, such that the default configuration might work with both the display and Audio adapter...

Again this is only a V0.1, not sure if it will ever make it to a 0.2... If my track record stays in tact, I expect there will be several problems on the board.

For the heck of it, I ordered a set of them from PCBWay...

But I did upload current versions up to github project: https://github.com/KurtE/Teensy3.1-Breakout-Boards/tree/master/T4 RA8875 touch Shield

As you can see I moved some of the stuff around, like moved the optional external connector from bottom to side, as to minimize how long of traces I needed for the different signals, plus changed from 2x2 jumpers to choose power to a slide switch. Hopefully again I left enough room for switch, depending on power needs.

Now maybe I need to assemble one of those castellated boards...

T4-RA8875-3D-C.jpg
 
I had a few issues with the board, so it would not easily work reasonably without revisions...

Also I already decided I was not going to use the first style of Castellated boards, which I setup in previous one... Decide to setup to be able to hopefully use T4 with or without FRDM castellated, or T3.x
Or T4.x when beta comes out...

So I started hacking the layout... and components:

RA8875-Round-2.jpg

What I can not decide is if to keep smaller, sort of like first one, although maybe a bit wider. Or go full width of RA8875 which costs more, but then you can use the holes for mounting...

And else I might throw on it... KISS -> Kitchen Sink not sure yet.

I already have 2 of the sparkfun I2C connectors on it. I increased number of +5v/+3.3v...

Thoughts are:
a) TTL level converter? One way or Bidirectional? Optionally on which pins? Example could try to select some UART TX pins and/or I2C pins for allowing neopixels and the like.
b) Sound? Simple buzzer or ? ...

Not sure yet what I will do, but playing... Also shows I think the different USB host pad locatiosn
 
@Kurte

As for level shifters I have been using the Adafruit 4 channel level shifter, https://www.adafruit.com/product/757. Doesn't appear suitable for fast SPI though. But looks good for I2C, serial and other pins. So far tested with I2C and serial etc. Personally prefer bidirectional level shifters.

Debating now whether to modify my level shifter shield to use 2 of the level shifters so I can add some additional pins :)

EDIT: Just came across this one I found on Amazon. Limited input side voltage only to 5.5v but.... https://www.amazon.com/Icstation-TX...SZSG57R1Y3P&psc=1&refRID=E5CV37RH2SZSG57R1Y3P
 
Thanks @mjs513 -

I am not sure if I used some of the Adafruit ones like that or not, looks similar to the Sparkfun one: https://www.sparkfun.com/products/12009
If I went with the BSS138 route, could use one of their boards, or simply add a BSS138 and 2 resistors for each one I want Bidirectional ...

I have also played around some with the TXB100x type ones like: https://www.sparkfun.com/products/11771
Which does 4 pins, and are easy to hook up.. But If I remember correctly they won't source much current.
I believe TXB0104 have issues with SPI, but that the TXS0104 works for those as it supports open drain.
So yes the one from Amazon should work.

I am also wondering if either of these setups would be sufficient for potentially driving some Dotstar or Neopixels, or could potentally add sort of like one or 2 TLC like alternative pin outputs.
Maybe like I did on a couple previous boards (Have a little hat that sits on T3.2 just to run one or more Neopixels. Uses a: SN74LV1T125 transistor

Again wondering about sound?
Could go with real simple buzzer RC/Transistor...

I think Audio board is overkill especially since in itself it does not output any sound...
Not sure which speakers, I have on some earlier boards played with some low quality 15mm speaker: https://www.digikey.com/products/en?keywords=AST-01508MR-R

Not sure if easy solution that may work across the different T3.x and T4.x? Maybe something like: use a PT8211 like Paul sells kit for, and maybe setup with one or two small speakers and either a stereo amp or a couple of the small chips one (LM4862)

Maybe just one one LM4862 hooked up to either DAC on T3 or MQS pins on T4.x (10 or 12?)

Thoughts?
 
@KurtE = Good Evening for me at least.

I ordered a few of those TXS0104 level shifters to play with and see how they work. Will probably redesign my shield to use that one if it works well. But sounds like it will. What I like about the breakout board is that I don't have to worry about. Although the TXS looks like I could solder it on the board easy enough - beginning to hate soldering. Really scared on what the 1170 pin spacing is going to be.

As for audio I picked up an Adafruit Mono 2.5W Class D Audio Amplifier - PAM8302 from amazon to play with while testing the Talkie library and it seems to work well at least for mono. Think they have one for stereo (https://www.amazon.com/Audio-Develo...MXEF5RARD55&psc=1&refRID=S5FQQWR05MXEF5RARD55) as well. Never tried playing with MQS probably should find an example to test with. Wonder if a prop shield would work as well.
 
Again wondering about sound?
Could go with real simple buzzer RC/Transistor...
Obviously a buzzer with a PWM pin is fairly easy if you just want to make a noise.

It depends on your needs. If you wanted to play canned sounds, one choice is the DFPlayer mini. It has a micro-SD card reader in it (32GB max). You can control it with a 3.3v UART. You can also do some control without a UART, using several pins, each with different resistors (or just two pins for forward and backward). While it doesn't have a speaker attached, you can hook it up directly to a mono speaker, as it includes an amplifier Its gotten cloned by the usual no-name shops, but the original from DFRobot is fairly cheap:

While it is simple enough to remove the USB card, you can hook the DFPlayer up to a micro USB port, and it acts as a remote drive.

I bought a device with a flash drive instead of a micro SD card, but it was unusable. It did not support being a remote drive when connected with USB. Instead, you have to run a special Windows app to copy stuff to the flash drive, and the app only used Chinese.

As you mention, you could use MQS on the Teensy 4.0, providing you are willing to give up the first SPI port. I don't believe the Teensy 3.x support MQS. The Teensy 4.0 does support MQS, but the audio tool doesn't have the support (I just edited the file manually):

I was noticing in the audio tool, that while the audio tool has support for PWM (with appropriate resistors and capacitors), the notes say it only works for CPU speeds of 48Mhz or 96Mhz.

On the Teensy 4.0, you can use a pre-made I2S mono to speaker converter using either I2S1 or I2S2 (note, the audio tool doesn't support I2S2 -- but just use I2S1 and change the names in the resulting file afterwards). You can use this on the Teensy 3.2, 3.5, or 3.6 as well with I2S1, though note the pins are completely different for Teensy 3.x and 4.0. Note, Adafruit makes a similar board:

I've also tried an I2S stereo adapter I got from Amazon, but like the Audio Shield, you need to use amplifiers for each of the stereo speakers (or use something that takes a headphone jack and includes its own amplifiers):

Paul's PT8211 looks like a simple kit, and he produced a PCB design that should be usable with Teensy 4.0.

Now, if you wanted to use the same pinout between Teensy 3.x and 4.0, it limits your choices:
  • Use a buzzer on a PWM pin (pins 3, 4, 6, 22, and 23 are the pins that all Teensy LC/3.x/4.0 support PWM on);
  • Use a UART to control a DFPlayer (Serial1 is the logical choice with pins 0/1; Pins 7/8 are the only other choice though you have to use #ifdef to use Serial3 on Teensy LC/3.x and Serial2 on Teensy 4.0);
  • I'm not aware of an I2C or SPI MP3 decoder, but if they existed, that would be another option.
 
I am also wondering if either of these setups would be sufficient for potentially driving some Dotstar or Neopixels, or could potentally add sort of like one or 2 TLC like alternative pin outputs.
Maybe like I did on a couple previous boards (Have a little hat that sits on T3.2 just to run one or more Neopixels. Uses a: SN74LV1T125 transistor

In general, the bi-directional level shifters are too slow for neopixels. Here is the classic paper on this from 2014:

They recommend using the 74HCT245 which do 8 parallel translations in one direction. The datasheet says that the change time is 11-90 ns. The WS2812B cycle time is 150 ns. So these should be ok, if you are doing something that needs 8 separate conversions.

There are a lot of variants for 74<x>HC<y>. The AHC series seems to be among the fastest (A stands for Advanced CMOS, H is for high speed, C is for CMOS):

And this paper discusses the general WS2812B protocol:
 
The WS2812B cycle time is 150 ns.

WS2812B communication is done at 800 kHz, so the cycle time is 1250 ns.

The distinction between 0 and 1 is done by varying the time the signal is high within those 1250 nanoseconds. On the tighter timing end, 20% low is sometimes used, which is 250 ns. So you'd want a driver chip with specs significantly faster than 250 ns.

74HCT245 is much better than 90 ns, which isn't even the spec that truly matters, as I'll explain in a moment...

Most datasheets for 74HCT245 also cover 74HC245, which makes finding the right specs more difficult than it should be. Here's the parts of one of those datasheets covering 74HCT245.

sc.png

74HCT245 is plenty fast enough for WS2812B use.

The 74HC245 chip is also fast enough, when used at 5V. But it's rated for a wider range of power supply voltage, from 2V to 6V. They give specs for a variety of different voltages, which makes things more complicated.

The slow 90ns spec only applies for use with 2V power. The "Conditions" column is the key.

sc2.png

When run with 4.5V, the 74HC245 is also plenty fast enough for WS2812B use, even slightly faster than 74HCT245. However, elsewhere in the datasheet says 74HC245 is only guaranteed to recognize inputs over 70% of the power supply as logic high. That's why 74HCT245 is normally used. The extra "T" in the part number means it recognizes inputs over 2.0V as logic high, when powered from 5V. When your signal is 3.3V from Teensy, you want the HCT part.

The thing which really matters, and also isn't very clear in these specs, is any difference between low-to-high versus high-to-low. Since WS2812B relies on pulse widths, if the performance is mismatched for the rising vs falling edge, then the waveform's pulse width is changed. A relatively long propagation delay is actually not very bad, as long as the same signal which went in ultimately comes out. While not explicitly mentioned in these specs, chips like 74HCT245 and 74HC245 are very good in this regard. They can't be any worse than the minimum delay for one case (which is zero) and the max delay for the other, going only by the specs, but in practice the rising and falling cases are usually pretty close to each other.

However, the bidirectional chips are usually terrible in this regard. The rising vs falling edge performance is often mismatched by 10X or more. They're usually fast at high-to-low transitions, but slow low-to-high changes. The output impedance (or drive strength) is also vastly different for high vs low output. Some bidirectionals chips have a one-shot timer for a low impedance pullup, which helps, but still the high and low performance are quite different and the high output is very weak after the timer finishes its short pullup pulse.

These are the reasons why unidirectional chips like 74HC245 should be used. Not only are they fast, but the rising & falling edged speed is well matched for a low-distortion signal. The output drive impedance is consistent. Those are the properties you want when trying to send your signal down a wire to your addressable LEDs.

And when you run these chips at 5V, their specs are plenty fast enough. The really slow specs only apply when using 74HC245 with 2V power, which you wouldn't do for driving WS2812B LEDs that want 5V signals.

Hopefully this long-winded post clears up confusion about the specs. Reading datasheets is hard and understanding which specs truly matter is even harder, especially when none of the datasheets gives you an explicit mention of the specs you need.
 
Last edited:
Thanks Paul and Michael,

Right now I am just playing around. Actually that is all I ever do... As all of this is just for my own amusement.

On the board that I am playing around with options, I added two of the transistors for output only on D24 and D25... (which on T4 and T4.1) I believe is on UART plus Wire pins, so gives some options to play around... Not sure best set of pins, if I also want it to work well with T3.6 as well.

Audio: as you mentioned, simple buzzer is often all I need. But did pick up a couple of the PT8211 from PJRC to play with. On some other boards, I have played around with LM4862M amp chips with small speaker. Would need two to do two speakers. So might simply use something like Adafruit stereo amp with tiny board mount speakers. I thought I had a few sitting around, so far only found one... Will hopefully rig up a setup to see if it works.

Still trying to decide how much of the kitchen sink to add.
 
Thanks Paul for the detailed answer.

I tend to switch back between lithium-ion batteries (3.7v nominal, 4.2v freshly charged) and 5v USB chargers when I use neopixels. So, I've been planning to move from the non-T versions to the T versions, to allow using either source. Of course the universe is not really binary. and things may work at voltages below the specs, but you may get glitches.
 
Last edited:
@KurtE
Ok - got curious again about fonts on the RA8875 and if we could do the same thing as we did with the ILI9341/9488. So I started looking at it in depth and looks like its very possible. I started extracting the font stuff from the 9488 library as the base and think I got most of the pieces need. Getting stuck on a couple things:
Code:
writecommand_cont(ILI9488_RAMWR);
write16BitColor(textbgcolor); and
writecommand_last(ILI9488_NOP);
So in these cases there is no equivalent NOP command that I saw at least not by that name. ILI9488_RAMWR might be RA8875_MRWC but then for write16bitcolor we do some stuff with SPI like:
Code:
	void maybeUpdateTCR(uint32_t requested_tcr_state) /*__attribute__((always_inline)) */ {
		if ((_spi_tcr_current & TCR_MASK) != requested_tcr_state) {
			bool dc_state_change = (_spi_tcr_current & LPSPI_TCR_PCS(3)) != (requested_tcr_state & LPSPI_TCR_PCS(3));
			_spi_tcr_current = (_spi_tcr_current & ~TCR_MASK) | requested_tcr_state ;
			// only output when Transfer queue is empty.
			if (!dc_state_change || !_dcpinmask) {
				while ((_pimxrt_spi->FSR & 0x1f) )	;
				_pimxrt_spi->TCR = _spi_tcr_current;	// update the TCR

			} else {
				waitTransmitComplete();
				if (requested_tcr_state & LPSPI_TCR_PCS(3)) DIRECT_WRITE_HIGH(_dcport, _dcpinmask);
				else DIRECT_WRITE_LOW(_dcport, _dcpinmask);
				_pimxrt_spi->TCR = _spi_tcr_current & ~(LPSPI_TCR_PCS(3) | LPSPI_TCR_CONT);	// go ahead and update TCR anyway?  

			}
		}
	}
which is ok but there is no dc pin. So was looking at how we did for the ST7735.

Any advice or suggestions :)
 
Status
Not open for further replies.
Back
Top