■ PHOTO 1.
on a single
directly to it.
There's an extra
LED on the
we choose to
not get the LMX data radio to spit
out the data that I thought I was
inserting into its registers. I decided
to put my Saleae logic analyzer to
work on the problem. This logic
analyzer has the ability to decode
an SPI frame. Logic Capture 1 was
generated using the CCS compiler
spi_write() function. Here’s the code:
//select the LMX Data Radio
//send 0x55 out on MOSI
//release the LMX Data Radio
Since the LMX data radio
communicates with the PIC18F46J13
using SPI, it’s a no-brainer to issue
the compiler’s spi_read() and
spi_write() function calls.
Two days later — after invoking
hundreds of spi_read() and spi_write()
function calls — I was about to throw
in the towel on the use of the CCS
compiler in this project. I just could
As you can see, the rCSN enable
signal denotes the beginning and end
of the SPI frame. There are eight SCK
clock pulses in the frame, and the
0x55 was correctly transmitted by the
PIC18F46J13’s MOSI (Master Out
Slave In) pin.
■ LOGIC CAPTURE 1. This sanity check has been brought to you by Saleae logic. This capture verifies that the SPI signals
are all doing what is natural.
74 December 2012