Shop OBEX P1 Docs P2 Docs Learn Events
Ds3231 real time clock i2c reading — Parallax Forums

Ds3231 real time clock i2c reading

Chuck MintonChuck Minton Posts: 45
edited 2012-01-21 07:44 in Propeller 1
I am having trouble understanding the sequence of operations to read a particular register on the DS3231 Real Time Clock.

using I2C Object

I2C.INIT( 5,4,FALSE) 'to initiate the object

I2C.WRITELOCATION(%11010000,%00000000,%00000011,8,8) 'to set data to the seconds register

SECONDS:=I2C.READLOCATION(%11010001,%00000000,8,8) 'to attempt to read data from same register


Then try to send to Parallax Serial Terminal:

DATA.bin(0, SECONDS, 8)
DATA.TX(0,13)



I am getting varying data returned , and is not sequential in any way.
I looked for patterning thinking I was not addressing the register right...but I am at a loss here right now,
If any one has had experience reading from this chip I could sure use some guidance.

I have read from I2C temp sensors with no problem, but these have 13 registers to choose from and I am missing something.

Comments

Sign In or Register to comment.