ILI9341 using 4-wire SPI - confused by 5th wire? :)

Status
Not open for further replies.

Projectitis

Well-known member
Hi all,

Just a little confused by the DC pin required by ILI9341 (and other displays). looking at the source for ILI9341_t3 and the like, this is used to switch between data and command when initializing the display (and perhaps other times commands are sent to the display).

I'm assuming that DC has nothing to do with SPI and is something specific to the display? So it's not actually 5-wire SPI, but something the display needs? Sorry - new to SPI, and also to low-level display driving!

Cheers,
Peter
 
And as far as I'm aware, none of the ILI9341 libraries make use of MISO for any standard drawing operations, correct? So I'd be safe not to use it for now.
I did read on the highly optimised ILI9341 mega-thread that someone (possibly KurtE) was working on read-pixel type features.

EDIT: Yep, just double-checked KurtE's _t3n library, and looks like MISO only used specifically in relation to readPixel and readRect but never anywhere else. However, it's not like I'm short of pins on the T_3.6, so I'll connect MISO anyway :)
 
As mentioned in my version of the library (ili9341_t3n), I allow MISO to be not defined and used...

But the main library (ili9341_t3), requires the MISO pin, in the begin method

Code:
void ILI9341_t3::begin(void)
{
    // verify SPI pins are valid;
    #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
    if ((_mosi == 11 || _mosi == 7 || _mosi == 28) && (_miso == 12 || _miso == 8 || _miso == 39) 
    		&& (_sclk == 13 || _sclk == 14 || _sclk == 27)) {
	#else
    if ((_mosi == 11 || _mosi == 7) && (_miso == 12 || _miso == 8) && (_sclk == 13 || _sclk == 14)) {
    #endif	
        SPI.setMOSI(_mosi);
        SPI.setMISO(_miso);
        SPI.setSCK(_sclk);
	} else
        return; // not valid pins...
You can probably in that version use it for some other purpose after the begin is called.

FYI - My giant possible pull request for ili9341_t3 library, where I try to merge in features of _t3n (https://github.com/PaulStoffregen/ILI9341_t3/pull/41) makes the MISO pin optional as well
 
Status
Not open for further replies.
Back
Top