Interrupts in Arduino Due
-
I require my Arduino Due to be able to plot a square wave with a predetermined duty cycle and time period, without the use of delay() or millis() or any such function that keeps the processor idle unnecessarily. Hence, I've decided to go for interrupts and found a lot of resources on implementing it on the Uno, but none for the Due.
Can someone shed light on how I can set up an interrupt ( I guess two will be required here) from the inbuilt timers in the Due?
-
Hi @SuperGops , All the digital pins of Arduino Due are capable of interrupts, and since you are using the Arduino framework everything is the same as Arduino Uno.
more resource:
-
@salmanfaris Thanks! I'll definitely have a look at these!
-
@SuperGops You can use a Timer interrupts or run interrupts via watchdog timer.
-
@SuperGops When you want to create a PWM signal, why don't you just use
analogWrite(dutycycle)
to just create your PWM? Is there any specific reason you are going for interrupts?