RA8875 from Buydisplay

Status
Not open for further replies.
Hi Kurt,

Please choose the right one with no loose touchscreen controller, those days the FT5206 is integrated on the board and you need I2C and int pin so it's simple like that go anyway for a capacitive controller. The FT5206 needs no calibration that make it much easier too.

Best,
Johan
@ pd0lew
So that leaves us with two options, 4.3" and 7". Price difference is only $5.50.
Don't know which one to choose. I'm afraid the 4.3" will be too small for my poor eyes and the 7" too big my application.
According to the datasheets the 4.3" has an IPS panel and the 7" a TN panel.
Which one do you prefer in terms of viewing angle, image quality?
Are there any reasons you would choose one over the other?
 
@neurofun
The viewing angle from both displays are awesome 4.3 and the 7" I can not choose for you but the 4.3 " is a perfect screen also the 7" both 800 x 480 pixels.
7"and 2.8 ".jpg
Side_view_4.3 ".jpg
So make your choice ...... the small display is a ILI9341.
 
FYI - Today my Adafruit controller and 4...? 480x272 display arrived. I verified that I could run the Adafruit_RA8875 buildtest on it.... The 4.3" display from BuyDisplay shipped as well, but I took the slow cheap shipping charge so it will be awhile probably before it gets here.

And also for what it is worth, I received my 3.3v VRs from Amazon today and soldered one on the back of the 5" display I had, plus a PolCap, plus a small .1uf 0805 and removed J8 solder and

now the adafruit build test does now run on it...
 
@KurtE

Cool that you got both displays working with the Adafruit library. Now a new toy to play with and to get distracted with :)

I ordered one from buydisplay but haven't heard anything yet that it shipped.
 
Sort of surprised as I thought you ordered before I did... maybe I got lucky?

Or because I ordered one before from them
 
@Kurt,

How is the Adafruit RA8875 in your opnion.... at my place I am was not impressed so as mentioned before. Perhaps you can add fonts to the library.
 
How is the Adafruit RA8875 in your opnion.... at my place I am was not impressed so as mentioned before. Perhaps you can add fonts to the library.
Hard to say? These days I am mostly just a tinkerer with things like this...

Have just been trying to get as many things to work with T4 as possible...

Not sure yet, what I will do with these...

Sort of like @mjs513 I think said, something along the line of, another thing to go into my box of displays and sensors...

So any suggestions, sketches, libraries and suggestions on to test, improve, integrate stuff is always welcome.

Again not sure yet how I might try using one. I could for example imagine using one of these to use with the Well monitoring stuff I was doing earlier, which still does not fully work reliably. But then again the well is working so, not a priority :lol: And besides Laik and Annie make sure we check out the well house every day or two.

But for playing with Robots and the like that are battery powered, I am guessing these are probably not the best choice. I think I would be more likely stay with the ILI9341 or maybe go to something smaller like ST7735 or ST7789
 
@mjs513 and ...

I have tried your current stuff on https://github.com/mjs513/RA8875/tree/RA8875_t4 (On T4)

With the new Adafruit display 480x272 and I have tried the Clock2 and the DrawingTest and the display shows up as white.

Note: In both cases I did change the sketch slightly to choose: tft.begin(RA8875_480x272);

I also tried on one of them to add on the SPI pin numbers to the constructor: RA8875 tft = RA8875(RA8875_CS,RA8875_RESET, 11, 13, 12);

Note: The dipslya is working fine with buildtest for Adafruirt_RA8875 library

Time to debug... Which test apps did you try with yours? In a bit I could try moving over the BuyDisplay one which 800x... that I modified for 5v yesterday, which was working with Adafruit test... Although not touch...

