PDA

View Full Version : program of Melanie



jonas2
- 26th October 2009, 10:16
Hello

I took the conversion program of Melanie, but I
A problem with the backup in the external eeprom.
Should we save time and minute on 2 bytes?

Thank you

jonas2
- 27th October 2009, 09:51
Hello


The data are stored in external EEPROM.
But when I reread the eeprom hour, minute and second
Are written in hexadecimal, while others are in decimal.
Should he make the conversion before saving?

Thank you

Melanie
- 28th October 2009, 11:01
Hi Jonas

I've not looked at your program yet through lack of time...

If you want to store in EEPROM, then the best and easiest is to save in the same (BCD) format as you are reading from the RTC. That way, you will remember that all operations, be they EEPROM or RTC are always in the same format.

Only convert to a human readable format when you want interaction by a human (ie Display or Setting).

Now, if you are saving to EEPROM, this raises another question - how often are you saving? Always remember that some EEPROMs only have a 100,000 WRITE lifetime... if you are saving every second, it won't be that long before you reach that limit.

jonas2
- 28th October 2009, 15:42
Good evening

It is a program to test how backups are the data in the eeprom.
And as can see the data is written partly in Hexa and others in Decimal
I need your help

Thank you

aratti
- 28th October 2009, 18:05
The data are stored in external EEPROM.
But when I reread the eeprom hour, minute and second
Are written in hexadecimal, while others are in decimal.
Should he make the conversion before saving?


Whatever format you will use data in eeprom will be saved in binary format!

17 = $11 will be saved as %00010001
26 = $1A will be saved as %00011010
9 = $9 will be saved as %00001001
0 = $0 will be saved as %00000000

number from 0 to 9 are the same in both format decimal and hex.

Al.

jonas2
- 29th October 2009, 10:03
Hello


I agree with you, but if I use a terminal to receive
Data stored in the eeprom.
I wanted to do it this way:

29 October 09, ten hours unit time, unit ten months .

d_heure = hour / 16
u_heure = hour - (d_heure * 16)
d_heure = d_heure + 48
u_heure = u_heure + 48

d_minute = minute / 16
u_minute = minute - (d_minute * 16)
d_minute = d_minute + 48
u_minute = u_minute + 48

thank you for your help