I2C problems using an 18M2 chip

hamtech

Member
I believe the 18m2 chip will work with an IC2 bus.

Is there any setting up to do? my 18m2 doesn.t seem to talk to my OLED or real time clock. the clock and Display functions fine in serial mode. i have a link on my project board for the I2C mode.
Help pretty please, what am I missing?
 

srnet

Senior Member
I believe the 18m2 chip will work with an IC2 bus.

Is there any setting up to do? my 18m2 doesn.t seem to talk to my OLED or real time clock. the clock and Display functions fine in serial mode. i have a link on my project board for the I2C mode.
Help pretty please, what am I missing?
How would we know ?

Circut diagram ?

Which RTC, which OLED, which prioject board, what code ?
 

nick12ab

Senior Member
I'm assuming that you're using the AXE033. The obvious thing that could be not done is to short the mode jumper to enable i2c mode.
 

hamtech

Member
I'm assuming that you're using the AXE033. The obvious thing that could be not done is to short the mode jumper to enable i2c mode.
I am using an AXE033 with a 16x2 OLED which works fine with my 18M2 project board in serial mode.

I have switch across the jumper for IC2 mode, when I use the example code that comes with the AXE033 I do not get any response. I have SFA and SCL cpnnected, I also have still got the serial wires connect but I didm't think they would be a problem as different pins etc.

Is ther eany conf I need do or are the commands as listed in the training example (which might be for a X1,2 chip) sufficent,
 

nick12ab

Senior Member
Example code - this one?
Code:
init: pause 500                     ' wait for display to initialise
    i2cslave $C6,i2cslow,i2cbyte         ' set up i2cslave for LCD
main: writei2c 0,(254,128,255)         ' move to start of first line
    pause 10                     ' wait for LCD to process data
    writei2c 0,("Hello!123",255)        ' output text
    end
You need to post a circuit diagram and whatever hardware changes you have made/retained from your recent thread problem reading back rtc time on New axe033y OLED board.
 

hamtech

Member
Example code - this one?
Code:
init: pause 500                     ' wait for display to initialise
    i2cslave $C6,i2cslow,i2cbyte         ' set up i2cslave for LCD
main: writei2c 0,(254,128,255)         ' move to start of first line
    pause 10                     ' wait for LCD to process data
    writei2c 0,("Hello!123",255)        ' output text
    end
You need to post a circuit diagram and whatever hardware changes you have made/retained from your recent thread problem reading back rtc time on New axe033y OLED board.
I have shorted out the diode as suggested otherwise it is bog standard axe033y board connected to bog standard 18m2 project board

The higher voltage resolved the issue of being able to display the time in serial mode, that works fine now.

I really would like to try to get the I2C mode working and thought that using the example code would prove that connectivity for this would be proven but the display does not respond the Hello message.

Sda and Scl go to b.1. And b.4 on the 18m2 project board s
The separate serial mode conections cgo to c.0 and b.7. Which works ok.
 

nick12ab

Senior Member
Schematic?

Anyway, start fresh on some prototyping board with a 18M2, download circuit, regulated and decoupled 5V supply and the AXE033 with OLED attached. Connect power and ground of the 18M2 and the AXE033 to the regulated 5V supply. Now connect SCL on the module to pinB.4 and SDA to pinB.1 and ensure that the MODE and POWER jumpers only are shorted. Do not connect the serial things or anything.

Now see if the test code works, both with or without the DS1307.
 

westaust55

Moderator
Do you have a back-up battery fitted?
If not, I believe the RTC battery pin must be grounded.

Have you first set the clock?
Until the seconds are written as 00 (or at least the msb set as 0), the RTC will not start timing.
 
Last edited:

nick12ab

Senior Member
Indeed so, at power up the CH bit is set and the clock does not run, so return values of zero from reads are to be expected, until the CH bit is set to 0.
The CH bit is part of the seconds register so you get '$80' for seconds when reading the DS1307 and not 0.

Datasheet
 
Top