CURRENT ISSUE

Contests

bottom corner

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

REMOTE PROTOCOLS

The alarm clock includes useful remote management features. There are two TCP sockets that the clock listens on. The first is an MP3 socket. A remote computer can connect to this socket and send MP3 data that the clock will play. This lets you have “alarms,” which are determined by the remote computer, rather than triggered by the clock itself. The remote stream can be terminated by the same button that ends a local alarm.

The second socket allows for EEPROM access by the remote machine (see Table 1). This lets you do everything from remote reprogramming to checking the time zone and setting alarms. The protocol is a simple read/write protocol. To read a range of EEPROM addresses, send an “R” character followed by 2 bytes of address (LSB first) and a 1-byte count (0–255). The clock responds by sending <count> bytes back:

R addrL addrH count
        <byte><byte><byte>...<byte>

To write to the EEPROM, send a W followed by the address and count, followed by <count> bytes. The clock sends back a NUL byte when it’s done:

W addrL addrH count
<byte><byte><byte>
  ...<byte>
               NUL

As long as the remote program knows the format of the EEPROM, this lets it read or modify pretty much anything in the EEPROM.

Previous | Next                *| Subscription Deals |*

 


bottom corner