Hi,
I'm working on a project where I need to sample (16) ADCs that report their data via SPI. The target sample rate is 100ksps, with (16) channels and 16-bits per sample, that's 3.2MBPS.
The ADCs only need SCK and MISO, they aren't programmed via MOSI, rather a conversion from analog to digital is started with a "start capture" pin.
The idea is to tie all (16) SCK and START together, to two pins respectively, and hook them each up to their own timer to emit the (faster) SCK and (slower) START signals. A 3rd timer would start the other two, so the GPIO edges are synchronized.
The 16 MISO signals would each be connected to their own GPIOs.
Now here's where I start to get "hand wavy". Basically I want the CPU to be idle while a 4th timer (also started by the 3rd, in sync with the SCK and START GPIOs) periodically is started, and then stops running after (16) ticks. On each tick, the GPIO MISO pins would be captured and input into DMA channels, and sent to either the SD card or the Ethernet.
I say OR because I think sending it to an SD card will be easier, but I really want these data to get sent to a server with a big hard-drive. I'm just thinking in terms of staging this development.
Does anyone have any suggestions? Any code/libraries out there to help any of these pieces?
Do I connect the GPIOs to the XBAR and then to the DMA data-source? Connecting the DMA to it's data sink, and then to the timer is a little less blurry for me... but the whole getting it pumped out of the Ethernet (to a specific IP address) is not really too clear. Do I setup some template packet, and the DMA/Ethernet event packs the input into some data field to be sent out? Will this be UDP? I don't want to lose samples, so can I do TCP (since it offers retransmission)?
Thanks!
P.S. I've already got an Ethernet demo running with vjmusik's FNET and NativeEthernet library combo... I wonder if that will conflict with trying to shove data at the interface via DMA. Will my use of timers mess with it?
I'm working on a project where I need to sample (16) ADCs that report their data via SPI. The target sample rate is 100ksps, with (16) channels and 16-bits per sample, that's 3.2MBPS.
The ADCs only need SCK and MISO, they aren't programmed via MOSI, rather a conversion from analog to digital is started with a "start capture" pin.
The idea is to tie all (16) SCK and START together, to two pins respectively, and hook them each up to their own timer to emit the (faster) SCK and (slower) START signals. A 3rd timer would start the other two, so the GPIO edges are synchronized.
The 16 MISO signals would each be connected to their own GPIOs.
Now here's where I start to get "hand wavy". Basically I want the CPU to be idle while a 4th timer (also started by the 3rd, in sync with the SCK and START GPIOs) periodically is started, and then stops running after (16) ticks. On each tick, the GPIO MISO pins would be captured and input into DMA channels, and sent to either the SD card or the Ethernet.
I say OR because I think sending it to an SD card will be easier, but I really want these data to get sent to a server with a big hard-drive. I'm just thinking in terms of staging this development.
Does anyone have any suggestions? Any code/libraries out there to help any of these pieces?
Do I connect the GPIOs to the XBAR and then to the DMA data-source? Connecting the DMA to it's data sink, and then to the timer is a little less blurry for me... but the whole getting it pumped out of the Ethernet (to a specific IP address) is not really too clear. Do I setup some template packet, and the DMA/Ethernet event packs the input into some data field to be sent out? Will this be UDP? I don't want to lose samples, so can I do TCP (since it offers retransmission)?
Thanks!
P.S. I've already got an Ethernet demo running with vjmusik's FNET and NativeEthernet library combo... I wonder if that will conflict with trying to shove data at the interface via DMA. Will my use of timers mess with it?
Last edited: