1
\$\begingroup\$

I am trying to get an I2C OLED (128x64) display working on a BeagleBoneBlack. Unfortunately, no matter what I2C port I try I cannot see the device when using the i2cdetect utility. As you can see below, i2c-0 and i2c-2 are "scannable" using the utility, however no device shows up. The OLED panels generally show up at either 0x3C or 0x3D (in this case 0x3C). The OLED panel is controlled using the SSD1306 controller. I am still learning about i2c, but from what I understand, a device should have a unique address that will show up using the i2cdetect utility.

Any tips on troubleshooting would be helpful. The c++ code I have is quite involved, but I can post it if you think necessary.

enter image description here

enter image description here

The BeagleBone should have 2 I2C ports available according to my web searches. I have tried all the scl and sda pairs listed on the P9 header.

enter image description here

Previously, when I used an I2C LED Panel, I got the output below and was able to write to various pixels in the matrix. As you can see, in that case I had a device available at 0x70.

enter image description here

UPDATE:

I asked the author of the library and this is what he wrote:

It sounds like the SPI device you're using might not be enabled with a device tree overlay. Can you try running this command to show all the SPI devices?

ls /dev/spi* Based on the device and port you should see a /dev/spidev1.0 device. If you don't see that device then you'll need to enable it with a device overlay. Check out the bottom of this page for a little more info on how to enable the SPI device: https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black/wiring

One other thing to be careful about, since it looks like you're using Ubuntu. Make sure the kernel version is 3.8.x and not a later one like 3.14.x. The later kernels don't support device tree overlays so they can't dynamically add SPI ports, etc. You can check the kernel version by runnning:

uname -r If it's a later kernel (like 3.14) try installing the official Debian image from there as it's still using 3.8: http://beagleboard.org/latest-images

enter image description here

It seems that /dev/spi* does not exist, and that I am running a later version of ubuntu (3.14), both of which could be bad. It's a bit beyond me why Ubuntu 3.14 would stop supporting device tree overlays, and why I can't access these pins.

\$\endgroup\$
  • \$\begingroup\$ Normally one end of the I2C bus or the other will have the pullups. If neither end does, you have to add them yourself, as Scott says. \$\endgroup\$ – Brian Drummond Dec 20 '14 at 10:44
  • \$\begingroup\$ You have an i2c device, not an spi device. \$\endgroup\$ – Scott Seidman Jan 5 '15 at 0:38
  • \$\begingroup\$ You're right. i think he or i miswrote - the problem seems to be still there even after switching to debian 3.8 instead of ubuntu 3.14, but i need to look into it closer tomorrow. \$\endgroup\$ – user391339 Jan 5 '15 at 4:05
1
\$\begingroup\$

Are the busses pulled up with resistors? I2C is open drain, and needs to be pulled up.

From m.eet.com/media/1158028/296877-design_calculations_for_robust_i2c_fig1.jpg

From http://m.eet.com/media/1158028/296877-design_calculations_for_robust_i2c_fig1.jpg

\$\endgroup\$
  • \$\begingroup\$ Thanks. So far my best lead is that my issue is due to the linux device overlay, BUT, I did not check to see if the busses on the board are pulled up. When I follow up on the device tree overlay issue I will make sure to address your answer. \$\endgroup\$ – user391339 Jan 4 '15 at 21:01
0
\$\begingroup\$

Did you set up the IO pins correctly? Usually on an MCU you have to pick which pins you want to connect to the peripheral. I'm not clear on whether you've ever gotten the I2C port to work before.

You should definitely check the datasheet and see whether there's anything you need to do on the OLED modules to enable I2C. Sometimes displays like that will have multiple interfaces. There may also be an enable or power-down signal that needs to be set properly. If you tell us the part number of the OLED display we might be able to help more.

\$\endgroup\$
  • \$\begingroup\$ Thanks. The OLED display (photo added) uses the SSD1306 controller. \$\endgroup\$ – user391339 Dec 20 '14 at 4:52
  • \$\begingroup\$ Okay, looks like it's just an I2C interface. So much for that idea. I'm assuming you connected the 3.3V correctly. Can you post a picture of the other side of the board? \$\endgroup\$ – Adam Haun Dec 20 '14 at 4:56
  • \$\begingroup\$ It would be good to make a table showing all the devices that are on the i2C bus and what their addresses are. Maybe there is an address conflict causing a bus error. \$\endgroup\$ – mkeith Dec 20 '14 at 5:02
  • \$\begingroup\$ The other side of the board is just the OLED panel and the soldered pins. I am assuming the SSD1306 controller is hidden from view inside the OLED panel itself. \$\endgroup\$ – user391339 Dec 20 '14 at 5:04
  • 1
    \$\begingroup\$ It looks like a pretty simple module, so I'm not sure if there's an obvious way. If it lights up, flashes, or otherwise shows any activity when you apply power, that's a good sign. You can check the I2C pins to make sure that they're transmitting. Probably the easiest way to isolate the problem would be to connect a known good I2C device to the BeagleBone and verify that you can communicate with it. \$\endgroup\$ – Adam Haun Dec 20 '14 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.