Running UART on Internal RC osc. Frequency

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

Hello friends,

I am planning to use ATMEGA324P in my application.
I need to use UART(9600 baud rate) for communication with PC.

1. Is it possible to run UART(baud rate 9600) on internal RC oscillator freq?

2. How to calculate the best calibration value to fit 8 MHz freq with an accuracy of +/- 1%?

3. What should the settling time value?

4. Which peripheral interface ( spi,i2c,adc, etc) of ATMEGA324P would compulsorily require external crystal as clock source?

Thanks in Advance.

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

None of the peripheral interfaces you mention in (4) need precision timing. But, asynchronous serial (ie, UART) does.

You can probably calibrate the RC oscillator to be close enough at one temperature. Your calibration will NOT be the same as others because of the low accuracy. It will also not be accurate at other temperatures or supply voltages, even if previously calibrated.

At the very least, use on of the low cost ceramic resonators that is calibrated to 1%. They cost perhaps 1/2 of what a good crystal costs and can include all the capacitors.

Jim

 

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

 

 

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

Yes you CAN use the internal osc for the uart, but you may constantly have to fiddle with the UART baudrate control values...So if you need to use it only for a few minutes here or there, it might be "ok", but for any long-term use, you need to use an external clocking source of some type.

You might write an autobaud routine to keep bringing it back in line & "retuning" it using some protocol....but an external resonator is only 20-75 cents, so why bother?

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

The ATMEL application notes page:
http://www.atmel.com/dyn/product...
has information on some different methods of RC oscillator calibration.

AVR053: Calibration of the internal RC oscillator:
http://www.atmel.com/dyn/resourc...
http://www.atmel.com/dyn/resourc...

AVR054: Run-time calibration of the internal RC oscillator:
http://www.atmel.com/dyn/resourc...
http://www.atmel.com/dyn/resourc...

AVR055: Using a 32kHz XTAL for run-time calibration of the internal RC:
http://www.atmel.com/dyn/resourc...
http://www.atmel.com/dyn/resourc...

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

... an external resonator is only 20-75 cents, so why bother?

Thanks !!!
I will use external crystal oscillator.

I heard that external crystal sometimes fail after vibration tests so I thought of using internal rc. No issues with cost.

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

If crystals fail after vibration tests, use a ceramic resonator then. If I recall, they withstand larger shocks.

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

This is a risc design. This is no because you cannot get good results in practice, but because RC circuits are not stable while voltage or temperature is changing.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer