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

Thread: SPI on Sparkfun SerLCD

  1. #1

    SPI on Sparkfun SerLCD

    Does anyone know of an example on how to do this?

    All the examples I see are for I2C. I am finding that it is a bit slow in my application. I am getting an annoying flicker of the display as it is updating.

    I see in the SerLCD library that it has SPI capability, but but there are so many "#ifdef" that I can't figure out how to use it.

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Sorry I am not sure which display you have, but assuming it is one like:

    I would assume you would hook up PWR/GND and then signals to the SPI pins (SCK, SDI, SDO, /CS) Sometimes can be confusing on mixing markings...
    if the SDI connects to MOSI (or MISO) and SDO to the other.... If all else fails try both ways...

    Looks like maybe with their library you would use the begin method: void begin(SPIClass &spiPort, byte csPin, SPISettings spiSettings);

    Again I have not looked at their specs but it might be something like:

    #define TFT_CS 10 // some pin number
    SerLCD tft = SerLCD();
    void setup() {
        tft.begin(SPI, TFT_CS, SPISettings(2000000, MSBFIRST, SPI_MODE0));
    But again only guessing as I don't know what speeds it can handle or mode or...

  3. #3
    Thanks, KurtE. That is the problem I am having. The capability certainly looks like it was there, but there are no examples showing what is needed to make it work.

    I will have to look into it some more.

    The LCD I have is this one.

    Edit: I looked at the online documentation the SerLCD. It has example code for using SPI. However it seems to not use the "utility functions" like the I2C interface. For example, with I2C you use lcd.clear() to clear the display but their SPI example requires that you use 2 SPI.transfer commands and bit-bang the CS pin.
    Last edited by OhioJim; 08-30-2020 at 08:26 PM.

  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    There is a guide on SFun for that - with an SPI connect section:
    That includes a sketch for SPI - not sure if it works without change on Teensy?

    It doesn't show any adjustment needed to use SPI versus Serial or i2c. It does note firmware updates, not sure of the effect,

  5. #5
    Yes, that was what I was looking at. What you linked to.

    I am currently using the "LCD library for SparkFun RGB3.3v SerialOpen LCD display with attached Qwiic adapter", by Gaston R. Williams. It does say that any command can be used on any interface (I2C, serial, SPI). So I will have to study it some more and give it a try.

    What i am getting is not actually a flicker, but it just seems to take a while to update the display. I can see it clear a line and write the new one. It would be nice for this to be not visible. My concern is that the display firmware itself is slow and going to a faster interface won't make any difference.

    One other problem is that when updating the display with the GPS clock time, every so often it skips a second or two. But the calculated Sidereal Time does not do this. During debugging, I sent the GPS time to the Serial port and it looks fine there. That is what makes me think it is a display update problem.

    I did read in the specs that the display is supposed to have an 80 character buffer. Since I have the 20x4 version, it should never overflow the display since I am updating only once per second.

  6. #6
    Junior Member
    Join Date
    Sep 2020
    SparkFun RGB3.3v SerialOpen LCD works with without any delay to update display. Maybe itself how spi works or I2C can be here a issue.

Posting Permissions

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