Author Topic: Simblee with I2C OLED not working  (Read 171 times)

Racer_Rob

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Simblee with I2C OLED not working
« on: January 29, 2017, 06:36:22 AM »
I have a Simblee breakout board and an Adafruit 128x32 OLED display.

I've tested each separately, the Simblee with one of its own example sketches and the OLED with an Arduino Uno and an example sketch from Adafruit and both worked perfectly.

I then connected the OLED display to the Simblee as follows -
Simblee - OLED
GPIO 6  - SDA
GPIO 5  - SCA
GPIO 4  - RST
GND     - GND
3V       - 3.3V

I successfully loaded the the same OLED Adafruit example sketch that ran on the Arduino onto the Simblee but the display is blank. (This sketched used digital pin 4 on the Arduino for RST so I used GPIO 4 on the Simblee, I assume this is correct).

I've also tried powering the OLED from 5V (using it's 5V Vin pin) while connected to the Simblee also without success.

I'm out of troubleshooting ideas, any suggestions? I presume that what I'm trying should, in theory, work?


Update: I've tried running an I2C scanner on the Simblee and this can't find any devices but the same scanner does find the OLED display on my Arduino Uno.

Code: [Select]
// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin (115200);

  // Leonardo: wait for serial port to connect
  while (!Serial)
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
 
  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

When I run the code I see this on the serial monitor:

Code: [Select]
kLXš³hÈscanner. Scanning ...
Done.
Found 0 device(s).

The strange letters at the start do display correctly (as "I2C scanner. Scanning ...") on the Arduino Uno.
« Last Edit: January 29, 2017, 09:57:38 AM by Racer_Rob »

tolson

  • Global Moderator
  • *****
  • Posts: 804
  • Karma: +18/-0
    • View Profile
    • Thomas Olson Consulting
Re: Simblee with I2C OLED not working
« Reply #1 on: January 29, 2017, 04:51:28 PM »
Try this scanner on the Simblee...

Code: [Select]

// --------------------------------------
// i2c_scanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.

// Version ThomasOlson 20140527.1 works with RFduino with mods.
//

#include <Wire.h>


void setup()
{

  Serial.begin(115200);
  Serial.println("\nI2C Scanner");

  Wire.begin(); // default SCL = 5, SDA = 6
  //Wire.beginOnPins(2,3);
 
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning Bus 1 ...");

  nDevices = 0;

  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    Wire.write(0x00);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device on bus 1 found at address 0x");
      if (address<16)
        Serial.print("0");
        Serial.print(address,HEX);
        Serial.println("  !");

      nDevices++;
    }else{
//      Serial.print("Error ");
//      Serial.print(error);
//      Serial.print(" at address 0x");
//      if (address<16)
//        Serial.print("0");
//      Serial.println(address,HEX);
    }   
  }
 
  if (nDevices == 0){
    Serial.println("No I2C devices found on bus 1\n");
  }else{
    Serial.print(nDevices);
    Serial.println(" found\n");
  }
 
  delay(5000);           // wait 5 seconds for next scan
}


Racer_Rob

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Simblee with I2C OLED not working
« Reply #2 on: January 30, 2017, 01:33:53 PM »
I ran the code and it found it!

Code: [Select]
Scanning Bus 1 ...
I2C device on bus 1 found at address 0x3C  !
1 found

I then loaded an example sketch for the OLED display followed by my own OLED code on to the Simblee and both ran perfectly.

I'm a bit at a loss to explain why it now works. I disassembled everything yesterday and rebuilt today, maybe there was a bad connection somewhere but I double checked everything yesterday...twice. As the most illogical element in the system I'm probably to blame!  ;D

Thanks for the scanner code.
« Last Edit: January 30, 2017, 02:03:13 PM by Racer_Rob »