RP2040 I2S continuous generated waveform #19295
Unanswered
ruffrecords
asked this question in
RP2040 / Pico
Replies: 1 comment 8 replies
-
|
Easy. Two DMA channels, triggering each other and both sending the array data to I2S. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a Pico project which can generate a variety of continuous repeating waveforms for testing audio equipment (sine, square, triangle, white noise etc). It is easy enough to generate these in an array (or load them in from a library or SD card) but the part I am not sure about is how to set up I2S to continuously repeat the waveform without blocking. I have scoured Mike Teachman's examples but I am not confident that an i2s_callback() would be fast enough. As the I2S functionality is subject to Technical Review can I suggest an optional loop flag be useful for this kind of application?
Also, to avoid lots of heap activity I plan for there to be a single buffer for the waveform, some or all of which may be required for a particular waveform. Would the sensible thing to do be to pass a memory view of the required section of the array?
For information the signal is 16 bit mono at a sample rate of 80K/s. The lowest frequency to be generated is 10Hz which requires a 16,000 byte buffer
Cheers
Ian
Beta Was this translation helpful? Give feedback.
All reactions