Ben
Well-known member
Hi,
some of you may have noticed Frank B and me are working on a new output object for the Audio library to use the very cheap DAC PT8211 (here). This DAC has not digital output filtering, so we are experimenting with 4x oversampling and various interpolation methods (Linear, CIC, FIR) to get away fith a low order analog filter. As the (digital) filter is calculated inside the ::isr(void) function, I'd like to monitor how much CPU time it uses to do the calculations.
I tried adding digitalWriteFast(LED_BUILTIN, HIGH); and digitalWriteFast(LED_BUILTIN, LOW); at the beginning and end of the ISR respectively, but that has no effect on pin 13. (I also tried with hard-coded pin 0). I assume I can't use digitalWriteFast in the ISR? I also tried to use the AudioProcessorUsage(); and AudioProcessorUsageMax(); functions, but they don't seem to work with output object ISRs
(TL;DR) How can I measure the time the Teensy needs to complete each void AudioOutputI2S::isr(void) ( or, in my case, AudioOutputPT8211::isr(void) ) call? I'd be happy with Serial messages or anything an oscilloscope can pick up...
Thanks for your help!
-Ben
some of you may have noticed Frank B and me are working on a new output object for the Audio library to use the very cheap DAC PT8211 (here). This DAC has not digital output filtering, so we are experimenting with 4x oversampling and various interpolation methods (Linear, CIC, FIR) to get away fith a low order analog filter. As the (digital) filter is calculated inside the ::isr(void) function, I'd like to monitor how much CPU time it uses to do the calculations.
I tried adding digitalWriteFast(LED_BUILTIN, HIGH); and digitalWriteFast(LED_BUILTIN, LOW); at the beginning and end of the ISR respectively, but that has no effect on pin 13. (I also tried with hard-coded pin 0). I assume I can't use digitalWriteFast in the ISR? I also tried to use the AudioProcessorUsage(); and AudioProcessorUsageMax(); functions, but they don't seem to work with output object ISRs
(TL;DR) How can I measure the time the Teensy needs to complete each void AudioOutputI2S::isr(void) ( or, in my case, AudioOutputPT8211::isr(void) ) call? I'd be happy with Serial messages or anything an oscilloscope can pick up...
Thanks for your help!
-Ben