How to clock/not to clock...XMEGA/ARM

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

I have been 'experimenting' with XMEGA and SAMD21 chips off and on recently in anticipation for some possible future projects coming up.  The learning curve is pretty steep, but I am plucking away at it with pretty good success.

 

Heres the rub....I have been looking at the clocks for both chips and they share a lot of similarities.  Being COMPLICATED in my opinion is one of them, but more importantly their accuracy over temperature/voltage.  The voltage is not so important to me as the supplies are well regulated 3v3, but the temperature is another thing as these devices are going to be in very wide temperature environments. 

 

I was wondering if anyone is using JUST the internal oscillator for their designs with USART comms, or do you stick with the tried, and proven Crystal oscillator?

 

I m not concerned about the cost of a $0.10 crystal.  I am more interested in user experience/feedback.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

I put a crystal on most of my xmega projects because I want them to have a pretty accurate sense of time. I like that the clock is selected by code, not fuses, so getting something wrong just stops the processor till you load a correct program. I haven't used a uart since CP/M or early DOS days.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

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

Torby wrote:
I haven't used a uart since CP/M or early DOS days.

 

NONE of your AVR projects have ever communicated over a USART Tom?

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

jgmdesign wrote:
I m not concerned about the cost of a $0.10 crystal.
Is an order of magnitude greater price acceptable?

Reason : 32KHz MEMS oscillators, max current half that of XMEGA128A1U internal 32KHz RC oscillator

22ppm max over -40C..85C (105C abs max) :

ASTMTXK via Abracon Products (MEMS, KHz, SMD)

jgmdesign wrote:
I am more interested in user experience/feedback.
Questions?

Typical bauds?

Reasons :

  • USART FBRG (16b precision)
  • XMEGA baud error less than 1% (given calibrated 32MHz RC oscillator)

 

Maximum current consumption?

Reasons :

  • MEMS MHz oscillators
  • Calibrated XMEGA 32MHz internal RC oscillator is relatively efficient, precise (dF steps), and accurate

 

Is another frequency reference available?

Reasons :

  • USB SOF
  • UART SOF
  • UART BREAK and SYNC

 


Microchip is in MEMS oscillators at approx 1mA though with a standby mode :

DSC6000B - Clock and Timing - Oscillators

DSC6083CI2A-032K768 Microchip Technology | Mouser

 

ATxmega128A1U - 8-bit AVR Microcontrollers

 

AN_2563 AVR054: Run-time calibration of the internal RC oscillator via the UART via ATmega324PB - 8-bit PIC Microcontrollers

 

note : FBRG is also in megaAVR 0-series with the addition of auto-baud (BREAK, SYNC, data)

 

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

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

gchapman wrote:

Is an order of magnitude greater price acceptable?

Yes.

 

gchapman wrote:
Calibrated XMEGA 32MHz internal RC oscillator is relatively efficient, precise (dF steps), and accurate

Efficient yes, stable and accurate?  Not sure, hence why I am asking if there are Freaks out there using Both XMEGA and SAM with USARTS and what clocking method they use.

 

gchapman wrote:
Is another frequency reference available?

No.  Micro is its own source of clock.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

I'm using XMega32E5 on a few projects that use UART and I've always used the internal clocks. I've never had any issues thus far knock on wood. I've used it to communicate messages with the Nordic NRF83252 and Cypress CYBLE202007(deciding on BLE module), and I'm working on a project currently with single wire UART to a TMC5130. There are some good ASF example projects for xmega as well to help you sort through the weeds if you get stuck. Hope this helps.

Cheers,
Jesse_G an EE writing firmware...what could go wrong...

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

Jesse_G_EE wrote:
I'm using XMega32E5 on a few projects that use UART and I've always used the internal clocks. I've never had any issues thus far knock on wood.

 

What are your baud rates may I ask?  And what is the temperature average where the parts are?

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

jgmdesign wrote:

 

What are your baud rates may I ask?  And what is the temperature average where the parts are?

 

Jim

 

