Hardware Timer Interrupts on the Due

Hello all,
I am working on porting some code from the Uno, and in it, it fires off a 1ms timer interrupt.
Clearly, the interrupts work different on the Due, but I can’t find good solid information on it.
Can anyone point me in the direction I need to go?

(Note: I’m running lots of code simultaneously, getting proper use out the the 84MHz I have to me, so it has to interrupt) :slight_smile:


const int delayPeriod = 42000000/1000; //42000000 is the "TCCLKS_TIMER_CLOCK1" clock speed / 1000 for 1ms

void setup() {
TC_SetRC(TC2, 2, delayPeriod);


TC_Start(TC2, 2);

void loop() {


void TC8_Handler()
TC_GetStatus(TC2, 2);

///// do something here


Hi there @SlaserX,

I have recently announced a library for using the TC modules (Timer Modules) channels of DUE's Atmel ATSAM3X8E micro-controller. You have the announce in this post:

The name of the library is tc_lib, and is available at: GitHub - antodom/tc_lib: This is a library to take advantage of different functionalities available on Timer Counter (TC) modules in Arduino Due's Atmel ATSAM3X8E microcontrollers

For doing what you want you have to use tc_lib action objects which abstract the use of ATSAM3X8E's TC module channels. Just have a look to the example action_test.ino that comes with the library.

If in any doubt, just tell me.
I hope it helps.