Go Down

Topic: is it possible to generate 16mhz output in atmega 328? (Read 178 times) previous topic - next topic

nitro007

Hello,

i am reading the datasheet of at mega and in the section of the timer 1 i saw this formula:

so i supposed that is possible to generate 16mhz output using the fast PWM mode.

but i couldn't do it, the only thing i did was to use the CTC mode to generate 8MHZ.
so i wan't to know if the 16mhz is possible.

thanks

obs: the image is uploaded because i couldn´t embbed it here , don't know why.

westfw

Datasheet says ("Fast PWM" section of Timer2 description):
Quote
The waveform generated will have a maximum frequency of foc2 = fclkI/O / 2 when OCR2A is set to zero.

nitro007

I'm talking about the timer 1, check the section 16.9.3
There it says
" The PWM frequency for the output can be calculated by the following equation:
 fOCnxPWM = fclk_I/O / (N * (1 +Top))

horace


westfw

Timer1 works essentially the same.   Immediately below the formula you posted, it goes on to say:

Quote
The waveform generated will have a maximum frequency of fOC1A = fclk_I/O/2 when OCR1A is set to zero (0x0000).

6v6gt

If you want simply a 16MHz output from a 16MHz clocked AVR you can use the fuse CKOUT and get the output on PORTB.

The description is here.

Go Up