Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
The fastest output from a timer is to have it toggle an output pin. On the ATmega16, Timer 2 is an 8 bit timer, and would be a good choice.
Referring to the ATmega16 datasheet:
Set the OC2 pin as an output.
Set the Timer 2 control registers to:
Set Timer2 to toggle OC2 on compare match.
Set the timer2 to CTC mode.
Set the Timer2 prescale to no prescaling.
Set the output compare register, OCR2, to 1, for maximum frequency, to see if it is equal to or greater than 1 megahertz.
Adjust the OCR2 value as needed.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.