Author Topic: [AVR] max clock frequency  (Read 11990 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18220
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
[AVR] max clock frequency
« on: April 05, 2017, 11:59:02 am »
AVR's are rated to 20MHz but I see most applications using 16MHz, any particular reason ? Are they safe to run at 20MHz ?
 

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 7346
  • Country: ro
Re: [AVR] max clock frequency
« Reply #1 on: April 05, 2017, 12:03:06 pm »
As I remember them, old AVRs were 16 MHz. I am thinking here about chips like ATmega8...32.

Later edit:
As a curiosity, I overclocked an ATmega32P/5Vcc with a 20Mhz Q. It worked OK at the room temp.

If the catalog gives 20MHz, then it's safe to use them as 20MHz.
One more thing for AVRs datasheets, they sometimes specify 2 max freq, usually is 16MHz for 5Vcc and 8MHz for 3.3Vcc (if the chip can work at 3V, because some are 5V only)
« Last Edit: April 05, 2017, 12:09:24 pm by RoGeorge »
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: [AVR] max clock frequency
« Reply #2 on: April 05, 2017, 12:37:00 pm »
Probably because industry standard is usually 8 or 16 Mhz.  I have seen some other clocks used. However, the majority of the time is 8 or 16, probably because we tend to think 8 bits at time, so the numbers are just more convenient. In reality, if bumping from 16Mhz to 20Mhz makes or breaks your application, perhaps it would be time for an upgrade to a beefier MCU!
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18220
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [AVR] max clock frequency
« Reply #3 on: April 05, 2017, 01:17:57 pm »
16MHz is fine. I was thinking more on what it could translate into for PWM frequencies. And I'm just curious. I'm designing a generic board where as long as the footprint matches I'd alter the Cristal.

Sent from my phone so mind the autocorrect.

 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8551
  • Country: de
  • A qualified hobbyist ;)
Re: [AVR] max clock frequency
« Reply #4 on: April 05, 2017, 01:48:17 pm »
For anything timer based is quite simple: 8 to 16 MHz is a factor of 2, 8 to 20 is factor 2.5. and 16 to 20 is 1.25. 20 MHz might be also interesting for the ADC, since the ADC clock's maximum is 200kHz for 10 bit resolution. With 8 or 16MHz you'd set the ADC's prescaler for 125kHz (next higher clock would be 250kHz). But for 20 MHz it's 156.250 kHz. The  drawbacks are higher power consumption and some #ifdef fun, if you're going to support different clock rates. I haven't seen any problems with running ATmegas at 20 MHz.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18220
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [AVR] max clock frequency
« Reply #5 on: April 05, 2017, 05:30:43 pm »
Well I tend to declare my clock speed once and base everything off that. Power consumption is not an issue as it's not a battery application and the devices I am controlling are many hundreds of times the power my unit uses. I might actually be able to get a better PWM clock ratio, currently I am at 122Hz but I'd prefer a bit higher.
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: [AVR] max clock frequency
« Reply #6 on: April 05, 2017, 07:40:13 pm »
Here is the avrfreaks topic about avr8 core.
 

Offline obiwanjacobi

  • Super Contributor
  • ***
  • Posts: 1023
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: [AVR] max clock frequency
« Reply #7 on: April 06, 2017, 05:24:53 am »
I have an ATmega1284P running at 20MHz and its totally fine.
I am not using ADC and its not on batteries.

I did learn to check third party sources for hardcoded F-CPU defines...  ;D

[2c]
Wrong code should not compile!
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18220
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [AVR] max clock frequency
« Reply #8 on: April 06, 2017, 06:36:01 am »
Here is the avrfreaks topic about avr8 core.

I don't see the relevance, that is about 8 bit versus 32 bit and technology costs. I'm just looking at the real frequencies an AVR can work at as the datssheet says. For example the arduino runs at 20MHz and that is bogged down in stuff and could do with all the speed it needs.
 

Offline FreddyVictor

  • Regular Contributor
  • *
  • Posts: 164
  • Country: gb
Re: [AVR] max clock frequency
« Reply #9 on: April 06, 2017, 07:19:49 am »
I'm just looking at the real frequencies an AVR can work at as the datssheet says. For example the arduino runs at 20MHz and that is bogged down in stuff and could do with all the speed it needs.

Ofcourse you meant 16MHz for Arduino  ;)

The datasheet claims 20MHz max speed (note voltage must be 5v), so unlikely to be a problem at this speed
I played around with ATXmega (32MHz max) for a while and ended up using an overclock to 40MHz with no issues

need more speed ? then best abandon ATmega and move over to STM32F4 (or even F3)
they have lots of 5v tolerant pins so no real problem there
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
Re: [AVR] max clock frequency
« Reply #10 on: April 06, 2017, 10:08:09 am »
The atmega8 used on the original Arduino has a max clock speed of 16MHz, so that's what it ran at.  When they started using 20MHz capable cpus like the atmega168, leaving the clock at only 16MHz avoided a lot of software effort.

 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18220
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [AVR] max clock frequency
« Reply #11 on: April 06, 2017, 11:45:55 am »
hm, the datasheet only specified capacitors for up to 16Mhz
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2830
  • Country: us
Re: [AVR] max clock frequency
« Reply #12 on: April 06, 2017, 12:04:16 pm »
The ratings vary from part to part.  I seem to recall there are still some ATTiny parts that are only rated to 12MHz.  Also be sure to check the frequency vs voltage tables for your particular part; the headline clock frequency typically only applies at the top end of the operating voltage range. 
 
The following users thanked this post: Someone

Offline Svuppe

  • Regular Contributor
  • *
  • Posts: 100
  • Country: dk
Re: [AVR] max clock frequency
« Reply #13 on: April 08, 2017, 02:24:50 pm »
16MHz is fine. I was thinking more on what it could translate into for PWM frequencies.
There are some AVR's that have a built-in PLL. Not that the processor run any faster, but a timer or two can, thus permitting higher resolution PWM.
ATmega32U4 is one of those capable of high-speed timers (up to 64 MHz), Tiny26 is another, and the rest I can't remember.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 18220
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: [AVR] max clock frequency
« Reply #14 on: April 08, 2017, 02:26:42 pm »
The tiny 25, 45, 85 can do that too but I don't need that sort of speed.
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2107
  • Country: dk
Re: [AVR] max clock frequency
« Reply #15 on: April 08, 2017, 02:35:15 pm »
Afaik the new "mega's" lost their "high voltage swing" , and they're limited to 16MHz again (not 20)

I think the M328PB  , was one of the new ones

/Bingo
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8551
  • Country: de
  • A qualified hobbyist ;)
Re: [AVR] max clock frequency
« Reply #16 on: April 08, 2017, 02:43:10 pm »
Just checked ( http://www.microchip.com/wwwproducts/en/ATmega328PB ). ATmega328PB is still up to 20MHz. But Microchip can't decide if it got 2kB or just 2 Bytes of RAM :-DD
 

Offline bingo600

  • Super Contributor
  • ***
  • Posts: 2107
  • Country: dk
Re: [AVR] max clock frequency
« Reply #17 on: April 08, 2017, 02:58:50 pm »
Just checked ( http://www.microchip.com/wwwproducts/en/ATmega328PB ). ATmega328PB is still up to 20MHz. But Microchip can't decide if it got 2kB or just 2 Bytes of RAM :-DD
:-DD     . They must have thought it was a PIC  :scared:

But have a look here
https://hackaday.com/2016/05/03/atmel-removes-full-swing-crystal-oscillator/

And
http://www.atmel.com/Images/Atmel-42559-Differences-between-ATmega328P-and-ATmega328PB_ApplicationNote_AT15007.pdf


/Bingo
« Last Edit: April 08, 2017, 03:03:10 pm by bingo600 »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8551
  • Country: de
  • A qualified hobbyist ;)
Re: [AVR] max clock frequency
« Reply #18 on: April 08, 2017, 03:21:39 pm »
That's interesting! Thanks for the hint!
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3508
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: [AVR] max clock frequency
« Reply #19 on: April 14, 2017, 12:10:11 am »
I have an ATmega1284P running at 20MHz and its totally fine.
I am not using ADC and its not on batteries.

I did learn to check third party sources for hardcoded F-CPU defines...  ;D

[2c]
ATmega32-PU @50MHz w/5.3V power rail and no heat sink. NBD.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4413
  • Country: us
Re: [AVR] max clock frequency
« Reply #20 on: April 14, 2017, 08:45:02 am »
Quote
ATmega328PB is still up to 20MHz.
the CPU is still rated to 20MHz, but the crystal oscillators have been down-speced to only work up to 16MHz.   (Which is really annoying, given that most external oscillators will more than double current consumption.)  YMMV, since there's a lot more variance to crystals than most people pay attention to.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf