Page 1 of 1

Timer1 Question

Posted: Mon Jul 21, 2014 8:55 pm
by danlee58
I am running a SuperPro. the code is written in 'C'. I use Timer1 to capture a generate an interrupt.

Can I set a match value so it will generate an interrupt as a watchdog, if Timer1 goes beyond a certain count?

T1_PR = 0; //Set Prescale Register so TC will increment at the full clock rate
T1_CTCR = 0; //Set Timer Mode & Select CAPn.0 for Capture pin
T1_CCR = 5; //Set Capture Control Register for rising edge and generate Interrupt
T1_TCR = 2; //Reset Timer 1
T1_TCR = 1; //Enable Timer 1

Re: Timer1 Question

Posted: Mon Jul 21, 2014 10:47 pm
by basicchip
You are setting TIMER1 to interrupt on a CAPTURE event, so you can't use the same timer to generate a TIMER interrupt. There are 3 other timers.

Or why not just use the WDT, it can generate an interrupt or can generate a RESET on timeout?