Go Down

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

#### nitro007

##### May 21, 2018, 12:23 amLast Edit: May 21, 2018, 12:25 am by 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

#1
##### May 21, 2018, 01:12 am
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

#2
##### May 21, 2018, 05:20 am
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

#3
##### May 21, 2018, 07:14 am
it may be worth considering an Arduino Due

#### westfw

#4
##### May 21, 2018, 08:02 am
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

#5
##### May 21, 2018, 09:59 amLast Edit: May 21, 2018, 10:01 am by 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