Sujet : Re: rp2040 a2d?
De : pcdhSpamMeSenseless (at) *nospam* electrooptical.net (Phil Hobbs)
Groupes : sci.electronics.designDate : 14. Mar 2025, 02:03:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vqvv8v$7snb$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : NewsTap/5.5 (iPhone/iPod Touch)
Dave Platt <
dplatt@coop.radagast.org> wrote:
In article <817668f6-ea2b-0fee-7a4e-839c333aa8a4@electrooptical.net>,
Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:
Yup. Or run the ADC from the DMA peripheral, with ping-pong buffers.
Either way, you can arrange to get good repeatable hardware timing.
Yup again. I've got the ADC on the RP2040 Pico running at 500
kilosamples/second (as fast as it'll go), using two chained
DMA buffers. Works like a charm and (with a sufficient amount
of RAM for the buffers) keeps the interrupt and task-switch
overhead down to a trivial minimum. I'm sure the same trick is
possible if you decide to use an external ADC, using SPI or
the PIO block to fetch the samples.
Just do read all of the instructions in the programming manual about
how one must chain and un-chain buffers during the DMA-start and
DMA-stop processes. I managed to get a situation where everything
worked right the first time, but after stopping and starting
acquisition again, both DMAs were active simultaneously and were doing
a King Solomon number on the samples coming from the ADC. I found
myself whistling "Chain Of Fools" while coding up a fix for my error :-)
Fun!
These days Simon doesn’t let me near the firmware, so I have to make stuff
up. ;)
Cheers
Phil Hobbs
-- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC /Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics