??? 10/18/10 19:03 Read: times |
#179177 - Large number of alarms Responding to: ???'s previous message |
You can have large number of alarms.
It's just a question of what you make your ds12887 do and what you make your 8051 do. At any one time, you can only handle one alarm - unless your 8051 have many different piezo summers or other means to report them. So let's say that you have 5 alarms: Last count down alarm 13:27 Curent time is 23:50. Morning alarm at 07:30 - that is 7h40min from "now" Tea alarm at 09:30 - that is 9h40min from "now" Lunch alarm at 12:00 - that is 12h10min from "now" Tea alarm at 15:00 - that is 15h10min from "now" Run-from-job alarm at 18:00 - that is 18h10min from "now" Count down alarm at 2d + 13:27 - that is 61h37min from "now" Notice that all of these alarm points - since I decided to sort them - are at different times. So program your chip with an alarm at 07:30. When you wake up, you know it was the 07:30 alarm. Play the special melody for morning wakeup. Reprogram clock chip to generate alarm at 09:30, and put processor to sleep. When it gets woken up, you know why. ... Reprogram clock for alarm at 18:00. Reprogram clock for alarm at 7:30 Reprogram clock for alarm at 9:30 Reprogram clock for alarm at 12:00 Reprogram clock for alarm at 15:00 Reprogram clock for alarm at 18:00 Reprogram clock for alarm at 7:30 Reprogram clock for alarm at 9:30 Reprogram clock for alarm at 12:00 Reprogram clock for alarm at 13:27 <= finally 72 hours since previous 72h countdown... Reprogram clock for alarm at 15:00 ... Note that unless you sleep the processor while waiting for the RTC to wake it up, you don't even need any RTC with alarm function. You can just manage with a 1Hz pulse or whatever to keep track of time. It mostly depends on if you have a display to take care of too, showing the current time. But anyway - as you can see, you can have any number of alarms as long as they fit in the 8051. And every single alarm can be of different type. - Fixed time every day - Fixed time but only on special days - Fixed time every week - Any suitable repetition (ever 93rd minute, if that suits you) - ... Handling multiple alarms is not a microcontroller problem. It's the same as if a PC program handles multiple alarms. It just rolls through the different alarms and keeps track of which alarm is closest to happen. Just remember that you can have multiple alarms happen at the same time in case your 72h alarm gets started at 12:00 - so when getting woken by the RTC you need to figure out not jus "which" alarm, but how many alarms that got activated. Especially if each individual alarm trigs a separate GPIO pin for informing the user. |
Topic | Author | Date |
8051 alarm clock | 01/01/70 00:00 | |
Large number of alarms | 01/01/70 00:00 | |
Design Really Needed | 01/01/70 00:00 | |
two things | 01/01/70 00:00 | |
Segment your Application | 01/01/70 00:00 | |
Incremental work | 01/01/70 00:00 | |
date means date. | 01/01/70 00:00 | |
an interesting anecdote | 01/01/70 00:00 | |
Definitely keep a table | 01/01/70 00:00 | |
I wouldn't rely on that | 01/01/70 00:00 | |
No SMS for setting clock | 01/01/70 00:00 | |
thank for the help on my project | 01/01/70 00:00 | |
Options | 01/01/70 00:00 |