Menu

bidirectional data pin SPI

Help
2021-08-27
2021-09-02
  • David Stephenson

    I have a display that (I think) has a SSD1680 driver. It is a 4-wire SPI (clock, data in, chip select, data/command). So it only has a SDI pin, but the datasheet indicates that this can be bidirectional (when reading a read only register). To test that I have communication working (and to make sure it really is a SSD1680) I have been trying to read the temperature sensor (0x1B) with little success.
    Is there any trick to (hardware) SPI using a bidirectional data pin? I've set the PPS to bidirectional.

     
  • Kato

    Kato - 2021-08-27

    Look at the GLCD games demos - they read the GLCD SPI.

    Sharing the SSD1680 driver? It is compatible with GCB glcd commands? I dont want to mess around unless I can use the exiting gcld commands.

     
  • David Stephenson

    I will have a look at those (thought I might have to keep switching direction using PPS).
    It is actually an e-paper display (B/W/R) 250x122, 2.13".

     
  • Anobium

    Anobium - 2021-08-27

    As this display is small (pixel count). Create RAM buffer and read/write the buffer with SPI write from buffer to display. SSD1306 etc all do that, and, they all support the GLCD commamd set.

    I know this is a tri-color display. The buffer needs to cater for that but a double buffer will be easier and faster.

     
  • David Stephenson

    Just to clarify. My question is how does the HWSPI deal with SDO1 when it needs to accept input (act as a SDI). The display does not have separate MOSI and MISO pins.
    On a related question how does the SPI library decide which pins to use - particularly with PPS enabled chips - where the functionality can be directed to any set of pins.

     
  • David Stephenson

    Interesting I've just found something on a microchip forum.
    The technique is to connect together (on the PIC) the MISO and MOSI pins with a 1K resistor and connect this to the single bidirectional pin on the display. Might work - I will report back.

     
  • Anobium

    Anobium - 2021-08-28

    Yes. I would join via a resistor. Setup PPS using PPSTOOL and you will get bidirectional port.

    Is the library compatible with GLCD commands?

     
  • David Stephenson

    Well I've set up the bidirectional port and it reads back the byte sent to the display. However I get nothing back from the display (0x00) - doesn't help that I don't know what controller is in the display.
    It is a B/W/R 2.13" 250x122 Heltec display (e-ink).
    Why is it that a company makes a nice display and yet does not bother to provide documentation.
    I'm going to go with it being very similar to a display mage by "goodisplay" which has some documentation. Any useful comments would be appreciated.

     
  • Anobium

    Anobium - 2021-09-01

    Hack up the mcufriend application. See for examples: C:\GCB@Syn\GreatCowBasic\Demos\glcd_solutions\glcd_discovery_for_mcufriend_devices

    This will tell you the controller.

     
  • David Stephenson

    That is a difficult program to understand! As I am using an I2C display to monitor the output I need to change a lot of lines. It would help me if I understood the following routine:

        repeat nparams
            GLCDSendCommand(0xd9)
            GLCDSendData(0x10+regcount)
            regcount++
            GLCDSendCommand(reg)
            GLCDSPITransfer( readdummy, val8 )
            HserPrint(" ")
            HSerPrint hex(val8)
        end repeat
    

    I notice it uses the "top secret command" 0xD9 - will this work for any controller or just for the ILI9341?

     
  • Anobium

    Anobium - 2021-09-02

    I just ported this https://github.com/prenticedavid/MCUFRIEND_kbv/

    Get External Register for SPI (D9h) is not going to work... and, neither is any of the MCUFriend solution.


    I would hook up an UNO, get the Arduino working to verify the product.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.