Project
Referring to the schematic in Figure 3, two outputs of
the PIC12LC508A (GP4 and 5) drive a 2 x 3 matrix of
switches. The switch states are read in using inputs GP0,
1, and 3, which are equipped with weak internal pullups
(determined by the device’s configuration bits), so no
external resistors are required. These inputs also support
“wake on pin change,” which allows the PIC to sleep while
waiting for a switch to be pressed. The final output (GP2)
drives the serial data to the Archos Jukebox.
The configuration fuses are set to use the internal
oscillator (leaving all six I/O pins available for use). All
timings are therefore calculated assuming a nominal 4
MHz clock, so each instruction cycle takes 1 µs.
Design Details
The basic code design is straightforward. All the
remote has to do is transmit the appropriate command to
the recorder when a switch is pressed. However, there
are a number of factors that make things a little more
complicated. These are:
• Providing an open-drain drive to the Archos, even
though the ’508A’s drivers have totem pole outputs.
Useful Websites
Rockbox
http://rockbox.haxx.se
Archos discussion group
http://groups.yahoo.com/group/archosjukebox6000
PIC MCU information
www.microchip.com
PIC discussion group
www.piclist.com
Eagle PCB layout software
www.cadsoft.de
• Minimizing power consumption.
• Debouncing the switches.
• Dealing with invalid key presses and making the design
Don’t Blow Up Your Recorder!
During development, I was using a 5 V UV EPROM PIC. If
I had inadvertently driven a logic 1 from GP2 while the TRIS
register was set to enable the pin, it would have pushed 5 V
into the recorder data line. This could well have resulted in
permanent damage to my recorder, so I did a lot of testing
before connecting the recorder to the prototype. Be careful
to thoroughly test your code if you make modifications!
F
o
r
E
l
e
c
t
r
o
n
i
c
s
NUTS & VOLTS
E
v
e
r
y
t
h
i
n
g
Figure 3
46
MAY 2004