RA8875 from Buydisplay

Status
Not open for further replies.
@mjs513 - I could simply issue a PR back to you, and we hopefully be in sync again... Either works for me for now... Hopefully we find better spot... Also maybe back to some master branch...
 
@mjs513 and others - My T4_multi ... was merged back into @mjs513... https://github.com/mjs513/RA8875/tree/RA8875_t4
So I then deleted that branch, and have sunk up my branch: https://github.com/kurte/RA8875/tree/RA8875_t4 to be in sync...

@mjs513 - the merge maybe updated the max SPI speed... 12mhz instead of 22mhz... Not sure if you want to undo that part?
Also thinking it would be nice to maybe add third optional parameter, to begin with max SPI speed or add another method, with it?

I always hate when things appear to maybe need to change on a display by display basis and is hard coded into library. This is an example of it (yes ILI9341_t3n has same one),
Also how the calibration of resistive touch screens....
 
@mjs513 - the merge maybe updated the max SPI speed... 12mhz instead of 22mhz... Not sure if you want to undo that part?
Also thinking it would be nice to maybe add third optional parameter, to begin with max SPI speed or add another method, with it?
I think that's a good idea.

Managed to make both the 4.3" & 7" work with T3.6.
Max spi speed is 18MHz for both displays. Faster and the output on the screen is corrupt.

The 4" with T4 runs at 22MHz.
And yet the 7" refuses to work with the T4. Even with added reset pin and speed at 12MHz.
Again my second T4 acted strangely, the led(SCK to display) would flicker inconsistently compared to the 4" display.
Switched everything off, disconnected the display, the T4 did not appear on usb anymore. Had to restore it twice to make it come back alive,

I am out of idea's since the 7" display runs fine with T3.6.
Could this have to do something with Drive Strength and Speed settings for the SPI pins?
 
@neurfun

There are a couple of possibilities I think. Yes drive strength could be a factor. I did make the change for the 4.3 in display that @KurtE recommend in post #117 that adjust drive strength and speed. You can give that a try with the RST connected. The other possibility is that the 7 in display is causing a brown out with the T4. Reading Sumotoys wiki it does say that those displays do pull a bit of power on startup. You could try powering the display from an external power source? But give the drive strength a try first.

@KurtE - I will give it a check to see - if 12 will change back to 22Mhz.

Also thinking it would be nice to maybe add third optional parameter, to begin with max SPI speed or add another method, with it?
Think that would be a good idea with these displays. If the fastio settings work for @neurofun probably should update it with a PR?

EDIT: Just checked its at 22Mhz.
 
@mjs513

T4 is powered by usb, 7" display is powered by an external 5V psu. RST is connected.

Adjusting drive strength and speed to
Code:
uint32_t fastio = IOMUXC_PAD_DSE(6) | IOMUXC_PAD_SPEED(1);
did not help.

The third time I powered up the T4 and 7", the T4 fried instantly since the led did not light up.

I'm seriously starting to think there is something wrong with the 7" display although it works fine with the T3.6
I need to investigate this further but I'm not willing to sacrifice a third T4, I have only 2 left.
Maybe I should start a new thread for this specific issue which is clearly hardware related.
 
@neurofun

As a test I just tried my 4.3in display using a 5v Anker power bank as an external power source to the display. Have fastio setup and RST connected. T4 connected directly to the computer. Benchmark sketch worked no issues. I did connect gnd on the display to gnd on the T4 for the test. Something strange is going on.

I did not notice that the T4 orange lite came on when power was applied to the display without power to the T4. If I disconnected SCK the orange lite went out. May want to check if this happens on the T3.6 as well.

Did you try and replug the T4 and do a 15s reboot just to make sure its fried?
 
@neurofun @mjs513 - I was also going to suggest, disconnecting everything from that T4, plug it in and hold the program button in for 15+ seconds, and see if the dim LED turns on, hopefully within 30 seconds, if so, release the button, and the LED should get brighter and then it should reprogram the T4 back to the shipping blink program.

And also like I suggested with @mjs513 I would double check the display and make sure it was shipped configured for 5V and 4 wire SPI. Although since it worked on T3.6 I assume so.

And as @sumotoy I believe said on his Wiki, that don't try to run the 7" using USB power... So if all else fails, maybe try rebooting your computer. Maybe the USB was overloaded and shut off... I hit that a few times, where my computer will complain about something overloaded USB...
 
@neurofun @mjs513 - I was also going to suggest, disconnecting everything from that T4, plug it in and hold the program button in for 15+ seconds, and see if the dim LED turns on, hopefully within 30 seconds, if so, release the button, and the LED should get brighter and then it should reprogram the T4 back to the shipping blink program.

