Hi,
I want to start, reset and stop the timer in my program, and copy the TCNT0 value into a variable. My research tells me to start and stop the timer I just set the prescaler bits to my preferred setting to start, and clear the prescaler bits to stop the timer. I can restart the timer by doing TCNT0 = 0 ; Could someone please confirm that my below functions are correct?
void Start_Timer(){
TCCR1B = (1 << CS11);
}
void Stop_Timer(){
TCCR1B &= ~(1 << CS11);
}
void Reset_Timer(){
TCNT1 = 0;
}
Cheers..
I want to start, reset and stop the timer in my program, and copy the TCNT0 value into a variable. My research tells me to start and stop the timer I just set the prescaler bits to my preferred setting to start, and clear the prescaler bits to stop the timer. I can restart the timer by doing TCNT0 = 0 ; Could someone please confirm that my below functions are correct?
void Start_Timer(){
TCCR1B = (1 << CS11);
}
void Stop_Timer(){
TCCR1B &= ~(1 << CS11);
}
void Reset_Timer(){
TCNT1 = 0;
}
Cheers..