about using internal rc oscillator and vcc

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

Complete datasheet is here :http://ww1.microchip.com/downloads/en/DeviceDoc/doc8183.pdf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is shown here.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


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]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

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!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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])

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


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...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

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
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

What you seem to be missing is an understanding of the difference between the oscillator frequency and the CPU frequency.  The internal RC oscillator is temperature and voltage dependent, as shown in post #3.  The CPU will run at whatever frequency you have configured it to run at.  That configuration is controlled by the choice of system clock source (chosen by the CKSEL fuse bits, with the factory default selecting the internal RC oscillator), and the system clock divider (set via the CLKPR register).

 

It is possible to run the AVR from the internal RC oscillator at 1.8V with a system clock divider of 1.  This will lead to a CPU frequency of about 8 MHz (typically, closer to 7.8 MHz as shown in post #3), but it will not do so reliably.  That's what the graph in post #2 shows.  It is >>your<< responsibility to ensure that the CPU runs no faster than recommended by the manufacturer.  It will not automatically reduce its own speed based on voltage.

"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]