Edit: Starting to look at code...
Probably already was similar, but:
Code:
class RA8875 : public Print {
 public:
	// void 		debugData(uint16_t data,uint8_t len=8);
	// void 		showLineBuffer(uint8_t data[],int len);
//------------- INSTANCE -------------------------------------------------------------------
	#if defined(__MK20DX128__) || defined(__MK20DX256__) || [COLOR="#FF0000"]defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__)[/COLOR]
		RA8875(const uint8_t CSp,const uint8_t RSTp=255,const uint8_t mosi_pin=11,const uint8_t sclk_pin=13,const uint8_t miso_pin=12);
	#elif defined(__MKL26Z64__)//TeensyLC
		RA8875(const uint8_t CSp,const uint8_t RSTp=255,const uint8_t mosi_pin=11,const uint8_t sclk_pin=13,const uint8_t miso_pin=12);
	[COLOR="#FF0000"]#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)  || defined(__IMXRT1062__)	[/COLOR]
		RA8875(const uint8_t CSp,const uint8_t RSTp=255,const uint8_t mosi_pin=11,const uint8_t sclk_pin=13,const uint8_t miso_pin=12);
	#elif defined(___DUESTUFF)//DUE

Not sure how that 2nd #elif will ever get used...

Similar stuff in the .cpp file as well...
 
@KurtE

Me either for that matter. Didn't look too close which is on me. Figured I would eventually get back to the lib when other things finished. Anyway I used a benchmark sketch that he had in his other lib - only tested on the adafruit though, here is the version I am using to test:
 

Attachments

