■ SCREENSHOT 2. Using
AX-MicroLab is akin to going to the
supermarket with unlimited funds.
Now for things we aren’t sure of.
The data radio datasheet does not
specify when to sample the data. Nor
does it tell us when to present the
data relative to the SPI clock. In our
code, we have exposed the bits that
determine where to sample the data
(SMP) and when to present it relative
to the SPI master clock (CKE).
Twiddling the SMP bit did
nothing to change the results.
Looking back at our SPI setup code,
the CKE bit is clear indicating that the
data is transmitted on the rising edge
of the clock. So, let’s set CKE and see
what happens. Setting CKE will
transmit the data on the falling edge
of the SPI master clock. We’ll run our
homegrown code first:
data_in = spi_rd_reg(CONFIG);
Remember Herman’s Hermits?
Something tells me I’m into
something good. Take a look at
THE FLOOD GATES
Now that we have the ability to
reach out and touch the LMX data
radio registers, we can begin to
assemble more complex functions.
For instance, some of the data that is
passed between the PIC18F46J13
and the data radio is in multi-byte
format. That means we will need to
read and write multiple bytes which
will most likely be stored and
retrieved from a set of SRAM and
ROM buffers we will allocate in the
PIC18F46J13’s program and data
The data radio is available from
Lemos International. I’m building the
Design Cycle LMX data radio project
from scratch. However, you can get a
data radio hardware development kit
from Lemos International.
Meanwhile, I’ll continue to work
on the data radio firmware driver so
you can add it to your Design Cycle.
December 2012 77