laktronics said:Hi,
I am sorry, I should have advised you this earlier, you should get everything about 8052 at www.8052.com. You should visit their code section, and I am sure your clock should me ticking over there, may be you have to join the forum to go to code section.
Regards,
Laktronics
vietdung79 said:Try some Voice Recorder ICs such as ISD2560.
Correct me if I'm wrong but the DS doesn't have any alarm time registers so where do you think to store the alarm time?
What was your idea about storing time and compare actual time & alarm time?
My basic idea is:
1) EEPROM to store all alarm times (day of week, hour, minute (, second)).
2) On second or minute basis compare actual time and alarm times.
3) Use PC to download alarmtimes into clock.
Do you want accuracy of alarmtime on second or minute level?
I mean is alarmtime 07:25 ok or do you need 07:25:35?
Do you need alarmtime based on day of week or not?
Same time for all days of week or not?
Please keep in mind that you will need a battery backup or all you alarms will be gone at the first power down
One alarmtime can looks like:
Byte 0: 3 bits = day of week -- 5 bit = alarm hour in 24 hour system
OR
Byte 0: 3 bits = day of week -- 1 bit = AM/PM -- 4 bit = alarm hour in 12 hour system
Byte 1: alarm minute
Byte 2: alarm second if needed
You need 4 alarms? That's 8 or 12 bytes in RAM.
Endless loop in your µC:
Read actual time
Read alarm time 1 : compare with actual time : if needed set alarm bit
Read alarm time 2 : compare with actual time : if needed set alarm bit
Read alarm time 3 : compare with actual time : if needed set alarm bit
Read alarm time 4 : compare with actual time : if needed set alarm bit
I'm sorry but I have no link to my brain
b) hour : can be defined as 0 to 12h and AM/PM bit or 0 to 24h
So you have to store this data in RAM for every single alarm.
You can do it as follow:
First byte : days of week alarm active
Bit 0 : Monday
Bit 1 : Tuesday
Bit 2 : Wednesday
Bit 3 : Thursday
Bit 4 : Friday
Bit 5 : Saterday
Bit 6 : Sunday
Bit 7 : not used
Second byte : hour in 12h and AM/PM bit mode
Bit 0 to 3 : alarm hour, any number between 0 and 11
Bit 4 : AM/PM bit
Bit 5 to 7 : not used
Second byte : hour in 24h mode
Bit 0 to 4 : alarm hour, any number between 0 and 23
Bit 5 to 7 : not used
Third byte : minute : any number between 0 and 59
Bit 0 to 5 : alarm minute, any number between 0 and 59
Bit 6 & 7 : not used
Let say you store all your data from byte 10h in RAM of the RTC
10h : Alarm 1, days of week active
11h : Alarm 1, hour
12h : Alarm 1, minute
13h : Alarm 2, days of week active
14h : Alarm 2, hour
15h : Alarm 2, minute
16h : Alarm 3, days of week active
17h : Alarm 3, hour
18h : Alarm 3, minute
19h : Alarm 4, days of week active
1Ah : Alarm 4, hour
1Bh : Alarm 4, minute
thanks for replying..Hope this new configuration is clear to you.
i have implemented and its working perfectly..Now I realise that there's an error in my previous configuration.
The three bits for day of week allow only one day with alarm
So please forget about it.
H_D_R said:So you have to store this data in RAM for every single alarm.
You can do it as follow:
First byte : days of week alarm active
Bit 0 : Monday
Bit 1 : Tuesday
Bit 2 : Wednesday
Bit 3 : Thursday
Bit 4 : Friday
Bit 5 : Saterday
Bit 6 : Sunday
Bit 7 : not used
how can i access it..?? i have only four keys.
by the way i have implemented for storing day,
in which it is comparing day with 1 to 7 and start from sunday to saturday.
and its working perfectly too..
but if i am using same code with different RAM loacation to store it as
Alarm On-Day and Alarm Off-Day then its not working..??
2 keys are enoughH_D_R said:how can i access it..?? i have only four keys.
by the way i have implemented for storing day,
Nice to hear that it's working perfectly.H_D_R said:i am able to store the
alarm_on_min,
alarm_on_hour,
alarm_off_min,
alarm_off_hour.
and its working perfectly...
Now I'm really confusedH_D_R said:but as i am trying to add alarm_on_day, alarm_off_day in set alarm loop.
it gives some irregular outputs and not even stores the hour and min time too.
You can put the code here or mail it to me, your choice...H_D_R said:can you please help me..
may i put the code here, so you can check and reply me...??
mcs51mc said:Why do you need "alarm_off_min" & "alarm_off_hour"?
I thought the user is supposed to turn the alarm off
i am able to store the
alarm_on_min,
alarm_on_hour,
alarm_off_min,
alarm_off_hour.
and its working perfectly...
Nice to hear that it's working perfectly.
But what's working perfectly? Storing in the DS?
How do you know it's working perfectly? By recalling it from the DS maybe...?
Now I'm really confusedH_D_R said:but as i am trying to add alarm_on_day, alarm_off_day in set alarm loop .
it gives some irregular outputs and not even stores the hour and min time too.
What do you mean by "add" ?
You can't store anymore? Store what, where? At the start of the post you wrote : "and its working perfectly..."
You lost me completely
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?