  • benchmarks.zip
    2.5 KB · Views: 56
Hi @mjs513 - For the heck of it, I added your Fork into my Fork (git remote add ...)
And right now hacking on your T4 branch... sort of removing some of the duplicates pieces of code and things like:

Code:
#elif defined(__IMXRT1062__)
		//always uses SPI transaction
		// Only supports SPI? 
		if (!SPI.pinIsMOSI(_mosi) || !pinIsMISO(_miso) || !pinIsSCK(_sclk)) {
			_errorCode |= (1 << 1);//set
			return;
		}
		if (!SPI.pinIsChipSelect(_cs)) {
			_errorCode |= (1 << 2);//set
			return;
		}
		pinMode(_cs, OUTPUT);
		SPI.begin();
		digitalWrite(_cs, HIGH);
I already edited this part not to look at hard coding which pins are valid, simply ask SPI if they are valid.
Note: This part of code would not have executed anyway but would have been done by:
Code:
	//------------------------------- Start SPI initialization ------------------------------------------
	#if defined(__MK20DX128__) || defined(__MK20DX256__)
		//always uses SPI transaction
		if ((_mosi == 11 || _mosi == 7) && (_miso == 12 || _miso == 8) && (_sclk == 13 || _sclk == 14)) {//valid SPI pins?
			if (_mosi != 11) SPI.setMOSI(_mosi);
			if (_miso != 12) SPI.setMISO(_miso);
			if (_sclk != 13) SPI.setSCK(_sclk);
		} else {
			_errorCode |= (1 << 1);//set
			return;
		}
		if (!SPI.pinIsChipSelect(_cs)) {
			_errorCode |= (1 << 2);//set
			return;
		}
		pinMode(_cs, OUTPUT);
		SPI.begin();
		digitalWrite(_cs, HIGH);
	#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)//future teensys
Which HAD on it the defined(for T3.5/6 and T4), before I started editing...

I may change the above parts at least for T3.6... To also ask...

But in addition, not sure why the code is doing:
Code:
		if (!SPI.pinIsChipSelect(_cs)) {
			_errorCode |= (1 << 2);//set
			return;
		}
When they are NOT using PUSHR or the like, but are just using digitalWrite? So will remove those tests...

Assuming I figure out why it is failing, will do a PR back to you so you can take a look...

EDIT: Also wondering while at it should add checks for SPI1 and SPI2?
 
@KurtE

Out of curiosity - what branch are u using? I think I have a few more changes that did get into the repository. In the copy I have:
Code:
	//------------------------------- Start SPI initialization ------------------------------------------
	#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) [COLOR="#FF0000"]|| defined(__IMXRT1062__)[/COLOR]  [COLOR="#FF0000"]//This should be deleted in red[/COLOR]
		//always uses SPI transaction
		if ((_mosi == 11 || _mosi == 7) && (_miso == 12 || _miso == 8) && (_sclk == 13 || _sclk == 14)) {//valid SPI pins?
			if (_mosi != 11) SPI.setMOSI(_mosi);
			if (_miso != 12) SPI.setMISO(_miso);
			if (_sclk != 13) SPI.setSCK(_sclk);
		} else {
			_errorCode |= (1 << 1);//set
			return;
		}
		if (!SPI.pinIsChipSelect(_cs)) {
			_errorCode |= (1 << 2);//set
			return;
		}
		pinMode(_cs, OUTPUT);
		SPI.begin();
		digitalWrite(_cs, HIGH);
	#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)//future teensys
		//always uses SPI transaction
		if ((_mosi == 11 || _mosi == 7) && (_miso == 12 || _miso == 8) && (_sclk == 13 || _sclk == 14)) {//valid SPI pins?
			if (_mosi != 11) SPI.setMOSI(_mosi);
			if (_miso != 12) SPI.setMISO(_miso);
			if (_sclk != 13) SPI.setSCK(_sclk);
		} else {
			_errorCode |= (1 << 1);//set
			return;
		}
		if (!SPI.pinIsChipSelect(_cs)) {
			_errorCode |= (1 << 2);//set
			return;
		}
		pinMode(_cs, OUTPUT);
		SPI.begin();
		digitalWrite(_cs, HIGH);
	#elif defined(__IMXRT1062__)
		//always uses SPI transaction
		if ((_mosi == 11 || _mosi == 26 || _mosi == 35) && (_miso == 12 || _miso == 1 || _miso == 34) && (_sclk == 13 || _sclk == 27 || _sclk == 36)) {//valid SPI pins?
			if (_mosi != 11) SPI.setMOSI(_mosi);
			if (_miso != 12) SPI.setMISO(_miso);
			if (_sclk != 13) SPI.setSCK(_sclk);
		} else {
			_errorCode |= (1 << 1);//set
			return;
		}
		if (!SPI.pinIsChipSelect(_cs)) {
			_errorCode |= (1 << 2);//set
			return;
		}
		pinMode(_cs, OUTPUT);
		SPI.begin();
		digitalWrite(_cs, HIGH);
	#elif defined(__MKL26Z64__)//TeensyLC
		//always uses SPI ransaction
		#if TEENSYDUINO > 121//not supported prior 1.22!
			if ((_mosi == 11 || _mosi == 7 || _mosi == 0 || _mosi == 21) && (_miso == 12 || _miso == 8 || _miso == 1 || _miso == 5) && (_sclk == 13 || _sclk == 14 || _sclk == 20)) {//valid SPI pins?
				if ((_mosi == 0 || _mosi == 21) && (_miso == 1 || _miso == 5) && (_sclk == 20)) {//identify alternate SPI channel 1 (24Mhz)
					_altSPI = true;
					if (_cs != 6){//on SPI1 cs should be only 6!
						_errorCode |= (1 << 2);//set
						return;
					}
					if (_mosi != 11) SPI1.setMOSI(_mosi);
					if (_miso != 12) SPI1.setMISO(_miso);
					if (_sclk != 13) SPI1.setSCK(_sclk);
					pinMode(_cs, OUTPUT);
					SPI1.begin();
				} else {//default SPI channel 0 (12Mhz)
					_altSPI = false;
					if (_mosi != 11) SPI.setMOSI(_mosi);
					if (_miso != 12) SPI.setMISO(_miso);
					if (_sclk != 13) SPI.setSCK(_sclk);
					if (!SPI.pinIsChipSelect(_cs)) {//ERROR
						_errorCode |= (1 << 2);//set
						return;
					}
					pinMode(_cs, OUTPUT);
					SPI.begin();
					digitalWrite(_cs, HIGH);
				}
			} else {
				_errorCode |= (1 << 1);//set
				return;
			}
		#else
			_altSPI = false;
			pinMode(_cs, OUTPUT);
			SPI.begin();
			digitalWrite(_cs, HIGH);
			_errorCode |= (1 << 3);//set
		#endif

Not sure about the error codes - he is probably using it for something else. And yes we should probably set it up the way we did before with just testing the pin. Wasn't sure how much time to spend on this one since I don't know if @Paul will accept the changes since Sumotoy doesn't seem to be maintain them anymore.

But it looks like we will be doing it :) Should have my buy display next week - figured I better get it fast.
 
