SAM with internal resonator

Hey there!

I'm designing some PCBs for special use cases and I have to do something I'm not so experienced.
I need a relatively powerful MCU with the capability of running at its maximum clock speed with the following criterias:
-Has to use internal RC oscillator
-Needs to be able to work between 2-3.6V
-Has at least 4 timers, 2 of them needs to be 16 bit
-At least 48MHz clock speed
-At least the stated amount of serial peripherals:
-2 SPI
-1 I2C
-3 UART

edit: If possible, in a 48 or 64 pin package.

I need something that is Arduino compatible (for fast prototyping) and I'd love if it used UPDI, because I don't want to waste an SPI connection for ISP programming.
My plan is to use an external, compensated 32.768KHz clock for calibration, that would be connected to a timer and another timer that's running from the internal clock and comparing them from time to time. In case there is auto-calibration, I'd be more than happy.

I tought about some atmel SAM series chips but the officially supported ones don't seem to be able to run at their maximum speed from internal oscillator.

I hope there is something out there.
Looking forward to seeing your answers!

The arduino DUE (ARM Cortex M3) should be a good candidate. This board embeddes a Sam3x from Microchip.

  • There is an SPI peripheral with a single SPI but one of the 4 USARTs can be programmed in SPI mode (either Master or Slave)
  • 1 UART and 4 USARTs
  • 2 I2C
  • The default clock speed is 84 MHz
  • 3.3V compliant
  • Has internal oscillator. There is also an external 32.768 Hz oscillator but sometimes this crystal is not present on clone boards. Maybe you can replace this crystal with a temperature compensated oscillator.
  • A bunch of Timers, either TC or PWM

Sketches are uploaded thru the USB programming port or the Native USB port (USB 2.0) via the arduino IDE or Bossa.exe

Good tip!

Actually I was thinking about a more reasonably sized package like some 48 or 64 pin one (my bad, forgot to write it down originally, I’ll edit the original post).

I think ATSAMD51 meets all your requirements. I run it at 120MHz using the internal clock sources. It will even do 200MHz overclock if you wanted. There are 6 sercom ports for i2c, spi and serial, 4 TC timers and 3 TCC timers all are at least 16bits, two of the TCC timers are 24bit. TC timers can be paired to 32bits.

If you wanted you could use an external 32k crystal to drive the PLL and DFLL, I believe you are supposed to for more accurate timings, especially with USB, but it doesn't seem to bother adafruit and any of their 48pin SAMD51 boards, and it works for me too. The ULP 32K oscillator has trim bits, so you could probably do so manually like you describe.

It really sounds like my thing.

100MHz at 125°C - sounds good

I think it's not right for me as it needs an external crystal to run the PLL that generates the clock. Or maybe it can run from the internal 32.768kHz oscillator but I don't know how well that can be calibrated or if there is some kind of automatic calibration. Can someone help me out with that?

I think you misunderstood the bit about the 32KHz crystal. I only want to use it to calibrate system clock in certain intervals. I need the system to withstand high G force shocks and using a crystal is not the best for that application. But if I have some time between high G force events, then in that interval I can check whether the system clock is still calibrated.

But Now I see that you recommended the ULP 32K osc too, so sorry for misunderstanding you. I'll read some about those trim bits.
edit: I looked it up. You meant CALIB[5:0] bits, right? (datasheet page 752)

microsootys:
I think ATSAMD51 meets all your requirements. I run it at 120MHz using the internal clock sources. It will even do 200MHz overclock if you wanted. There are 6 sercom ports for i2c, spi and serial, 4 TC timers and 3 TCC timers all are at least 16bits, two of the TCC timers are 24bit. TC timers can be paired to 32bits.

If you wanted you could use an external 32k crystal to drive the PLL and DFLL, I believe you are supposed to for more accurate timings, especially with USB, but it doesn't seem to bother adafruit and any of their 48pin SAMD51 boards, and it works for me too. The ULP 32K oscillator has trim bits, so you could probably do so manually like you describe.

I think the way it's meant to work is using the ULP 32K clock to drive a gclk, then use that gclk to drive the PLL and DFLL. Atmel start has a clock configuration page, although the one with microchip's tools work better. And yes, those are the trim bits I was talking about.

If you have a clock that can run in your application and it's tolerances are within range you can just use it as an external clock input instead of a crystal and then just forget about calibrating it at all.

You might consider the DUE core, a 100% arduino DUE compatible board:

Compact size: All components are put on a 54 x 58mm 4-Layers PCB

ard_newbie:
You might consider the DUE core, a 100% arduino DUE compatible board:

Due Core - Arduino Compatible SAM3X8E 32bit ARM Cortex M3 Module
Compact size: All components are put on a 54 x 58mm 4-Layers PCB

My application doesn't allow for pre made boards. I need a small board with robust connectors that can withstand 10s of Gs of acceleration (hence no crystal for system clock) and extreme temperatures, like -60 - 100°C

Now the previously recommended SAMD51 at 96MHz looks like the right choice, as it can run up to -40 - +125°C. Anyways I decided I should learn to use AVR studio and this hardware I think is worth the effort.

Hi ferihun,

The SAMD51/SAMD21 can operate from either a 8-48MHz general purpose crystal (XOSC), a 32.768kHz RTC crystal (XOSC32K), or a 32.768kHz internal oscillator (OSCULP32K/OSC32K).

Both the SAMD21 and SAMD51 are able to multiply up any of these clock sources up to a frequency of 48MHz, using their on-chip digtial frequency locked loop (DFLL48M).

The SAMD21 employs this 48MHz clock for its CPU core, but in addition has a 96MHz digital phase locked loop (FDPLL96M) that can used to run some of its timers at this highter frequency.

The SAMD51 takes this a stage further and instead has two digital phase locked loops (FDPLL200M) that can generate the 120MHz for its CPU core and up to 200MHz for some of its timers.

For absolute time measurement, an external 32.768kHz crystal at ±20ppm gives you an accuracy of around ±1.7 seconds per day. The internal 32.768kHz oscillator however, could be out by as much as ±20 minutes per day. Whether this is an issue or not, depends on your application?

@ard_newbie Thanks for the link. Copperhilltech's miniaturised Due looks really nice.

MartinL:
The SAMD51 takes this a stage further and instead has two digital phase locked loops (FDPLL200M) that can generate the 120MHz for its CPU core and up to 200MHz for some of its timers.

For absolute time measurement, an external 32.768kHz crystal at ±20ppm gives you an accuracy of around ±1.7 seconds per day. The internal 32.768kHz oscillator however, could be out by as much as ±20 minutes per day. Whether this is an issue or not, depends on your application?

I'm planning on using the ATSAMD51J20A at 96MHz, as it can handle 125°C operation this way and gives some more durability to the whole system.
I'm not planning to use the internal oscillator for precise time base measurement, just as a clock source for PLL. I'd use an external 32KHz reference to constantly keep the internal resonator calibrated, or if I can find a non quartz based compensated clock source, I could use that as a reference too. The only thing matters is that it has to be able to work reliably in vibrating environments and quartz crystals tend to make errors in this case.