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

Thread: Communicate with TFT using Dual or Quad SPI (QSPI)

  1. #1
    Junior Member
    Join Date
    Jun 2017
    Posts
    18

    Communicate with TFT using Dual or Quad SPI (QSPI)

    Hi there,

    I'm wondering if anybody has come across any Quad SPI libraries that could be used as examples or used directly. I'm communicating with and one of Bridgetech's FT813 TFT displays and I use the standard single channel mode with MOSI as input from the master andMISO as output to the masterSPI mode. However, the FT813 is capable of operating Dual SPI mode or Quad SPI mode with the addition of another 2 I/O's, see chapter 4 of their manual, here.

    In dual or quad mode the manual notes that the SPI data port I/O's become unidirectional where the host drives them while chip select is active and the slave drives them when it is inactive. This complicates things from a code perspective and probably means a normal SPI library would not be easy to re-purpose. However, I'm aware that the Teensy 4.1 communicates with a QSPI flash chip (Winbond 25Q128JVSQ) and wondering if this interface operates on a similar principle and hence could be used a a template for Dual / Quad SPI to the TFT? Or better still using another of the SPI ports along with 2 more spare I/O's.

    I draw a lot of bitmaps to the screen and while performance is okay, it would be a good bit better with QSPI so I'd really like to try and get it working if its workable. I have many Teensy 3.6's, a couple of Teensy 4.1's, and a good few FT813 TFT's to test with. This is something I've been wondering about for a long while and thought I'd ask the question here to see if anyone can provide any advice on how to achieve it, or even any warnings to tell me it is a waste of time. Any advice would be very helpful. Thanks.

  2. #2
    Senior Member
    Join Date
    Nov 2015
    Location
    Cold hollow VT
    Posts
    204
    SPI is a serial data transfer with some handshaking & dedicated CS (chip select). The existing SPI support relies on special hardware in the Teensy chip to make it super fast. The data paths are in/outs from shift registers that convert parallel to/from serial . Doing a multi lane implementation is possible BUT you would have to bit bang it which would be slower than it could be with real hardware making it run. A T3.6 would be a good start while there would be some some speed advantages with the T4.x.

    ISTR that someone else asked about multi-lane SPI here not too long ago.

    Its possible but not necessarily a novice task.

  3. #3
    Junior Member
    Join Date
    Jun 2017
    Posts
    18
    Okay, so I'm guessing that likely means that the hardware assisted single/standard SPI transfers will likely be much faster than any software implementation of Dual/Quad SPI? It seems strange that they have QSPI capabilities on the FT81X when it's focused at the MCU market if hardware to control it isn't readily available.

    Still curious about the QSPI used on the Teensy 4.1 for optional memory chip, I thought this was hardware assisted or it is all software controlled? Or does the FT81X implementation of QSPI differ? Thanks.

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    9,767
    There as many different options on doing things.

    Also there are two completely different SPI systems on the IMXRT chip, for full details see the reference manual that you can download from the T4.1 product page...

    The memory chips and the like use FlexSPI controller (chapter 27) and it mostly in quad mode. And the two Hardware CS pins associated with the FlexSPI port that is on the bottom of the T4.1 are setup for the two chips you can install. There us another FlexSPI object as part of the hardware, but I believe none of it is available.

    Then there are the different normal SPI ports on the boards which we use for SPI, SPI1, SPI2, which are made up of LPSPI objects (Chapter 48). They are very different than FLEXSPI. And I believe they can all support Dual and Quad SPI stuff, however not all of the IO pins necessary to support these modes were exported on the Teensy. If I remember correctly maybe dual on the SPI object, but would need to look at pins again.

    Then there is also probably the option to do these using FlexIO. Not sure if anyone has set that up or not.

  5. #5
    Junior Member
    Join Date
    Jun 2017
    Posts
    18
    Thanks KurtE, I would be happy to use the interface that's intended for connection to the optional QSPI memory chip on the T4.1. I would plan to gain access to it by soldering a custom breakout board to those pads, hence I don't necessarily need access to other hardware that may be on the MCU but isn't broken out on the T4.1. I know the FT81x appears to the host MCU as a memory-mapped SPI device so I'm thinking the communication protocol would be fairly similar to that of the intended memory chip for that port. I'm sure it'll require some editing of the libraries but would you think it's feasible or a good place to start?

    One thing (among many things!) that might catch me is that the FT81X requires single SPI mode at initialization, QSPI is then enabled by writing to the appropriate registers. I see the Winbond 25Q128JVSQ also supports single SPI so I'm assuming the its library already goes through an equivalent process to enable QSPI. Though I also see that there are different versions of the Winbond chip that have this register defaulting to 1 or 0 which could allow you to startup in QSPI or not so not sure if its in the library.

Posting Permissions

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