SPI protocol
I've just been given a challenge to program a system with the Javelin Stamp to communicate with a master device using SPI protocol, but I don't have a clue where to begin. Can anyone help me understand the SPI protocol and methods of achieving this with the Javelin Stamp?
Comments
You can use the CPU.shiftIn() and CPU.shiftOut() to implement
the SPI protocol. Usually three signals are used with SPI:
CS = chipselect, usually you pull this line low to initiate a SPI transfer.
CLK = clock, this clocks the databits to/from the device
DATA = data, usually data consists of bytes (8 bits) but 12 or 16 bits is also possible.
Sometimes a 4th signal is required which determines datamode or commandmode.
The EA DOGM displays for example use 4 signals.
Best to write a seperate class for your device. It·is quite possible such a class
already exists. Can't tell until you specify the device.
regards peter
·
The other uController must therefore be able to operate in SPI slave mode, eg. accepting
an incoming clock signal and synchronizing dataflow with the received clockpulses.
regards peter
My guess is the highest clockfrequency the javelin can accept is
about 10kHz, due to the fact that the javelin must store received
bytes in an array, and memory access is about 1000 bytes per second.
regards peter
definitely move to the spin stamp if you want high throughput.
My guess is the spin stamp will support input clockfrequency >300kHz.
regards peter