ST7735S on ESP32

Posted on
  • Hi,

    Has anyone has any luck getting an ST7735S to display correctly. I've tried using the ST7735 module, but there must be a subtle difference as it displays the text skewed and offset slightly.

    Thanks,

    Rob

  • You're using the code at http://www.espruino.com/ST7735 ? Is your display actually 128x128, or is it some other resolution.

    As long as you're using software SPI I'd be very surprised if there were differences between the boards. So it might be to do with how the display itself gets configured.

    Text being skewed is usually because the size of display is wrong - so each line is off by 1 or 2 pixels...

  • Hi,

    Yes I'm using that code. The display is 128x160.

    There is a fuzzy boarder of a few pixels down the left and across the top, then the rest of the display is black with skewed text displayed.

    I've tried it on a couple of ST7735S boards and its still the same.

    I've looked at the source for the ST7735 module, but its a little out of my depth, nothing obvious jumps out at me.

    I'm happy to post a screen to someone if they can help debug?

    Thanks,

    Rob

  • boarder of a few pixels down the left and across the top

    The module looks like it's adding some padding which could cause the border, and maybe the shifting.

    You could try changing:

        spi.write(0x2A,dc);
        spi.write(0,2,0,LCD_WIDTH+1);
        spi.write(0x2B,dc);
        spi.write(0,3,0,LCD_HEIGHT+2);
        spi.write(0x2C,dc);
    

    to:

        spi.write(0x2A,dc);
        spi.write(0,0,0,LCD_WIDTH-1);
        spi.write(0x2B,dc);
        spi.write(0,0,0,LCD_HEIGHT-1);
        spi.write(0x2C,dc);
    

    Do you have any code that you know is meant for your particular module? It's entirely likely that the init code is very slightly different between ST7735 and ST7735S?

  • Hi,

    I did have a little play with those numbers and didn't notice any difference, I'll try being a bit more extreme with the values to see if they change anything.

    Thanks,

    Rob Smart

  • Hi,

    Yes that was the exact issue.

    The padding was causing the issue. Might be worth adding a note to the top of file so people can list the options that work for each display?

    Thanks for your help,

    Rob Smart

  • Please could you try require("https://raw.githubusercontent.com/espruino/EspruinoDocs/master/devices/ST7735.js") and see if that works for you?

    I'll update the main docs soon - I've defaulted to a padding of 0 (which should work for you) with some options folks can add to change padding

  • Hi,

    Yes that works perfectly, thank you very much.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

ST7735S on ESP32

Posted by Avatar for Ruprect99 @Ruprect99

Actions