Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: T4.1 - QuadTimers controlling DMA from (16) GPIOs connected to Ethernet via XBAR ?

  1. #1
    Junior Member
    Join Date
    Jun 2020

    T4.1 - QuadTimers controlling DMA from (16) GPIOs connected to Ethernet via XBAR ?

    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)?


    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 by nmz787; 06-27-2020 at 09:36 AM. Reason: added bold instead of backticks

  2. #2
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Personally I couldn't tell you what works and doesn't work with my libraries, hopefully it doesn't conflict with anything, but I've never done any work with DMA or XBAR and very little with timers in general so I don't even know where to start to even get an example working that I could probe for problems. If you do run into any problems I would like to get a bare minimum sketch that I can reproduce the issue with so I can find anything that's causing issues in my library and fix them. You shouldn't have any problems using TCP for this as long as you give it a static ip so the computer knows where it's at, FNET does have MDNS/Bonjour built in, but I haven't added an easy way to make use of it in my NativeEthernet library yet.

  3. #3
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Alright I added the MDNS part in to my library so now you can use a .local address instead of a static ip.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts