Guest User

Untitled

a guest
Jan 23rd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1.     PRR&=~(1<<PRTIM2); // write power reduction register to zero
  2.     TIMSK2=(1<<OCIE2A); // compare match on OCR2A
  3.     TCNT2=0;  // init counter
  4.     OCR2A=29; // value to compare against
  5.     TCCR2A=(1<<WGM21)|(0<<WGM20); // do not change any output pin, clear at compare match
  6.     TCCR2B=(0<<WGM22)|(1<<CS22)|(1<<CS21)|(1<<CS20); // clock divider, start counter
Add Comment
Please, Sign In to add comment