RTC not counting up.
I can set the time on the RTC and retreive it but the value never changes. After some digging I found that it may have something to do with setting the ST bit. I've tried the following bit of code but that hasn't solved the problem:
const int MCP7940_I2C = 0x6F; // I2C Address for the RTC
const int REG_RTCSEC = 0x00; // Register Address: Time Second
Wire.requestFrom(MCP7940_I2C,7);
registerValue = Wire.read();
if (startClock == 0x00){
Wire.beginTransmission(MCP7940_I2C);
Wire.write(REG_RTCSEC);
Wire.write(bitClear (registerValue, 7));
Wire.endTransmission();
}
if (startClock == 0x01){
Wire.beginTransmission(MCP7940_I2C);
Wire.write(REG_RTCSEC);
Wire.write(bitSet(registerValue, 7));
Wire.endTransmission();
}
How do I start this clock?
Hi, can you please try with our example https://github.com/Industruino/democode/blob/master/rtc_D21G/rtc_D21G.ino
Features are documented at https://github.com/Industruino/documentation/blob/master/indio.md
Please make sure to insert a coin battery to make the RTC work.
can you please confirm what happens when you upload the demo sketch i linked to above, with screenshot of the serial monitor output. please send to connect@industruino.com so we can follow up
I have the same problem. Have you resolve it? With library "MCP7940-RTC-Library-master" and the example https://github.com/Industruino/democode/blob/master/rtc_D21G/rtc_D21G.ino the value never change 15:56:16.033 -> THU 29 aug 2019 15:56:16.066 -> 14:12:00 15:56:16.066 -> 15:56:17.061 -> THU 29 aug 2019 15:56:17.061 -> 14:12:00 15:56:17.061 -> 15:56:18.055 -> THU 29 aug 2019 15:56:18.088 -> 14:12:00 15:56:18.088 -> 15:56:19.084 -> THU 29 aug 2019 15:56:19.084 -> 14:12:00 15:56:19.084 -> 15:56:20.078 -> THU 29 aug 2019 15:56:20.111 -> 14:12:00 15:56:20.111 -> 15:56:21.106 -> THU 29 aug 2019 15:56:21.106 -> 14:12:00 15:56:21.106 -> 15:56:22.134 -> THU 29 aug 2019 15:56:22.134 -> 14:12:00 15:56:22.134 -> 15:56:23.128 -> THU 29 aug 2019 15:56:23.128 -> 14:12:00 15:56:23.128 -> 15:56:24.156 -> THU 29 aug 2019 15:56:24.156 -> 14:12:00 15:56:24.156 ->
Hi Jose, that does not look like the output of the linked sketch, can you upload the exact demo sketch, with screenshot of the serial monitor output. please send to connect@industruino.com so we can follow up make sure you are using our version of the library https://github.com/Industruino/MCP7940-RTC-Library
Hi Tom, I've tried running the sample code and used the library as given above, and even insert a coin battery, but still, the RTC is not counting up. In fact, I had to comment out this line in Setup() to make sure it updates the set time: RTCind.get(rtc,true); The output obtained from running serial_clock with above amendment: MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 ..... (and the list goes on, but not updated) Any idea why? Thanks
Hi Tom, I've tried running the sample code and used the library as given above, and even insert a coin battery, but still, the RTC is not counting up. In fact, I had to comment out this line in Setup() to make sure it updates the set time: RTCind.get(rtc,true); The output obtained from running serial_clock with above amendment: MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 MON 27 jan 2014 18:13:00 ..... (and the list goes on, but not updated) Any idea why? Thanks
Hi All, I'm out of office until the 7/10. I have a limited access to my email. It could be take some time to receive an answer.
For urgent matter for Belgium contact +32 4 270 4700, For Luxemburg & International + 352 26 90 89 38 or support@cybernet.be
Regards
Armand FUMAL CEO Cybernet International SARL.
Just to follow up, the MCP7940N is showing an oscillator failure (OSCRUN). Looks like a hardware problem.
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 3/28/19, 8:14 PM |
Seen: 2824 times |
Last updated: 3/31/19, 9:33 AM |
Thanks for your answer Tom. I haven't had any luck with that. I think the clock is working, I just need to start the oscillator by setting bit 7 at 0x00 to 1. Apparently this is a common problem with this chip. I'm not sure how to do that, however.