SSD1306 not responding

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

SSD1306 not responding

Post by pythoncoder » Fri Oct 28, 2016 4:47 pm

I've just taken delivery of an Adafruit 128*32 OLED display https://learn.adafruit.com/monochrome-o ... 2c-display. I connected it to a Pyboard V1.0 running firmware dated 14th October. It's powered with its Vin connected to the Pyboard's 3.3V output.

It doesn't respond to an I2C scan. I then connected the Pyboard to a known good I2C module using the same Pyboard pins and code; it responded correctly.

I've tried running with CS open circuit, connected to Gnd and connected to 3v3: each time it displays an empty list. Does anyone have any ideas before I start fiddling around with an Arduino to decide if it needs sending back? This is the code I'm using for the scan, with very conservative timings for the reset.

Code: Select all

import utime
import machine
import ssd1306
pscl = machine.Pin('Y9', machine.Pin.OUT_PP)
psda = machine.Pin('Y10', machine.Pin.OUT_PP)
rst = machine.Pin('Y11', machine.Pin.OUT_PP)
rst(1)
utime.sleep_ms(100)
rst(0)
utime.sleep_ms(100)
rst(1)
utime.sleep_ms(1000)

i2c = machine.I2C(scl=pscl, sda=psda)
print(i2c.scan())
Peter Hinch
Index to my micropython libraries.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SSD1306 not responding

Post by pythoncoder » Sat Oct 29, 2016 8:30 am

Forget the above. Now tried with an Arduino and the thing is as dead as a dodo. It's going back :(
Peter Hinch
Index to my micropython libraries.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: SSD1306 not responding

Post by deshipu » Sat Oct 29, 2016 11:31 am

Are you sure it's in I2c mode, and not SPI? I2C devices usually don't have a CS pin...

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: SSD1306 not responding

Post by pythoncoder » Sat Oct 29, 2016 5:30 pm

Hell, you're right :!: Thanks for that, saves me making an even bigger fool of myself :oops: I inadvertently ordered the SPI unit and assumed I'd got what I intended to buy. It lives to fight another day. Doubtless it will work tomorrow ;)

{EDIT]It did. First time :D
Peter Hinch
Index to my micropython libraries.

Post Reply