Hi all,
I have an application where I need to emulate a synchronous
serial interface to a microVAX (yeah really!).
The microVAX reads a 21-bit angular encoder position.
The encoders need to be changed, but the old control
interface needs to be retained (at least for now).
I have a new-style encoder that I need to adapt to
the old interface.
The old encoder interface is basically a 21-bit shift
register. The new encoders use a serial interface,
and some processing of errors and CRCs is required.
I was thinking of putting an ARM device on the adapter
board, and in particular one of the devices with a CAN
interface, so that later when the microVAX is gone
I can use the same interface board.
I was thinking of the following;
- LPC2129 device
- setup the SPI port for slave mode operation
(the LPC might need to assert its own SSEL pin)
- microVAX drives the SPI clock and reads data
from the SPI slave out pin
with the byte SPI interface, the 21-bit transaction would
consist of 2 complete bytes and then a 5-bit byte to give
21-bits. I'd probably count the clocks and then deassert
SSEL after bit 21 (which will cause an SPI abort to be
asserted, but that should be ok).
The SPI transmitter is not buffered in any way, so my
question relates to the transition between bytes,
I would get an interrupt when the first byte is
done, and would use that to write the second byte,
and again for the third byte. My concern has to do with
the bit timing between bytes.
I'll write some code and figure all this out, but
just thought I'd post this to see if anyone had
used the SPI port for multiple-byte transitions
in slave mode to hear their experience.
I'm still waiting on documentation for the microVAX
timing. If its really slow, then I can just use
an IRQ line on the clock from the microVAX and
write the data to an I/O pin. Using the SPI port
as a shift-register does seem nice and elegant
though.
And of course, if the SPI port can not be used,
I'll just do the obvious and put a 21-bit shift
register on the adapter, or an FPGA and have
extra logic for later.
Cheers
DaveMessage
Multi-byte SPI transfers in slave mode (21-bits actually)
2005-11-21 by David Hawkins
Attachments
- No local attachments were found for this message.