Issue
149 December 2002
Wireless
Temperature Sensor Stew
FRED’S
rfPICDEM1
The
rfPICDEM1 comes ready to roll with functional firmware
loads in both the transmitter and receiver. My rfPICDEM1
worked as designed when I powered up the boards. Although
the rfPICDEM1 is a fun gadget to play with, you’re not
supposed to stop playing with it after you power it
up and verify the temperature of the room you’re standing
in.
From
the preliminary marketing package I received from Microchip,
I knew I could use the ICSP adapter on the receiver
to twiddle bits on the PIC16C925 by replacing it with
a windowed JW reprogrammable part. However, I was reasonably
concerned about how I was going to manipulate the transmitter
code, especially because there weren’t any alternatives
other than replacing the surface-mounted rfPIC or putting
something there in its place.
In
anticipation of not being able to keep my hands off
the code or the physical electronics, I obtained a couple
of windowed PIC16C925 devices and a tube of rfPIC12C509AG
units. I also picked up an ICSP adapter and a PIC16C925
programming adapter for my Microchip Pro Mate II programmer.
I had considered getting some of the windowed rfPICs
but that would mean performing major surgery on the
little transmitter stick.
After
I became accustomed to what the rfPIC demo package could
do, I decided to leave the receiver alone; it was already
equipped to show the contents of the data received from
the remote transmitter as well as the temperature of
its on-board TC74 senses. Because the transmitter was
without any user feedback by itself, I thought it would
be neat to crack into the transmitter and display its
station ID and temperature without having to transmit
all of that to the receiver and view it on the receiver’s
LCD.
Notice
that I didn’t mention displaying the push button status.
That’s because I really want to replace those tiny buttons
with a more ergonomic user interface. Now, I’m at the
crossroads and the challenge has been laid down: Do
I build customized hardware to do this conversion, or
can I assemble a set of prefabricated electronic building
blocks and weasel out of doing a bunch of soldering
and coding?
One
problem would be what to do about the surface-mounted
rfPIC. It seems I would have to solder in a new one
each time I changed the code or cut the traces and install
the optional 8-pin DIP socket. Assuming I can come up
with a viable solution to deal with the physical elements
involved with converting the rfPIC code, I’m still in
the soup as to how to convert the firmware.
The
original code for the rfPICDEM1 was completed using
the Hi-Tech PIC C compiler. I don’t own a copy of Hi-Tech’s
C, but I do own a copy of the CCS PICC, and you can
be sure there will be differences in the source that
I’ll have to interpret and compensate for. And, if I
did use the 8-pin DIP socket and another 8-pin part,
could I get all of my new code to fit? The real showstopper
is that I would have to remove the PIC to program it,
because there is no provision for ICSP on the transmitter
board. There will be no surrogate PIC12C509 if I can
get around it.
Because
the transmitter’s push-button switches simply take an
I/O pin from the rfPIC to ground, I had originally thought
I could replace the transmitter’s switches with logic
levels from an external microcontroller that would take
the place of the PIC12C509 portion of the rfPIC. The
external microcontroller would allow me to use the existing
rfPIC in its entirety without having to compromise the
rfPIC’s original firmware or PC board traces.
The
problem, however, is that even though I would gain the
I/O lines and program memory space necessary to drive
an LCD, I’d still be stuck using push buttons or a keypad
to actuate the transmitter. No matter what, I’m going
to have to alter the rfPIC’s firmware to obtain any
data from the transmitter’s rfPIC. The ideal solution
would be a touch-sensitive display that would integrate
easily to an external microcontroller and handle the
data-gathering (and conversion) duties needed to drive
the LCD, as well as the RF tasks.