As for interrupts, I realize that's ultimately the way to go but I'm currently using all six PWM channels so with an interrupt I'd lose two of them.
The events being detected are beats in music, so events are about several milliseconds long and several hundreds of milliseconds apart.
while ( (PINB & _BV(PINB0)) == 0 );
42: b0 9b sbis 0x16, 0 ; 22 44: fe cf rjmp .-4 ; 0x42 <loop>
I'm using a while loop function to look for an event and am wondering if some of the loop functions (if, for, switch case, while) execute faster than others...
As for the PWM outputs, they use interrupts, and if I designate an interrupt for my own use I have to give up one of the PWM pin pairs, correct?
Do the external interrupts intefere with the ability to do PWM, in the same way that timer interrupts do ?
> How is a beat presented to the processor? Digital input goes HIGH?Using an analog input "above threshold" from a hardware peak detector with some software debounce.
As for the PWM outputs, they use interrupts, ...
...and if I designate an interrupt for my own use I have to give up one of the PWM pin pairs, correct?
> They (looping functions) are all at least one order of magnitude faster then you will need."If I start nesting loops and performing operations in the loops, I am concerned I'll start missing beat triggers, ...
...but the operations (counting, comparing, etc) are likely much slower than the loop functions so I shouldn't be concerned about looping time. Beats typically are at least 400msec apart so should be plenty of time between them.
Both can be triggered on RISING or FALLING signal edges, correct? Is there any other significant difference between these two kinds of interrupts?
Can I generate an interrupt on an analog input from an analog level?