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.
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.
Archos discussion group
PIC MCU information
PIC discussion group
Eagle PCB layout software
• 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!
NUTS & VOLTS