I don't want to be rude but RTFM, p.156:
Pull-up resistors are mandatory for I2C. Keep trying, the DS3231 has nice features like alarms and is more accurate than the DS1307.The Address size sent (byte or word) is determined by the size of the variable that is used. If a byte-sized variable is used for the Address, an 8-bit address is sent. If a word-sized variable is used, a 16-bit address is sent. Be sure to use the proper sized variable for the device you wish to communicate with. Constants should not be used for the Address as the size can vary dependent on the size of the constant. Also, expressions should not be used as they can cause an improper Address size to be sent.
you keep showing this
it should be (apart from what michelj has pointed out)i2cREAD SDA,SCL,%11010000,$00,var
i2cREAD SDA,SCL,%11010000,0,[var]
yet to be addressed :-
none of the code you have posted seems to have the correct syntax for i2c commands .
do you have a accurate schematic of your setup ?
can you flash a led with your pic ? do the scl,sda pins do anything ?
do you have a oscilloscope or a logic analyser to check output ?
what do you get when you read the command and status regs of the ds3231 (0x0e,0x0f) ?
I'm a total idiot ... I'll correct the code ...
Thanks guys ...
- Ipsa scientia potestas est -
Bookmarks