As I mentioned, I had already edited that line... in RED...

Actually in your line more of the line should be deleted as look at the next #elif which is for T3.5/6 which will never be used...

Yep - unsure What @PaulStoffregen will do here. As Sumotoy is not doing anything anymore...
 
Yep = just hooked up the Adafruit deleted T3.5/t36/T4 from that line and still works. Have to go get some more coffee - not thinking this morning - had major troubles sleeping last night.

If we take over the library and just keep pushing changes up to sumotoy maybe Paul will pull it in.
 
Been working through the examples only 2 did I have trouble with (1) BTE test and (2) custom font.

A couple of things that I noticed is that when the display looks like its not working right to the sketch if you unplug/replug the t4 in it works. So not sure its a display issue or a T4 issue. THe other thing I noticed is that the T4 seems to feel hotter than normal.
 
Sounds good. I will continue doing a little hacking (maybe make it work on the different SPI busses...)

First off I am looking through the init stuff. i.e. maybe it doe not work correctly for the smaller display.

Or I noticed in the Adafruit_RA8875 code it may try to start off, at lower SPI speed for the init stuff...

Also interesting, that it appears like the Adafruit_RA8875 runs with SPI_MODE0

Whereas the RA8875 appears to run MOSTLY in SPI_MODE3...

When I say mostly, it appears like the first two bytes might be in MODE0...

Not sure if related to not working or not...
 
Last edited:
All the SPI clock settings are in the RA8875UserSettings.h file in the _settings directory with this note:
Code:
/* Accordly RA8875 datasheet the READ cycles and WRITE cycles have different speed:
System clock/3(only write cycle), System clock/6(with read cycle)
MAXSPISPEED parameters it's also related to MCU features so it probably need to be tuned.
Not all MCU are capable to work at those speeds. Following parameters worked with both board I have.
[COLOR="#FF0000"]After som mail exchange with RAiO I solved the dilemma behind SPI speed limit:
The RA8875 has limitation of 12Mhz SPI but this has been set because not all internal macros
can run over that speed, the library automatically deal with this  so I was able to go over 20Mhz![/COLOR]
At that speed you need to short cables as much you can, provide clean supply and good decoupling!
[COLOR="#FF0000"]DO NOT Exceed 23Mhz for RA8875[/COLOR]! It will result in garbage on screen or run very slow.
*/

Haven't dug into the code but sounds like he changing speeds depending on the macro's used
 
Yep - Also I am wondering about things like Drive Strength and Speed settings for the SPI pins.

Currently they are set to: uint32_t fastio = IOMUXC_PAD_SRE | IOMUXC_PAD_DSE(3) | IOMUXC_PAD_SPEED(3);

Question are DSE(3) is that stronger than DSE(1) or weaker?
Likewise Speed(3), which if I read correctly:
Code:
00 SPEED_0_low_50MHz — low(50MHz)
01 SPEED_1_medium_100MHz — medium(100MHz)
10 SPEED_2_medium_100MHz — medium(100MHz)
11 SPEED_3_max_200MHz — max(200MHz)

Now if we are running SPI at lets say 12mhz, would we be better off at 00 or 01? My guess is if we set clock speed to 12, you need 2*speed (change high, change low).

Wonder if we need to experiment?
 
@KurtE

ok since you mentioned I just poked around the SDK for those values. Hope this helps

Code:
LSPI (Drive Strength Field: R0/6  = DSE (6)
Speed Field: medium(100MHz)   = SPEED(01)
 
Thanks, me at times electrical challenged on strength a larger divider implies more strength?
 
You got me - by trade I am an aerospace engineer so pretty much what I know is ohms law. I picking things up from you all as I go :)
 
@mjs513 - By trade I was Software Engineer, now my brain is mostly retired... When I was getting my CS degrees, I did take a few circuit design type classes, but that was back in the stone age.

Still fighting with trying to get any of the displays to work with the RA8875 library on T4...
(Actually all three of them work somewhat on T3.6....)

As I mentioned, the Adafruit controller with the Adafruit 480x272 display appears to work on my T4 using the Adafruit library and their build test. It draws their test screen and detects my touch and draws where I touched...