And also like I suggested with @mjs513 I would double check the display and make sure it was shipped configured for 5V and 4 wire SPI. Although since it worked on T3.6 I assume so.

And as @sumotoy I believe said on his Wiki, that don't try to run the 7" using USB power... So if all else fails, maybe try rebooting your computer. Maybe the USB was overloaded and shut off... I hit that a few times, where my computer will complain about something overloaded USB...

Yeah, it likely is trying to use too much power. If you have an ammeter, you could hook it up to see the power draw.

I really like this voltage/ammeter because it has a bluetooth component, and I can connect to it via my Android smartphone. That way, it doesn't matter whether I can see the screen of the meter, as I can see it on the phone, once I connect to it.

But I do wish it handled non-USB power supplies, and also had a screen entry for min/max power draw. When I'm testing my digital cameras power usage, I often want to know the max amps (and hence watts) that the camera drew at any time, so I can properly size the voltage converters and batteries.
 
@neurofun

As a test I just tried my 4.3in display using a 5v Anker power bank as an external power source to the display. Have fastio setup and RST connected. T4 connected directly to the computer. Benchmark sketch worked no issues. I did connect gnd on the display to gnd on the T4 for the test. Something strange is going on.
My 4.3" display works perfectly with T4, without the fastio setup.

I did not notice that the T4 orange lite came on when power was applied to the display without power to the T4. If I disconnected SCK the orange lite went out. May want to check if this happens on the T3.6 as well.
That's because the RA8875 CS, SDI and SCLK inputs each have a 10k pull up resistor to 3.3V(R1, R3, R3, respectively). So the SCLK pin feeds 3.3V via the pull up resistor to the led.

Did you try and replug the T4 and do a 15s reboot just to make sure its fried?
Oh I'm sure it is fried, on both T4 the fuse is too hot to touch.

@KurtE
All jumpers were double checked before putting the displays to use.

@MichaelMeissner
In both cases, T4 and T3.6, the displays are not powered by usb but a separate 5V supply.
 
Oh I'm sure it is fried, on both T4 the fuse is too hot to touch.
Sorry to hear that, it is never a good sign!

Again I assume you checked the chip to see if by chance you can see some short that is there, like a solder bridge...
 
Sorry to hear that, it is never a good sign!

Again I assume you checked the chip to see if by chance you can see some short that is there, like a solder bridge...

Rest assured that everything I solder I first check optically with a 9x magnifier and then electrically with a multimeter for shorts and continuity. Before I even think of powering the circuit.

Did some more troubleshooting.
After analysing the pcb's from both displays it is clear that the only difference is the size of the pcb and lcd panel. The circuit or schematic is the same. So it doesn't make sense that one works and the other not.
As stated before the RA8875 CS, SDI and SCLK inputs each have a 10k pull up resistor to 3.3V(R1, R2, R3, respectively).
So I measured the voltage on those inputs with the display powered but not connected to anything.

4" display
CS 3.3V
SDI 3.3V
SCLK 3.3V

7" display
CS 0.12V
SDI 3.3V
SCLK 3.3V

Clearly something is wrong with the CS input. I can measure the pull up's resistance of 10k between pin5 of the connector and the 3.3V rail which means the resistor is ok.
My conclusion for the moment is that the RA8875 chip is the culprit and not performing up to specs.
Next logical step is to contact BuyDisplay about this issue.
 
@neurofun - As I said I assumed... Sounds like you are more diligent than I am ;) I sometimes hardly wait until the solder has cooled before I power it it up and hope I don't see the magic smoke...

@All
EDIT: FYI - Looks like my 4.3" BuyDisplay should arrive sometime tomorrow.

I thought I would take a quick look through and see about adding that third parameter to begin, for max SPI Speed, probably default to -1, which will use the configuration file settings...

But looking at this stuff, I have a bad habit of maybe fixing things that maybe don't need to be?

For example currently there are some static members of the class. Which may make it such that it would not work properly if you had more than one of these displays hooked up to a Teensy. For example I could easily suppose someone may setup some form of display unit with three of them hooked up to a T4 with each one having their own SPI buss (as to not have to deal with SPI_MODE3 issues or MISO pin issues...
Code:
#if defined(__MKL26Z64__)
	static bool _altSPI;
#endif
#ifdef SPI_HAS_TRANSACTION
	static volatile uint32_t _SPImaxSpeed;//holder for SPI speed
#endif

Make sense to make this non-static? I will probably do so, and if it works, then do a PR back to @mjs513.

Also potentially may convert the multi SPI support of LC to be like I have done for T3.5/6 T4 where instead of having _altSPI testing everywhere you just use a pointer to the SPI object... So things like:
Code:
	void _startSend()
		__attribute__((always_inline)) {
		#if defined(SPI_HAS_TRANSACTION)
			#if defined(__MKL26Z64__)	
				_altSPI == true ? SPI1.beginTransaction(SPISettings(_SPImaxSpeed, MSBFIRST, SPI_MODE3)) : SPI.beginTransaction(SPISettings(_SPImaxSpeed, MSBFIRST, SPI_MODE3));
			#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)  || defined(__IMXRT1062__)	
				_pspi->beginTransaction(SPISettings(_SPImaxSpeed, MSBFIRST, SPI_MODE3));
			#elif defined(ESP8266)	
...
Can reduce down to:
Code:
	void _startSend()
		__attribute__((always_inline)) {
		#if defined(SPI_HAS_TRANSACTION)
			#if defined(__MKL26Z64__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)  || defined(__IMXRT1062__)	
				_pspi->beginTransaction(SPISettings(_SPImaxSpeed, MSBFIRST, SPI_MODE3));
			#elif defined(ESP8266)	
..

But that might imply I will need to pull out a TC to make sure things still work...
 
Last edited:
@mjs513 and others...

My 4th RA8875 display arrives today ;) Maybe will have to figure out something to use some of them for.

I have a branch now that does have the 3rd parameter which allows you to specify max SPI speed, which appears to work. https://github.com/KurtE/RA8875/tree/RA8875_t4_settings

I have TLC version using the method I mentioned, and I ran one of the displays on SPI and then on SPI1 on a TLC and it appears to work.

I think most of the pieces are in place to support multiple displays. But I have not done a full test yet with two displays. I did hook up two to a T3.6 (did not want to risk T4), and have a version of the benchmarks test that tries to do each page to each display... It started, but I think browns out... So may hook up to a different T3.6 where I have a DC to DC converter to convert something like 12v to 5v and one version maybe 1.5 amp and another maybe 2.5 or 4 amp... So one of them should handle it more.

I think all of the pieces are in place for multiple display, BUT there are two different ISR functions which are defined as static
Code:
	volatile uint8_t			  _enabledInterrups;
	[COLOR="#FF0000"]static void 		 		  _isr(void);[/COLOR]
	
	#if !defined(_AVOID_TOUCHSCREEN)
		volatile bool			  _touchEnabled;
		volatile bool			  _clearTInt;
	#endif

	#if defined(USE_FT5206_TOUCH)
		volatile bool			  _needCTS_ISRrearm;
		[COLOR="#FF0000"]static void 		 	  cts_isr(void)[/COLOR];
	#elif defined(USE_RA8875_TOUCH)
So question will be should I go ahead and issue PR with the current stuff or wait until maybe I can test two displays.
Not sure how well I will be able to test USE_FT5206_TOUCH for two displays as I will only have one with a workable version of it (coming today), but at least maybe?
 
I suggest you try pulling it ti ground and 3.3 with a ma meter to see how much current it takes. Also if you have a scope see it it's actually got a altering level (data) on it. It could be the 3.x can drive a load better than the 4.0.
 
KurtE said:
So question will be should I go ahead and issue PR with the current stuff or wait until maybe I can test two displays.
Not sure how well I will be able to test USE_FT5206_TOUCH for two displays as I will only have one with a workable version of it (coming today), but at least maybe?

Which 2 displays did you use - Adafruit and BuyDisplay I assume. Why not hold off on pushing the PR until you get you other board.
 
@DaQue

4.3" lcd pulled to gnd
CS 330uA
SDI 330uA
SCLK 330uA
4.3" lcd pulled to 3.3V
CS 1uA
SDI 1uA
SCLK 1uA

7" lcd pulled to gnd
CS 250uA
SDI 330uA
SCLK 330uA
7" lcd pulled to 3.3V
CS 600uA
SDI 1uA
SCLK 1uA

The CS form the 7" clearly behaves differently.
T3.6 might drive a load better but it still doesn't explain why only the 4.3" works with T4 and not the 7". They both have the same electronics.
I could hook up my scope but I am not willing to fry another T4 for this display. 2 fried T4 is more than enough. I prefer to buy another display instead of destroying 2 more T4.
 
I could... Right now on the T3.6 I was trying to run two BuyDisplay 5" displays one is a 480x272 resistive touch and the other is a 800x480 Cap touch But with some external connector which I think I lost... One coming today is the 4.3" 800x480 Cap Touch integrated...

I did some quick checks of those static ISRs and sure enough they use static (global) variables that are contained within RA8875.cpp Both associated with touch. So needless to say not setup (yet) for multiple...

Again question always is, how much to do here? Obviously could punt here. Never before supported multiple, so...

But this is not very difficult to sort of handle...

For example could have:
Code:
static void 		 		  _isr(void);
static void 		 		  _isr1(void);
static void 		 		  _isr2(void);

current code does:
Code:
void RA8875::_isr(void)
{
	_RA8875_INTS |= (1 << 0);//set
}
Where _RA8875_INTS is a global variable...

So could change to all three have their own variables or make _RA8875_INTS a member variable, and have a global array of lets say 3 object pointers, so when you enable isr it allocates one of them and set the appropriate ISR...

Again that is not hard to handle. But then you have maybe use the USE_FT5206_TOUCH which has it's own ISR defined? Why not just use same one?

Also currently you can configure the library to either support resistive touch or the FT5206 touch, but not both... So if you have some of both, you have to keep changing the library. So trying to use one of both won't work.

Also the resistive touch is currently setup where for a specific device you need to calibrate the touch, and then update a header file and then build your app using that updated header file... Well if you have multiple touch screens with different mapping, there is no way to handle this, currently the mapping is done in...

Code:
void RA8875::touchReadPixel(uint16_t *x, uint16_t *y) 
{
	uint16_t tx,ty;
	readTouchADC(&tx,&ty);
	//*x = map(tx,_tsAdcMinX,_tsAdcMaxX,0,_width-1);
	*x = constrain(map(tx,_tsAdcMinX,_tsAdcMaxX,0,_width-1),0,_width-1);
	//*y = map(ty,_tsAdcMinY,_tsAdcMaxY,0,_height-1);
	*y = constrain(map(ty,_tsAdcMinY,_tsAdcMaxY,0,_height-1),0,_height-1);
	_checkInterrupt(2);
}
Where the values like _tsAdcMinX and _tsAdcMaxX are initialized to the values of the header file mentioned, when you call begin and likewise when you set the rotation..

One could easily allow for display specific ones by adding a method like: tft.setTouchCalibrationData(minx, maxx, miny, maxy);
And then make sure to properly convert when you do ratations...

But is it worth it? Would anyone use it? And wish someone like SumoToy was still there to own it...
 
KurtE said:
But is it worth it? Would anyone use it? And wish someone like SumoToy was still there to own it...
To be honest think just getting the SPI clock in enough as well as being able to use 2 displays for graphics would be a plus. But trying to get different types of touch working think its more trouble especially if SumoToy isn't around? The branch we are working with is even his beta branch and not the officially released one so that could cause more problems. But it did fix a bunch of bugs.
 
@kurtE
In my humble opinion it is not worth it. Why use 2 different touch technologies unless you have them in your parts bin. If it was for a new project I would definitely use identical screens.
 
So I hooked up the two displays to a T3.6 with one of the DC/DC converters with one on SPI and the other SPI1...

Using the Sketch: View attachment RA8875_benchmarks_multi-190906a.zip

When I just tried to use USB, neither display wanted to work. But when I connected up the 12v 5amp wall wart to the DC/DC converter than things were happier.

IMG_0869.jpg

Warning: In my branch (part of probably PR) I added a comment before most of the tft.begin methods, telling you that you need to choose the right one for your display and
showed the list... i.e. don't want others to waste time again... Only Teensy part. Did not have the energy to do all 100+ files...
 
@KurtE

Sorry I didn't get to this sooner but was waiting for something in the post to keep the adafruit ra8875 setup nicer.

Anyway just hooked up the Adafruit 800x480 display to SPI and the BuyDisplay 480x272 to SPI1 using the T4. The BuyDisplay I powered from a5v anker powerbank. Both displays worked like a charm but I did have to run the Adafruit at 12Mhz other the circle test case was having a problem.

The other thing was that the colors were off between the two displays - the BuyDisplay was showing magenta while the Adafruit was showing blue.
 
@mjs513 - was out doing other stuff as well, including picked up the 4.3" 800x480 display
Will have to play more with the colors.

So have the demo running using two 400x... displays both Buydisplay. It is interesting that with the 4.3" display at least the 800x48, the display in landscape mode, the actual image area as it relates to the top and bottom are different. Sort of looks like a TV where the TV image does not fill whole screen...

Running those two displays the DC/DC converter is getting a bit warm, so could easily imagine trying to grab all of that over USB might be problematic.

The other thing I was playing with, was trying to get the
Touch screen on the Adafruit display to work.

It works fine with the Adafruit_RA8875 touch code, at least with their buildtest.

But if I run something like touchTest (configured for Adafruit display and I believe the right pin it fails, it sort of hangs...

But if you disable the ISR: comment out the line: tft.enableISR(true);
The program sort of works, except not calibrated...

Have you tried this on yours? Maybe need to reset up the RA8875 Resistive touch one and see if it works on that one.
 
Status
Not open for further replies.
Back
Top