thunderdantheman
Member level 4
- Joined
- Jan 19, 2010
- Messages
- 74
- Helped
- 13
- Reputation
- 26
- Reaction score
- 15
- Trophy points
- 1,288
- Location
- Australia
- Activity points
- 2,113
Suitable Micro-controller to bridge 4Mbps SPI to USB
G'day,
I've been tasked the job of cleaning up someone's failed attempt at what they thought was going to be a simple data acquisition system.
The system has two 8 channel 12Bit 500kS/s SPI ADCs. (Actually run at 20kS/s per channel for a total system throughput of 3.84Mb/s + overhead) An embedded Linux controller (Raspberry Pi) interfaces with the ADC through its SPI port. Being a non real-time OS, there are all sorts of problems with sample skew and missing packets.
My initial idea was to add a small micro-controller (PIC, AVR etc..) to provide a low skew sample conversion clock, buffer the data and send high speed busts to the Pi.. this could be tricky since the pi can only run in master mode meaning i would have to utilise additional IO to notify when the buffer was full or getting empty. there is no hardware interrupt IO available on the Pi (off the shelf and I'm no kernel developer - a hack maybe..) and I'm not polling).
I'm wondering what the possibility is of using a micro-controller (AVR comes to mind) as an SPI -> USB bridge. If i were to configure the controller as a CDC device, are they faster enough to handle close to 4Mbps? or would I need a custom driver (would like to avoid this - have used libusb in the past however.) If not has anyone got any alternatives?
G'day,
I've been tasked the job of cleaning up someone's failed attempt at what they thought was going to be a simple data acquisition system.
The system has two 8 channel 12Bit 500kS/s SPI ADCs. (Actually run at 20kS/s per channel for a total system throughput of 3.84Mb/s + overhead) An embedded Linux controller (Raspberry Pi) interfaces with the ADC through its SPI port. Being a non real-time OS, there are all sorts of problems with sample skew and missing packets.
My initial idea was to add a small micro-controller (PIC, AVR etc..) to provide a low skew sample conversion clock, buffer the data and send high speed busts to the Pi.. this could be tricky since the pi can only run in master mode meaning i would have to utilise additional IO to notify when the buffer was full or getting empty. there is no hardware interrupt IO available on the Pi (off the shelf and I'm no kernel developer - a hack maybe..) and I'm not polling).
I'm wondering what the possibility is of using a micro-controller (AVR comes to mind) as an SPI -> USB bridge. If i were to configure the controller as a CDC device, are they faster enough to handle close to 4Mbps? or would I need a custom driver (would like to avoid this - have used libusb in the past however.) If not has anyone got any alternatives?