But if I start up the drawing test with the RA8875 library, the screen blinks and then goes and stays a bright white... So I thought I would capture the startup sequence for each program with Logic analyzer, then save the capture to file. Used Sublimetext edit to make it a little easier to read for me...
Example start up of Adafruit code:
Code:
WC: 0x00
DR: 0x00,0x75
CMD: 0x88 0x0A
CMD: 0x89 0x02
CMD: 0x10 0x0C
CMD: 0x04 0x82
CMD: 0x14 0x3B
CMD: 0x15 0x00
CMD: 0x16 0x01
CMD: 0x17 0x00
CMD: 0x18 0x05
CMD: 0x19 0x0F
CMD: 0x1A 0x01
CMD: 0x1B 0x02
CMD: 0x1C 0x00
CMD: 0x1D 0x07
CMD: 0x1E 0x00
CMD: 0x1F 0x09
CMD: 0x30 0x00
CMD: 0x31 0x00
CMD: 0x34 0xDF
CMD: 0x35 0x01
CMD: 0x32 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0x8B 0x23
CMD: 0x8B 0x1E
CMD: 0x8B 0x19
CMD: 0x8B 0x14
CMD: 0x8B 0x0F
CMD: 0x8B 0x0A
CMD: 0x8B 0x05
CMD: 0x8B 0x00
CMD: 0x8B 0x05
CMD: 0x8B 0x0A
CMD: 0x8B 0x0F
CMD: 0x8B 0x14
CMD: 0x8B 0x19
CMD: 0x8B 0x1E
CMD: 0x8B 0x23
CMD: 0x8B 0x28
CMD: 0x8B 0x2D
CMD: 0x8B 0x32
CMD: 0x8B 0x37
And with the RA8875... library startup...
Code:
CMD: 0x88 0x0A
CMD: 0x89 0x02
CMD: 0x04 0x82
CMD: 0x10 0x0C
CMD: 0x14 0x3B
CMD: 0x15 0x00
CMD: 0x16 0x01
CMD: 0x17 0x00
CMD: 0x18 0x05
CMD: 0x19 0x0F
CMD: 0x1A 0x01
CMD: 0x1B 0x02
CMD: 0x1C 0x00
CMD: 0x1D 0x07
CMD: 0x1E 0x00
CMD: 0x1F 0x09
CMD: 0x30 0x00
CMD: 0x31 0x00
CMD: 0x34 0xE0
CMD: 0x35 0x01
CMD: 0x32 0x00
CMD: 0x33 0x00
CMD: 0x36 0x10
CMD: 0x37 0x01
CMD: 0x44 0x0A
CMD: 0x21 0x00
CMD: 0x40 0x80
CMD: 0x21 0x00
CMD: 0x88 0x0B
CMD: 0x89 0x02
CMD: 0x04 0x82
Wc: 0x8E
DR: 0x00,0x00
WD: 0x80
CR: 0x00,0xC0
CR: 0x00,0xC0
CR: 0x00,0xC0
CR: 0x00,0xC0
<Again ton of these CR... until change>
CR: 0x00,0x00
CMD: 0x01 0x80
CMD: 0x91 0x00
CMD: 0x92 0x00
CMD: 0x93 0x00
CMD: 0x94 0x00
CMD: 0x95 0xDF
CMD: 0x96 0x01
CMD: 0x97 0x0F
CMD: 0x98 0x01
CMD: 0x63 0x00
CMD: 0x64 0x00
CMD: 0x65 0x00
CMD: 0x90 0xB0
Wc: 0x90
DR: 0x00,0xD8
Wc: 0x90
DR: 0x00,0xD8
Wc: 0x90
DR: 0x00,0xD8
Wc: 0x90
DR: 0x00,0xD8
Wc: 0x90
DR: 0x00,0xD8
... Again lots of the WC/DR
Note: I short handed the output: So CMD: shows a Write command command byte and a Write data and Data byte.
CR: Command read, DR Data read, ...
Don't know much yet on how all of these work, but...
 
Status
Not open for further replies.
Back
Top