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
SYSTEM OVERVIEW
I built my clock around a Microchip Technology PIC24FJ64 processor (see Figure 1). I chose the DIP package for easy prototyping (see Photos 2a and 2b). The Microchip 24LC512 EEPROM chip has sufficient hardware resources to connect to the Microchip ENC28J60 Ethernet chip and an STMicroelectronics STA013 MP3 decoder. It has 64 KB of EEPROM, a 128 × 64 pixel OLED display, seven buttons, volume control, power control, and a photocell. That’s a lot of peripherals for such a small chip, and I use every resource available to talk to them.
a)![]() b) ![]() |
| Photo 2a— The use of DIP packages and adapters for surface-mount parts allows the entire project to be prototyped on a solderless breadboard. The power module was prototyped separately on a custom circuit board. b— One of the problems with using surface-mount parts is figuring out how to prototype circuits with them. In this photo, you can see two of my adapters. On the left is a crystal oscillator circuit. On the right is an interface for the OLED cable. |
The PIC24FJ64GA002 is a 28-pin chip with 64 KB of instruction memory and 8 KB of RAM. The 28-pin DIP package is compatible with breadboards and the evaluation board, which enables you to move chips between the various stages of development without having to reprogram them. Every pin is needed, and some serve dual purposes. The reconfigurable pin feature ensures that no pins are wasted and that signals can be routed to the closest pin for a clean layout. For example, the 32-kHz clock circuit is sensitive to switching noise, so the pin next to it is assigned to a signal that never changes after the clock starts. Normally, that pin would have been part of the high-speed oscillator, but I use the internal RC oscillator to free up two more pins.
I chose the PIC24FJ64 for its large amount of RAM. The MP3 decoder chip has a small buffer, and you can’t rely on the TCP stream to provide data fast enough. Thus, half of the PIC24FJ64’s RAM is dedicated to a buffer for the MP3 stream, leaving 4 KB for the remaining tasks. The CPU pins are configured to provide two SPI busses, one I2C bus, three ADC inputs, one serial port, and seven GPIO pins. The serial port shares pins with the in-circuit programming jack (with series resistors to protect against shorts), and one of the ADCs doubles as a mute control.
Most projects are all about doing one thing well. This project is about doing many things well enough, with the PIC24FJ64 controlling everything (see Figure 2).
![]() |
| Figure 2— This project seems complicated only because of the number of modules that need to talk to each other. This block diagram shows the relationship between the modules and the busses used to connect them. |
Now let’s examine each module connected to the PIC24FJ64 and what the processor does with it.
Previous | Next *| Subscription Deals |*
|


