Hello all!
I am using a pic 18f24j11, and I am trying to get the Real-Time clock going. I can't seem to however. Here is my code:
RTC not changing time values.
I am using a pic 18f24j11, and I am trying to get the Real-Time clock going. I can't seem to however. Here is my code:
Code (Text):
- char sec;
- void main(){
- EECON2 = 0x55;
- EECON2 = 0xAA;
- RTCCFG.RTCEN = 1;
- RTCCFG.RTCWREN = 1;
- RTCCFG.RTCSYNC = 0;
- RTCCFG.HALFSEC = 0;
- RTCCFG.RTCOE = 1;
- RTCCFG.RTCPTR0 = 0;
- RTCCFG.RTCPTR1 = 0;
- RTCCAL = 0x00;
- ALRMCFG.ALRMEN = 0;
- TRISB = 0x00;
- RTCVALL = 0x05;
- do{
- sec...