[SOLVED] SSD1306 with SPI?



  • Hi,

    It appears the ssd1306 driver (https://github.com/micropython/micropython/blob/master/drivers/display/ssd1306.py) isn't working for WiPy. I've had to modify the driver to change pin.high() -> pin.value(1) and pin.low() -> pin.value(0) but clearly there is something else going on.

    I have an Adafruit 128x32 OLED SSD1306 display wired to my WiPy 2.0 (via Expansion Board) as follows:

    WiPy->SSD1306
    P5->D/C
    P6->RST
    P7->CS
    P10->CLK
    P11->DATA
    3V3->VIN
    GND->GND

    This is the code I am using to test. I get nothing - no errors, nothing on the screen. Is it wired correctly? Something else messed up?

    from machine import SPI, Pin
    from ssd1306 import SSD1306_SPI as ssd
    spi = SPI(0, SPI.MASTER, baudrate=100000, polarity=0, phase=0)
    o = ssd(128,32,spi,Pin('P5'),Pin('P6'),Pin('P7'))
    o.fill(1)
    o.show()

    The OLED is good as I've used it with the Pyboard and it works. Just not with the WiPy.

    I may be able to figure out what is wrong with the driver if I had a working SPI driver to compare. Anyone know of an SPI that actually works with the WiPy? Of any kind?



  • @jmarcelino

    Hi,

    Thanks for the tip and confirming it works! I have fixed the problem by upgrading the firmware to 1.9.1 and it fixed the problem. Aaahhh...better. :)

    Chuck



  • @Olias
    It does work for me but I use different pins than yours as I don't own any WiPy and on the SiPy/LoPy the signalling pins you use are reserved.

    I setup mine as disp = ssd(128,32,spi,Pin('P9'),Pin('P8'),Pin('P22'))

    0_1500679433061_IMG_2566.jpg



  • Yep, tried that too. Still doesn't work. Have verified it (still) works with Pyboard.



  • @Olias said in SSD1306 with SPI?:

    P12->DATA

    DATA should be connected to MOSI which is P11


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.