Hello guys. A simple routine to utilize interrupt of timer 0 every 444 uSec isnt working. Following is the code. Could anyone plz help with trouble shooting it as after hours of wasting time on it I couldnt find fault.
You still need to configure the global and device interrupts. Something like:
//***INTERRUPT ENABLING ***//
RCIE = 1; //Enable interrupt
PEIE = 1; //Enable device interrupt
GIE = 1; //Enable Global interrupt
//***Timer 1 initialization***// //To wait around 60 mSec before checking for the motor protection circuit
TMR1CS = 0; //Internal clock used for the timer FOSC/4
TMR1IE = 1; //Timer 1 Interrupt enabled
Also you need to start the timer:
TMR1L = 0xA0; //Init value for Counter
TMR1H = 0xEC; //Init value for Counter
TMR1ON = 1; //Start timer
As a matter of fact sir, i have enabled the interrupts and have to use timer 0 only because using a prescaler of 16 would give me the minimum timing error in the subsequent task upon the interruption.
Can somebody plz post a working C code of using timer 0 of pic 16f628 using a prescaler.