Timer1 Question

basically miscellaneous, if it doesn't fit another sub-forum enter it here, we might even promote it to its own sub-forum
Post Reply
danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Timer1 Question

Post 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



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Timer1 Question

Post 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?

Post Reply