I2C communication with DS3231
My first post and probably very basic but I cannot get an ACK from a I2COUT to the BS2Px.
My Picoscope 7 displays the SDA and SCL outputs with the proper Data but no SDA ACKs. Any suggestions would be greatly appreciated.
' HARDWARE ASSIGNMENTS FOR THE DS3231 MODULE
'-----------------------
SDA PIN 0 ' use PIN in place of CON The Pin argument for SDA automatically specifies the SCL pin
SCL PIN SDA + 1 ' use PIN in place of CON
LED PIN 2 ' Define OUTPUT PIN 2
' SOFTWARE ASSIGNMENTS:
'-----------------------
Address VAR Byte
temp VAR Byte
Seconds VAR Byte ' 0101 0110 is 56 seconds BCD
Minutes VAR Byte ' 0001 0101 is 15 minutes BCD
Hours VAR Byte ' 0001 0101 is 15 hours since bit 7 = 0 (24hr clock) BCD
Day VAR Byte ' 01 - 31 in BCD 0001 1000 = 18th of month BCD
Month VAR Byte ' 0001 0001 is 11th month BCD
Year VAR Byte ' 0001 0110 25
Seconds = $20
Minutes = $45
Hours = $16
Day = $05
Month = $04
Year = $25
Write_to_DS3231:
START:
I2COUT 0, $D0, $00, [$20, $45, $16, $05, $04, $25]
DEBUG "THE PROGRAM IS CYCLING", CR
PAUSE 1000
DEBUG CLS
GOTO START ' do it again
Comments
Can you provide screen cap so we can see what you see? I've never used the BS2p with the DS3231, but I have P1 and P2 libraries for it -- that chip is pretty easy to use.