After many delays, I finally put some constructive time into my 16F1829 I2C interface with an imported DS3231 RTC module. Long story, short, using a scope on SCL and SDA really helped.
Initial program had a couple of short cuts that didn't work like I hoped (based on MCC's ap notes) they would. The RTC was either in an unknown state or quickly became that way. It would not release the SDA line, so there was a constant error. Unplugged the RTC, and the program seemed to simulate fine, but I could not get the RTC as slave to release the SDA line. (I know what its datasheet says to do.) Removed it, rubbed the pins, let it rest awhile, and low and behold, it reset to a known state. When it was plugged into the test board, SDA was high. The rest of the trip was downhill.
Here's a snapshot:
Seconds are on top and minutes below. Soothing to watch the seconds tick away and watch them on the scope simultaneously.
Question: The DS3231 datasheet says simply to keep pulsing the SCL line until it releases the SDA line and lets it float high. Is there a way to do that using the MSSP module? That is, can you just start the clock alone without regard to the SDA status?
Regards, John
EDIT: Forgot to mention language is MPASM
Initial program had a couple of short cuts that didn't work like I hoped (based on MCC's ap notes) they would. The RTC was either in an unknown state or quickly became that way. It would not release the SDA line, so there was a constant error. Unplugged the RTC, and the program seemed to simulate fine, but I could not get the RTC as slave to release the SDA line. (I know what its datasheet says to do.) Removed it, rubbed the pins, let it rest awhile, and low and behold, it reset to a known state. When it was plugged into the test board, SDA was high. The rest of the trip was downhill.
Here's a snapshot:
Seconds are on top and minutes below. Soothing to watch the seconds tick away and watch them on the scope simultaneously.
Question: The DS3231 datasheet says simply to keep pulsing the SCL line until it releases the SDA line and lets it float high. Is there a way to do that using the MSSP module? That is, can you just start the clock alone without regard to the SDA status?
Regards, John
EDIT: Forgot to mention language is MPASM
Last edited: