12c communicating with RTC and a 128 x 64 OLED

captnemo

New Member
I've got an 18m2 connected to an oled (128 x 64) display and also a DS1307 clock (just the chip not a module). With ONLY the clock chip connected to the bus the clock portion of the program works fine (display portion is disabled). I can see the seconds, minutes etc. incrementing on the debug screen. However, as soon as I connect the display to the bus and do a download I get all 165's in the debug screen for the seconds, minutes etc. This tells me there's a bus problem. This happens even when I kill the power to the display (it's SCL and SDA lines are still connected to the bus). I've got a 4.7k resistor going to +5, one on the SCL and one on the SDA line. Nothing else is connected to the 18m2 except it's SCL and SDA pins. As soon as I remove the display from the SCL and SDA the problem vanishes.
I've got the display section of the program disabled, so the 18m2 shouldn't even see the other i2c setup, that's used to talk to the display.
Attached is the program. I haven't debugged the message portion of the program that displays the time.

Any idea's out there?
 

Attachments

PhilHornby

Senior Member
Does the OLED display module actually work? (with or without the DS1307 connected).

Does it have built-in resistors on SDA & SCL? (so you end up with two lots when it is connected)
 

captnemo

New Member
Yes, the display works when attached to the SDA and SCL without the clock chip connected and with two external 4.7k resistors on the bus, which
tells me the display doesn't have built in resistors.
It's just the clock integrated circuit no module, no battery, no resistors. I had to supply the crystal.
There are only two 4.7k resistors attached to the bus.
The display is the typical OLED, .96 display, 128 x 64 that you see everyone using.
 

PhilHornby

Senior Member
Yes, the display works when attached to the SDA and SCL without the clock chip connected and with two external 4.7k resistors on the bus, which
tells me the display doesn't have built in resistors.
It's a reasonable assumption - though you could double-check by measuring the resistance from the module's SDA and SCL to VCC.
The display is the typical OLED, .96 display, 128 x 64 that you see everyone using.
Do you have a link to the module you're using? I'm not familiar with them - and I'm all you've got at the moment :)
 

AllyCat

Senior Member
Hi,

Firstly, beware that sometimes the GND and Supply pins are swapped on some versions of those OLED modules.

I've not examined your program in detail, but the I2SLAVE command is now deprecated; HI2CSETUP is preferred because it's clearer that M2 devices can be used only as a Master. Note that it needs to be re-issued every time you change the slave that you are addressing.

Also, I have posted some program code for those OLED displays, but I can't find it at the moment (or add anything more) as I'm using a very slow internet connection. :(

Cheers, Alan.
 

kfjl

Member
I have an SSD1306 screen attached to a 08M2 running what I think must be AllyCat's code. I don't use external resistors.
Like AllyCat, I can't find the program on my computer but I did find this.
 

captnemo

New Member
This is going to sound strange, I had the 18m2 speed set at 8Mhz. and the RTC and display commands at i2cslow, which is what they are suppose to be. I was getting desperate so I changed the clock speed to 4mhz. and changed ONLY the RTC commands to i2cfast and everything worked fine. I then went and changed the 18m2 clock speed back to 8Mhz, to see what would happen and the same problem appeared, so I put the 8Mhz back to 4Mhz and it's running fine, except for code problems. What do you think this is all about? I'll take a look at your display code too.
 
Top