Hi guys! I'm trying to use interrupts on my Arduino Due board.
I want to make PWM signals: then I have some synchronous channels and I want to update their duty cycle every counter cycle. The reference counter for carrier period is that of the #0 channel, as the datasheet says.
What I found in datasheet (pag 1002) is interesting: with update method 2, I can update duty cycle automatically at next period. I have to use PWM_CDTYUPDx to write the new duty cycle, that is applied at next period. Then I want to synchronize the calculation of the duty cycle with every start of the counter.
One possibility is to trigger an interrupt when every cycle starts and that interrupt should calculate the value of the new duty cycle (CDTYUPD) that is applied at next period. What I need is something basic for a PWM and it's made in this way in DSPs.
I saw that there are many flags (WRDY, CHIDx) that can be used to call an interrupt, but I don't know how to write an interrupt and call it with those flags. Can anyone help me?
Thanks!!!