Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

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

  1. #1
    Senior Member Projectitis's Avatar
    Join Date
    Feb 2018
    Location
    New Zealand
    Posts
    174

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

    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

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    Noted here : https://github.com/PaulStoffregen/ILI9341_t3

    D/C is required it seems, with CS, MOSI, SCK

    It is 4 wire if MISO is not needed for reading from the display

  3. #3
    Senior Member Projectitis's Avatar
    Join Date
    Feb 2018
    Location
    New Zealand
    Posts
    174
    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

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,380
    Display Read Pixel/Rectangle is a supported feature - but MISO not required if not used.

  5. #5
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    7,648
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •