Arduino Due PWM Interrupt

Hi

I did some more testing today, and still haven't found what I'm looking for. I've attached my files. I know the classes are not that good and a lot of stuff can be updated, but I'm using this to keep it simple and I can always add more configuration later.

I can create a timer interrupt, I can create a PWM signal with variable duty cycle but I can't create a pwm interrupt.

I've created a PWM signal with method 2 (mode 1) and enabled the compare interrupt in IER2 but the PWM_handler doesn't get called.

In this simple program I have a PWM signal with frequency 15kHz and duty cycle 80%. What I want is an interrupt on the rising and falling edge of the PWM signal (atm I'm flipping a pin to check my code with an oscilloscope, in the end 2 pins should switch to their correct output). But PWM_handler doesn't get called.

What am I doing wrong? Thanks

DuePin.cpp (854 Bytes)

DuePin.h (385 Bytes)

DuePWM.cpp (2.93 KB)

DuePWM.h (445 Bytes)

DueTimer.cpp (2.12 KB)

DueTimer.h (395 Bytes)

main.cpp (633 Bytes)