The project with the BLE was 2400(another story as to why it was so low...Zilog sucks) and they were up in commercial light fixtures, so anywhere from 0C to 85C. A few of them were stuck in 300W LED outdoor fixtures in Texas specifically for temperature throttling the current  at 70C, but I know in test they saw 85C without any issues. These parts are on average operating at 45C-50C as LED fixtures are hot pretty much anytime they are on.  The single wire UART I'm currently working on is 115200 and the temps are mundane @ 20C to 65C. This project revolves around a hydraulic lift valve so hydraulic oil gets to runny past 65C but the average temp is 32C-37C.

Cheers,
Jesse_G an EE writing firmware...what could go wrong...

Last Edited: Tue. Sep 3, 2019 - 04:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jesse_G_EE wrote:
NRF83252
nRF52832 - Bluetooth low energy System-on-Chip - nordicsemi.com

Apparently 16b for its baud rate register :

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52832.html&cp=3_1

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Fuarte.html&cp=3_1_0_34_9_10&anchor=register.BAUDRATE

Jesse_G_EE wrote:
... and I'm working on a project currently with single wire UART to a TMC5130.
SYNC, data

https://www.trinamic.com/_scripts/download.php?file=_articles%2Fproducts%2Fintegrated-circuits%2Ftmc5130%2F_datasheet%2FTMC5130_datasheet.pdf

TRINAMIC Motion Control GmbH & Co. KG

Hamburg, Germany

TMC5130A-TA DATASHEET

Universal high voltage controller/driver for two-phase bipolar stepper motor. stealthChop™ for quiet movement. Integrated MOSFETs for up to 2 A motor current per coil. With Step/Dir Interface and SPI.

[page 7]

1.2.2 UART Interface

The single wire interface allows differential operation similar to RS485 (using SWIOP and SWION) or single wire interfacing (leaving open SWION). It can be driven by any standard UART. No baud rate configuration is required.

 

edit : strikethru

 

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

Last Edited: Tue. Sep 3, 2019 - 04:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good information, thanks all!!!

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

jgmdesign wrote:

Torby wrote:
I haven't used a uart since CP/M or early DOS days.

 

NONE of your AVR projects have ever communicated over a USART Tom?

 

Jim

 

Nope!

 

Picked my first AVR chip to play with because it had a uart, but never used it!

 

I have used it in arduino projects, but that does not quite count as I only used it to communicate to the terminal built into the arduino ide.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

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

Jesse_G_EE wrote:

jgmdesign wrote:

 

What are your baud rates may I ask?  And what is the temperature average where the parts are?

 

Jim

 

The project with the BLE was 2400(another story as to why it was so low...Zilog sucks) and they were up in commercial light fixtures, so anywhere from 0C to 85C. A few of them were stuck in 300W LED outdoor fixtures in Texas specifically for temperature throttling the current  at 70C, but I know in test they saw 85C without any issues. These parts are on average operating at 45C-50C as LED fixtures are hot pretty much anytime they are on.  The single wire UART I'm currently working on is 115200 and the temps are mundane @ 20C to 65C. This project revolves around a hydraulic lift valve so hydraulic oil gets to runny past 65C but the average temp is 32C-37C.

 

Hmm. That's impressive.

The largest known prime number: 282589933-1

It's easy to stop breaking the 10th commandment! Break the 8th instead. 

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

My impression is that "lots of people" run normal AVRs off their internal oscillator and still do serial coms "just fine", and that accuracy of the new ARM/XMega oscillators is better than those...

 

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

Indeed, I think that is the case (that "plenty" of folks use the internal oscillator for async serial communication). However, that does not change the fact that they are rolling the dice every time. I wonder what percentage of their thingies are non-functional?

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Using the worst case specs gives the answer. Clearly the 10% spec for the old AVRs rule them out.
If the worst case specs show the solution as borderline, then add a crystal or mitigate the problem. LIN protocol is one solution. It addresses cost, size, vibration and temperature range.

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

Unless physical dimensions are an issue why would you gamble for the sake of a $0.10 crystal?

 

(well, OK, if you are building 2,000,000 I guess it starts to be an issue ;-)

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

clawson wrote:

Unless physical dimensions are an issue why would you gamble for the sake of a $0.10 crystal?

 

(well, OK, if you are building 2,000,000 I guess it starts to be an issue ;-)

Just asking for my own curiosity Cliff. The potential punter is not concerned about cost at all.

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user