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