## about using internal rc oscillator and vcc

16 posts / 0 new
Author
Message

Hello,I am using attiny84a mcu.
-I want to using internal rc oscillator.I haven't done any calibration with oscal register.So,How many volts at least can I use Vcc? 2.7volts or 3 volts?
-What happens if I use 1.8 volts?My crystal speed drops?
I studied the datasheet but I could not fully understand it.
Note:Slight variations in the 8 mhz crystal speed are not important to me.for example it can be 7.9 mhz,7.5mhz.If so, how many mhz would the speed drop?

It is shown here.

Also this on page 237:

... and this on page 238:

Note that these graphs only represent a typical device.  There will be process variations from device to device.

 "Experience is what enables you to recognise a mistake the second time you make it." "Good judgement comes from experience.  Experience comes from bad judgement." "Wisdom is always wont to arrive late, and to be a little approximate on first possession." "When you hear hoofbeats, think horses, not unicorns." "Fast.  Cheap.  Good.  Pick two." "We see a lot of arses on handlebars around here." - [J Ekdahl]

I haven't done any calibration with oscal register.

Why would you calibrate it, if you don't need high accuracy?  Just fire up the AVRand use it, it will  be "close" to 8 MHz  (or 1 MHz if the div 8 fuse is set)

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

In this graph, the frequency is 4 Mhz when vcc = 1.8 Volt, but in the other reply in this topic the crystal speed is approximately 7.8Mhz when Vcc = 1.8 Volt. @25°C which one is right?by the way, I use rc internal oscillator, not external oscillator.

Are these graphs valid for both a "Factory Calibration oscillator" and a User "Calibration oscillator"?

i don't want to calibrate but i was wondering how the crystal velocity changes (@Vcc=1.8 V and internal RC=8 Mhz and div 8 fuse=unprogrammed [no div 8])

The graphs show the typical RC functioning @ 1.8V and 25C

Fig 20-1 advises maximum CPU speed i.e. 4MHz @ 1.8V

RC oscillator can (and should) operate at a wide range.

You should use a clock divider for CPU operation @ 1.8V  e.g. 7.8MHz / 2 to remain within spec.

David.

hrn97ta wrote:
In this graph, the frequency is 4 Mhz when vcc = 1.8 Volt, but in the other reply in this topic the crystal speed is approximately 7.8Mhz when Vcc = 1.8 Volt. @25Â°C which one is right?

Look again - the two graphs are showing two different things:

In #2, kabasan wrote:

In #3, joeymorin wrote:

So one is showing the speed at which the CPU can safely run; the other is showing the frequency that the oscillator is generating.

Top Tips:

1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

hrn97ta wrote:
how the crystal velocity changes

A crystal is vary stable device, but to find it's spec's you will need to contact the crystal manufacturer and get the specs for the exact xtal in question, you will not find that in the AVR's datasheet!

The internal RC oscillator in the AVR is documented in the datasheet.  Note the ATtiny84 has been superseded by the ATtiny841.

Jim

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

hrn97ta wrote:

-What happens if I use 1.8 volts?My crystal speed drops?

..

Note:Slight variations in the 8 mhz crystal speed are not important to me.for example it can be 7.9 mhz,7.5mhz. If so, how many mhz would the speed drop?

Yes, by the amount the graphs above show.

Note the important detail, that at 1,8V you cannot clock at 8MHz, that is outside spec, so you need to divide by 2.

This should be easy to test on the bench - set up a 4MHz sysclk, and toggle a pin, and vary Vcc measuring frequency

A little clarity is in order, here.

The internal oscillator of an AVR micro is an RC (resistor-capacitor) oscillator. It does not have a crystal.

A crystal oscillator requires an external crystal (and a pair of small capacitors) which YOU have to add.

A crystal oscillator can vary around 10 parts per million (ppm) with changes in temperature and power supply voltage. That is roughly equivalent to 80Hz for an 8MHz oscillator. An RC oscillator, on the other hand, might vary a few tenths of a percent (see the graphs, above). 1ppm is the same as 0.0001%

So, when you ask about "the crystal" changing, it is a bit of a nonsense question because there is no crystal in the internal oscillator.

Jim

Until Black Lives Matter, we do not have "All Lives Matter"!

Last Edited: Fri. Nov 20, 2020 - 12:13 AM

So,At Vcc = 1.8 Volts, how many mhz do I get when using internal rc oscillator?(no div8)
7.8 Mhz ?
4 Mhz?

You get 7.8MHz.    But use CLKPR register to divide by 2.   Giving an effective 3.9MHz.

David.

From the second chart in post #9, the frequency of the internal rc oscillator at 1.8V (and 25°C) is about 7.8MHz.

However, the CPU is not guaranteed to operate at that frequency, so you must apply at least a divide-by-2 to get the F_CPU below 4MHz as also indicated in the first figure of post #9.

David