Discuss this article in the Nuts & Volts forums at http://forum.nutsvolts.com.
■ SCHEMATIC 1. There are some hidden resources lurking in this simplistic design.
The PIC18F46J13 contains a powerful internal RTCC module and is capable of doubling the UART
and SPI interfaces. The PIC18F46J13 is a perfect choice to drive the LMX data radio.
important to this project as we will
be writing a driver for the new series
of LMX low-power data radios.
Our initial LMX hardware design
will be relatively simple as our goal is
to build a suitable firmware driver for
the data radio. With that, all we will
really need are a few LED status
indicators and an RS-232 port.
If you’ve already taken a peek at
Schematic 1, you’ve noted that there
is an RS-232 interface defined but no
RS-232 hardware has been drawn up.
That’s because the RS-232 circuitry
exists on an external Digilent
The PModUSBUART is a
standard implementation of the FTDI
FT232R USB UART IC. Including the
PModUSBUART in our design
eliminates the need for the
microcontroller to be USB capable.
In addition, the PModUSBUART can
be removed and need not be
considered in the battery life
Like the microcontroller design,
the power supply design is simple
and efficient. A Microchip LDO (Low
Drop Out) voltage regulator and a
couple of ceramic capacitors are all
that is needed to insure that the
circuitry is fed from a 3. 3 volt power
The PModUSBUART module,
PIC18F46J13 assembly, and LMX
data radio are shown in Photo 1. I
used tinned hookup wire to adapt
the LMX to a standard 0.1 inch pitch
male header which is plugged into a
similar pitched female header. The
LMX data radio support hardware has
turned out to be a collection of
electronic building blocks assembled
on a plated-through breadboard.
FROM PINS AND PADS
TO BITS AND BYTES
The CCS compiler and MPLAB X
IDE got along from the time they
were paired. However, the
PIC18F46J13 wasn’t as happy with
the C compiler as I figured it would
be. The very first thing for us to
accomplish when writing a driver is
to code functions that establish a
data communications path between
the microcontroller and the target
device. In this case, the target device
is an SPI slave.
The natural thing to do when
using the C compiler is to take
advantage of its built-in functions.
December 2012 73