+ Reply to Thread
Results 1 to 3 of 3
Thread: PCF8563 date data corrupted
-
- 14th August 2018, 13:19 #1
PCF8563 date data corrupted
PIC16F628, Pic Basic Pro 2.60, Pickit programmer
Good day ,
Below is my code to read the PCF8563:
I2Cread SDA,SCL,rtcadd,rtcloc,[secs,minu,hrs,DoM,doW,mon,year]
gosub waita 'read D&T data then wait 10ms
write $20,secs,minu,hrs, DoM,doW,mon,year 'write D&T data to F628 eeprom
When I read the data in the F628 eeprom I get correct minutes seconds and hours but the DoM,dOW,mon,year
data is corrupt. Every time I run that code the calendar data changes to something different and sometimes
some of the data is correct.
When I set alarms they work correctly.
When I replace the PCF8563 with a DS1307 and change the addresses accordingly, the program works perfectly.
I want to use this PCF8563 because it has alarms and battery voltage sensing that the DS1307 doesn't have.
I have also tried 3k3 resistors on SCL & SDA instead of 4k7 but that made no difference.
Can somebody help please.
-
- 15th August 2018, 09:29 #2
Re: PCF8563 date data corrupted
you need to mask off the bits that are not used for the value being returned
Code:minu = minu & $7f hrs = hrs & $3f Dow = dow & 7 Dom = dom & $3f mon = mon & $1f
This is more entertaining than Free to Air TV
-
- 15th August 2018, 18:40 #3
Re: PCF8563 date data corrupted
Thank you very much Richard , your advice fixed my problem.
I am so happy 'cause I really like this chip.
Now I can apply my mind to getting an interrupt every minute which
appears to be quite cumbersome.
Regards
Hebe
Similar Threads
-
My date this weekend.
By Christopher4187 in forum Off TopicReplies: 16Last Post: - 29th January 2008, 17:45 -
Bootloader corrupted at low voltage
By BrianT in forum mel PIC BASIC ProReplies: 6Last Post: - 2nd November 2007, 15:56 -
Array data being corrupted
By caverman in forum mel PIC BASIC ProReplies: 1Last Post: - 17th March 2006, 05:22 -
calculate with date
By Pedro Pinto in forum mel PIC BASIC ProReplies: 1Last Post: - 14th October 2005, 16:49 -
16F88.bas corrupted
By egberttheone in forum mel PIC BASIC ProReplies: 2Last Post: - 26th April 2005, 17:21
Bookmarks