Scanning all 18 ADC channels of Teensy 4.1 using DMA

Status
Not open for further replies.

c10yas

New member
I'm trying to build something similar to MarcoRep's pressure-sensing matrix mat but need as high of a refresh rate as possible. I'm planning to use the Teensy 4.1 since I think I need a lot of RAM and processing power to store, process, and transmit the data to a computer using USB Serial. I could use an STM32H7 chip but the teensy4.1 seemed more accessible.

The circuit will be a 128x72 matrix. The 72 rows will be connected via a bank of 4:1 analog muxes to the 18 analog inputs of the Teensy. These analog muxes have 2 address pins to select the address, all the pins will be connected in parallel and be driven by the Teensy using a CMOS buffer. The 128 columns will be driven by a serially connected group of shift registers which will all be clocked by another Teensy output pin.

Ideally, I'd like to use ring buffers and 3 DMA channels to read the ADC data, change the analog mux positions and clock the shift register by simply writing to the GPIO pins. However, this seemed like the final goal for the project rather than step one. So step one would be to implement the analog reading, mux updating, and clocking the shifters, all in the main loop.
However, I'm stuck on step 2. This is where I want to scan all 18 ADC channels automatically and use the DMA to copy the 18 values into RAM. Then I use the CPU to copy the data from there and into my data structure, update the mux/shift registers, and finally, trigger the ADC again. How do I start going about this?

Thanks
 
Status
Not open for further replies.
Back
Top