I've been digging through the datasheet and PDFs and things and the PIO stuff seems really neat!
Initially I was going to use them as timers, and in reading through the docs, I think that's still the right option?
I basically want to update a multi-channel parallel DAC at specific times (these end up being output sample rates) where the timer controls the update rate of each DAC channel. When the timer expires, I'd like it to throw an IRQ to an ISR which would do something like:
Increment a counter
Get the value from an array to send to the DAC
Concatenate that together with the channel number (channel # + data, 3-bits + 8-bits)
Send these 11-bits out a configured GPIO PORT
Blip the DAC write pin to load the value into the DAC output for that channel
I'll be controlling the timer speeds as well but I think I can do this outside the ISR and may only want to do this once the timer has completed cycling through one run through the array.
I don't think a PIO can do all this by itself, particularly if I want 8 timers given the instruction limits. Instead I was thinking the PIO might just fire an interrupt (unblocked) and I might be able to improve speed using DMA maybe.
Curious if anyone has done something like this and might have suggestions? Having separate timers means I should be able to get some nice precision and that would be ideal vs using a global timer and setting different counters.
Initially I was going to use them as timers, and in reading through the docs, I think that's still the right option?
I basically want to update a multi-channel parallel DAC at specific times (these end up being output sample rates) where the timer controls the update rate of each DAC channel. When the timer expires, I'd like it to throw an IRQ to an ISR which would do something like:
Increment a counter
Get the value from an array to send to the DAC
Concatenate that together with the channel number (channel # + data, 3-bits + 8-bits)
Send these 11-bits out a configured GPIO PORT
Blip the DAC write pin to load the value into the DAC output for that channel
I'll be controlling the timer speeds as well but I think I can do this outside the ISR and may only want to do this once the timer has completed cycling through one run through the array.
I don't think a PIO can do all this by itself, particularly if I want 8 timers given the instruction limits. Instead I was thinking the PIO might just fire an interrupt (unblocked) and I might be able to improve speed using DMA maybe.
Curious if anyone has done something like this and might have suggestions? Having separate timers means I should be able to get some nice precision and that would be ideal vs using a global timer and setting different counters.
Statistics: Posted by m00dawg — Sat Nov 22, 2025 12:45 am — Replies 2 — Views 109