"No need for an external oscillator" ATMEGA4809

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

I'm sure this has been discussed many times, but I just cannot find a clear answer. The USART section of the ATMEGA4809 datasheet says "No need for an external oscillator". Any thoughts as to what they mean by that?

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

They have improved calibration of internal RC (compared to traditional tiny/mega) 

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

UART requires that the oscillators at each end of the serial link be within about 2% of each other. The internal oscillator in the 4809 now meets that standard. It does so from factory calibration and built-in temperature correction.

 

Jim

 

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

 

 

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

Factory calibration within 2%? Where does it say that? I see "Full operation range" +-4%.

 

(I see they say "No need for an external oscillator" in the XMEGA datasheets too (ATxmega64A4U, for example). I guess I didn't notice that before.)

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

ezharkov wrote:
Any thoughts as to what they mean by that?
hardware auto-baud

Auto-Baud | USART | ATmega4808/4809 Data Sheet

 


AN976: CP2101/2/3/4/9 to CP2102N Porting Guide | Silicon Labs (search for 'line break' or 'break condition')

Pololu - CP2102N USB-to-Serial Adapter Carrier

Trying out the WCH CH9102F in place of a CP2102N - YouTube (55s)

PIC18(L)F2X45K50 Data Sheet

[page 48]

3.15 Active Clock Tuning (ACT) Module

[page 275]

17.4.1 AUTO-BAUD DETECT

[page 276]

17.4.2 AUTO-BAUD OVERFLOW

p-star-examples/usb-to-serial.X at master · pololu/p-star-examples · GitHub

 

"Dare to be naïve." - Buckminster Fuller

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

I thought that perhaps they meant auto-baud. But that is not something that the micro can do on its own. It needs help from outside.

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

 

 

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

Confusing as always. Also, only [0,70]C range.

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

"Dare to be naïve." - Buckminster Fuller

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

ezharkov wrote:

Confusing as always. Also, only [0,70]C range.

and [1.8, 3.6]V

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

In most cases, it should work fine from the factory.  The issue is that it really isn't all that robust under all conditions or degradations---you can use up all of the margin until on the cusp of not working.  For example, logic levels might have solid margin, if you want to trip at 2.6V, you will supply not 2.608V, but 3.2V so you have 0.6V margin.  Or maybe even supply 3.5V for more reserve against degradation.   If you drive away until a radio station is just barely turning into static, your margin has been used up; you've reached the edge where the error rate is beginning to climb rapidly.  

 

So compared to the original AVR clock accuracy for UART, they have gone from often fails to an improved often works

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

Last Edited: Fri. Jul 29, 2022 - 05:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

" [1.8, 3.6]V" - yes, interesting, I didn't catch that. Perhaps they just copied this from an XMEGA datasheet.

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

ezharkov wrote:

" [1.8, 3.6]V" - yes, interesting, I didn't catch that. Perhaps they just copied this from an XMEGA datasheet.

They also give some numbers for [1.8, 5.5]V, FWIW.

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

It seems pretty straightforward.

USART is accurate enough with internal RC.

If your application requires 20ppm accuracy you use an external clock.

 

An external clock takes about the same amount of pcb real estate as XTAL + 2 caps but costs more.

Ceramic resonators always seem pointless.  i.e. uses pins and pcb space with much less accuracy.

 

The no-XTAL policy seems very sensible for low pin-count Tinys.

It seems a false economy on a 48-pin chip.

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

How "USART is accurate enough with internal RC" if "Full operation range" is +-4%?

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

Because you can calibrate yourself and compensate for temperature and voltage to improve on the factory.

 

Seriously.  How many USART apps are going to be running at full extremes of temperature and voltage?

And you can always use an external clock module.

 

I fully understand the "accuracy" argument when you are designing a guided missile.

Just be "appropriate".

 

David.

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

Since the avr0/1/etc has a fractional baud rate generator, it also means you can tweak the baud register in relatively small increments (the fractional part, 6bits). There is also oscerr values in sigrow that can be used to correct for the error in the factory calibrated speeds (they calibrated speed at factory, then tell you the error that remains). So with the fractional generator capability, applying the sigrow error value can get you a little closer (spelled out in the datasheet CLKCTRL section). 

 

You also have the option of tweaking the baud register on the fly (framing errors start appearing, tweak the baud register to get you back on track), or if you know what data is coming in the uart you can measure bit times and adjust the baud register, or measure bit times and use the lowest value (a single bit) to determine the baud register value needed, and so on. The fractional generator is a big improvement, and I would take it over a crystal any day if that was the choice (assuming the internal clock was decent).

 

 

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

Yup, I think you are supposed to combine an external 32kHz crystal, calibration and fractional baud rate to create a software calibration routine for the UART, that you run from time to time to keep things in spec.

 

Also, there is a very precise and stable external 32kHz clock chip that Freak @kabasan likes to use let me see...

https://www.avrfreaks.net/comment/2973596#comment-2973596

 

Or just use an external clock as suggested in #14

 

 

 

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

ezharkov wrote:

How "USART is accurate enough with internal RC" if "Full operation range" is +-4%?

 

Fair point, that looks to mean it is ok for commercial use with internally calibrated, but full temp range would need a better clock source.

 

Interesting the two specs, they claim 1.8% from a calibrate set-point, but a worse value for absolute accuracy.

I think that is because the calibrate itself has granularity,  usually some portion of 1% step size, which means you cannot quite centre on the ideal frequency.

 

 

ezharkov wrote:

I thought that perhaps they meant auto-baud. But that is not something that the micro can do on its own. It needs help from outside.

 

Yes, full Autobaud needs both ends to agree on what are the Autobaud rules.  

 

You can do an intermediate Baud trim tho, if you know you are close to correct, you can capture some timing from the RX CHARS to check the Osc error and add a correction if you need to.

 

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

Who-me wrote:
you can capture some timing from the RX CHARS to check the Osc error and add a correction if you need to.
AVR054 is software auto-baud.

AN2563 AVR054: Run-time calibration of the internal RC oscillator via the UART | Application Note | Microchip Technology

AVR054.zip | Wayback Machine

[PDF, page 9, bottom]

If the application must handle large variations in temperature and supply voltage, but operates in constant conditions most of the time, the Repeated frame synchronization can be a good alternative. ...

A framing error causes a frame sync or for each delta T (temperature) frame sync.

 

"Dare to be naïve." - Buckminster Fuller