3-wire SPI on NHD-2.4-240320AF-CTXP

Comments

14 comments

  • Engineering Support
    Community moderator

    Hi Marius,

    You are correct - the SDA pin on the TFT should be treated as MOSI.  SDO can be treated as MISO.  As you mentioned, this pin is typically not necessary if you are only sending data to the display.

    The DC pin is not used in 3-wire SPI interface.  In 3-wire SPI interface, pin 11 will function as SCL.

    0
  • mgrigoni

    Thanks. A couple more questions. I found this table in ST7789VI manual .

    Per wiring schematic for 3-wire SPI, IM0=1 and IM2=1. There are two possibilities for that in the table but I would assume that we are somehow dealing with the case that I circled on the table (3-line 9-bit interface with SDA:in and SDO:out). Is that correct? But how is IM3 set to "1"? There is no IM3 on the 40pins exposed.

    Your help is much appreciated!

    Regards

    Marius

     

    0
  • Engineering Support
    Community moderator

    Hi Marius,

    You are correct.  The display is set for 3-line 9-bit serial interface as you described.  On this display, the IM3 pin is internally tied HIGH and the IM1 pin is internally tied LOW.  Only IM2 and IM0 are brought out to the 40-pin FPC.

    0
  • mgrigoni

    Got it. Thank you!

    0
  • MCS

    What frequency do you recommend for this screen with SPI?

    0
  • Engineering Support
    Community moderator

    Hi,

    We typically recommend a frequency of 10-20MHz for SPI with this display.

    0
  • mgrigoni

    This caught my attention. 10-20MHz seems very low. What is the bottle neck, display or MCU?

    I'm struggling with getting it to work at all with 3-wire SPI. I'm using ESP32 s3. I tried 80MHz and 40MHz, no luck. Maybe I need to try lower frequencies.

    I know the wiring and display are fine, I was able to run a basic script that Newhaven provides after tweaking it to be compatible with ESP32. But that's not really a hardware SPI and is very slow.

    I'm using arduino_gfx library, 3-wire (9-bit) SPI is supposed to be supported there. I used that library on one of Adafruit displays with 4-wire SPI with no problems. This is of course 3-wire interface, so not the same code. Or I might be missing something, but no idea what.

    Any thoughts ?

    Thanks

    Marius

     

     

     

    0
  • Engineering Support
    Community moderator

    Hi Marius,

    Technically, the ST7789VI controller can support a maximum of 62.5MHz.  However, many TFT modules have lower practical limits due to PCB design, wiring, or other constraints.  We typically suggest 10-20MHz since this is supported by most microcontrollers and will avoid signal integrity issues.  However, if your MCU can support higher speeds, 40-60MHz should be achievable if your wiring is short and clean.

    It's possible that the arduino_gfx library isn't properly configured for this mode on the ESP32-S3.  You might want to start by testing lower SPI frequencies (10-20MHz) to see if that improves stability.  If issues persist, verifying that the library is correctly handling 9-bit transactions on your platform would be a good next step.

    0
  • mgrigoni

    Thank you for your advice. Which SPI_MODE should I use for this display. 0 or 3 ? 

    0
  • Engineering Support
    Community moderator

    The data is latched on the rising edge of the SCL signal, and the clock is LOW in the idle state.  Therefore, you should use SPI Mode 0 with this display.

    0
  • MCS

    Do the WRX RDX and Data [15..0] lines have to be connected to gnd or can they be floating?

    0
  • mgrigoni

    The bad news is that I was not able to get hardware SPI working with arduino_gfx library (tried lower frequency, different SPI modes, no luck). The good news is that I was able to make it work using 8-bit parallel interface and now working on 16-bit.

    I have a question. I will use column address set command as an example  (screenshot from ST7789VI datasheet) .

    What I read is that even with 16 bit interface, command and command parameters are written in separate write cycles, 8-bits at a time. In other words, I cannot combine 1st and 2nd parameter (total 16 bits) and write it in one cycle. 

    In contrast, pixel data can be written in 16-bit chunks .

    Is my interpretation correct? 

    Thanks

    Regards

    Marius

     

    0
  • Engineering Support
    Community moderator

    Our recommendation is to connect WRX, RDX, and DB[17:0] to GND when not in use.

    0
  • Engineering Support
    Community moderator

    Hi Marius,

    Your understanding is correct.  The commands and parameters are always sent in 8-bit cycles.  Pixel data, however, can be written in 16-bit cycles when using 16-bit interface.

    0

Please sign in to leave a comment.