RA8875 SPI Teensy 4.0 can I get a little speedup ?

Status
Not open for further replies.

Keith_M

Well-known member
Not that knowledgeable on SPI but learning ...

Is there a way I can push the speed up on the SPI buss for the RA8875 Display ?

I'm running the BuyDisplay 800 x 480 display but don't know how I can raise the spi clock to nudge a bit more out of it ..
(I have no idea what it is currently running at either ...)

Thanks
K
 
You might be able to bump up the SPI speed.

Again these displays can be sensitive... Also assuming you are using our version of the library... On the Begin method you can try passing in a higher SPI Speed:

Code:
	void 		begin(const enum RA8875sizes s,uint8_t colors=16, uint32_t SPIMaxSpeed = (uint32_t)-1, uint32_t SPIMaxReadSpeed = (uint32_t)-1 );
	//(RA8875_480x272, RA8875_800x480, Adafruit_480x272, Adafruit_800x480) , (8/16 bit)
Or you can change the default in the usersettings.h file...
Excerpt from that file:
Code:
----------------------------------------------------------------------------------*/
/*
From here it's better don't touch anithing, everithing has been tuned for maximum speed.
Only DUE or any AVR 8bit (like uno) can have some troubles with particular old libraries
because the use of fast port handle, in that case....
On Arduino DUE and other 8 bit Arduino MCU you can disable the fast CS port 
by commenting #define _FASTSSPORT, this will force to use the classic digitalWrite.

*/
/* 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.
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!
At that speed you need to short cables as much you can, provide clean supply and good decoupling!
DO NOT Exceed 23Mhz for RA8875! It will result in garbage on screen or run very slow.
*/

#if defined(SPI_HAS_TRANSACTION)
//SPI transaction enabled library----------------------
	const static uint32_t MAXSPIREADSPEED  = 6000000UL;  //Read don't go higher than 22000000!;
	#if defined(__MK20DX128__) || defined(__MK20DX256__)  || defined(__MK64FX512__) || defined(__MK66FX1M0__) || defined(__IMXRT1062__)
		const static uint32_t MAXSPISPEED	= 18000000UL;  //don't go higher than 22000000!;
	#elif defined(__MKL26Z64__)							 //[Teensy LC] (12 or 24 Mhz max)
		const static uint32_t MAXSPISPEED	= 12000000UL;	 //default SPI main speed TeensyLC
		const static uint32_t MAXSPISPEED2	= 22000000UL;  //don't go higher than 22000000!;
	#elif defined(___DUESTUFF)							 //[DUE]
		const static uint32_t MAXSPISPEED	= 15000000UL;  // try experiment higher values but NOT over 22000000!
		//#define _FASTSSPORT
	#elif defined(ESP8266)	
		const static uint32_t MAXSPISPEED	= 8000000UL;  //don't go higher than 22000000!;
		//#define _FASTSSPORT
	#elif defined(SPARK)
		const static uint32_t MAXSPISPEED	= 8000000UL;  //don't go higher than 22000000!;
	// TODO: add more CPU here!
	#else												 //rest of the world (UNO, etc)
		const static uint32_t MAXSPISPEED	= 10000000UL;  //be careful, higher values result in extremely slow rendering!
		#define _FASTSSPORT
	#endif
#else
 
Status
Not open for further replies.
Back
Top