CURRENT ISSUE
Contests
FEATURE ARTICLE
|
|
Issue #216 July 2008
Second Place Microchip 2007 Design Contest
’Net-Enabled Alarm Clock
by DJ Delorie
Start | System Overview | Network | Display | MP3 | ADC | Memory | Power | Software | Time | Alarms | GUI | Remote Protocols | Construction & Packaging | Smart Combinations | Sources & PDF
ALARMS
Once a minute, the list of alarms is scanned to see if any of them match the current time. Each alarm setting uses 7 bytes of the EEPROM, for a maximum of about 7,000 alarms with my current EEPROM load. The bytes are: hour (0–23, BCD encoded), minute, a weekday mask, month (1–12), day (1–31), and the address of a web site descriptor. The weekday mask has 1 bit set for each day of the week for which the alarm is enabled. One extra bit as a global “enable” bit, so you can disable the alarm without erasing it. If the month byte is zero, the day-of-week mask is used to enable the alarm; otherwise, the month and day are used and the weekday mask is ignored. This way, you can have an alarm that goes off only on weekdays, plus alarms that go off on specific days.
Each alarm indexes into a table of web sites, or “destinations.” Each entry includes a pointer into a string table for the MP3 stream’s URL, and a second pointer for a descriptive string. The GUI lets you choose from the list of destinations for each alarm, but to change the list of URLs itself, you need to use the remote management protocol.
Previous | Next *| Subscription Deals |*
|