Go Down

Topic: Trying (and failing) to set /32 prescaler (Read 300 times) previous topic - next topic

shobley

Jan 24, 2008, 05:20 am Last Edit: Jan 24, 2008, 05:49 am by shobley Reason: 1
I've been given this code to set the timer interrupt prescaler to /64, and it works OK...

 TCCR2B |=      (1<<CS22);                 // turn on  CS22 bit
 TCCR2B &=  ~((1<<CS21) | (1<<CS20));     // turn off CS21/0 bit

I tried to write code to set 0,1,1 to set the prescaler to /32 and it no longer works (timer does not fire) , can someone show me how to load the 0,1,1 values into the bits correctly?

Thanks,
Steve

Go Up