This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI to USB

Other Parts Discussed in Thread: MSP430F5510

I'm looking for an "in the can" SPI to USB bi-directional bridge using any of the MSP430 devices. Anyone know of a design that already is working?

  • I don't think this is possible off-the-shelf.

    SPI is a synchronous bi-directional bus. How to deal with it depends on the situation. It's not easy, if possible at all, to pass this through an USB connection.

    For  aserial bridge, it is easy: outgoing data and incoming data are two separate streams and can be forwareded through USB just as needed. SPI, however, is something that must be controlled tighly to the purpose. SPi slave is ourtright impossible, just for the USB latency time alone.
    USB master, well, you may be able to set up a generic transfer, but slooow, because to handle all SPI aspects, there will be only one byte transfer before the bridge will have to report back to the PC and wait for what to do next. Sure, some plain unidirecitonal transfers can be done in a batch, but this is only a fraction of possible situations with SPI. For most others, either you have a critical time window to decide what to do, or complex reactions, so an all-purpose bridge is almost impossible to build.

    In the very most situations, the part on the SPI interface needs to exactly known what and when to do, and will only take base orders form or report back to th PC. A transpared bridge where you control a virtual SPI transfer on the PC and it is mirrored on the bridge chip through USB is at least extremely difficult and mos tlikely unreliable if not impossible.

  • Thanks for the information. So - in this project the data via the SPI bus will be in a pre-defined byte count. I assume that buffering the data from the SPI then when the entire multi-byte SPI packet has arrived pass the buffer out the USB port would be doable? I have not implemented USB on the MSP430 family yet, is there a design and software ready to go for USB on the MSP430?

  • Stan Ross said:
    I assume that buffering the data from the SPI then when the entire multi-byte SPI packet has arrived pass the buffer out the USB port would be doable?

    Yes. THis wouldn't eb a generic SPI implementation, but an applicaiton-specific one like this is no problem.

    The MSP430F55xx family (e.g. MSP430F5510) has an USB client controller and up to 4 hardware SPI interfaces (2* UART, 2* I2C or up to 4* SPI for some, half oof it for the smaller ones)

    An USB stack is available. And programming the SPI is a rather simple task if you know how SPI works in general. Fo rboth, demo code is available form the product page.

**Attention** This is a public forum