SAM4E Clock

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

Good day all mighty experts,

 

So I picked up a couple of different ARM Cortex processors. Up until now, I have only dealt with the 8-bit AVR based controllers. But I feel I'm now ready to move onto some bigger 32-bit processors. I've got some small 32-pin TQFP Cortex-M0 processors to get started with ARM. However, for a larger future project, I also got a beefier Cortex-M4 SAM 4E. Now the biggest reason I picked this processor is because it has a maximum frequency of 120 MHz.

 

So what I am used to with AVR based processors (mainly the 644p DIPs) is connecting an external crystal clocked to the maximum frequency of the processor (20 MHz for the 644p).

 

On to the actual question... I have been reading more into the datasheet for the SAM 4E, and I see that it has a PLL, which I am hoping that you guys could help to confirm that I am understanding it correctly. So the processor has a 4, 8, or 12 MHz oscillator. From my understanding of reading about the PLL, it has a multiplier and a divider in order to set the desired clock frequency. I am unsure yet of the specific values that can be set for multiplier and divider (I have not dived into the registers yet), but is it correct to say that the multiplier can be set to say 10 and the divider to 1 along with the oscillator set to 12 MHz in order to achieve a frequency of 120 MHz, without an external crystal or oscillator?

 

If my understanding of that is all correct, under System Features of the datasheet, it says "One PLL up to 240 MHz for Device Clock and for USB," does this also mean the processor can achieve 240 MHz frequency by using a multiplier of 20?

 

TLDR:

So my question really is, can I achieve the maximum frequency of 120 MHz without utilizing an external crystal or oscillator?

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

Last Edited: Thu. Oct 15, 2015 - 11:33 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can try to run the cpu at 240MHz, but don't be surprised if it doesn't work! You should be able to run off the internal oscillator and multiply it up, but usually one will have an external crystal to get some precision. It usually takes a few goes at setting up the clock system - it can be a little tricky.

 

 

I've not used this device, so I can't speak from experience.

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

I'm glad you mentioned the external crystal, as it came up in my searching and reading through datasheets that the internal oscillators are not really designed for performance and precision but more for power consumption. So my best bet is to still utilize say a 20MHz external crystal and the PLL to get my desired frequency (I don't foresee needing 240MHz, it was just a thought). If I am understanding that correctly.

 

After reading a few other threads on the forums here, I can certainly see how it can be tricky to get the clock system setup appropriately. I won't even worry about an external crystal or setting the clock until I have a better understanding of using and building smaller projects with the smaller Cortex-M0 processors I've purchased.

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

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

It would be nice if Atmel had nice tools like the ST cube that give you a nice schematic of the clock circuit with the GUI that sort of guides you. It warns you if you select something that is out of range. It took me all of a minute to setup the clock for usb and the cpu without resorting to the reference manual. Press a button and out pops a preconfigured project.
Vs blindly try different configs with ASF until it works!

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

Kartman, so the Atmel ARM processors need to be configured programmatically or does Atmel Studio have an interface to adjust the clock? Apologies if that is a terrible question. I am still awaiting my new ARM processors and besides, I need to get my soldering and PCB manufacturing skills down first (read as: actually start). I still have a few tools I have yet to pick up before I even attempt the QFP soldering on PCBs. I should be able to make some of my 8-bit DIP projects into PCBs and show them off here soon.

 

You have been a big help and provided great information!

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

Last Edited: Thu. Sep 17, 2015 - 08:15 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's a thread in the M0 section where there's a discussion on setting the clock system. The M4 is much the same. If you look at any manufacturer's cortex parts you'll see that they're all much the same when it comes to the complexity of the clock system - plenty of settings but only a small number of combinations work. They're all set programmatically - as in they have a number of registers that need to be loaded, but some manufacturers give you tools that make it a whole lot easier. With Atmel, you get ASF. Normally you'd start a project and use the template from, say, an xplained board. You then modify that to suit your board.
Soldering qfp is simple. Tag the device down with two corner pins, get flux gel and run this over the pins then use the 'drag' technique where you wipe a ball of solder across the pins using the soldering iron. A standard chisel tip works fine. The flux stops it bridging. If you do get a bridge that you can't wipe, use some soderwick. I did some 0.5mm tsop devices the other day.

Last Edited: Fri. Sep 18, 2015 - 12:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will definitely look for that thread about setting the clock system!

 

Thanks for the tips on the soldering techniques, as well. I've been watching a lot of videos and tutorials on soldering QFP and the tips you've mentioned match with a lot of the good vids I've seen on it! I'm really excited to get working on it but I'm awaiting my PCB shipment to arrive. I've decided to go with UV pre-sensitized boards (didn't really like the idea of heat transferring with the toner transfer method). I'm also going to be picking up a laminator that I can use for my solder mask (going to be using Dry Film Solder Mask Dynamask 5000).

 

As my PCB stuff will be arriving before what I need to do the solder mask, do you think I should even attempt the QFP without it? Almost every video I've seen of QFP soldering, they all use a solder mask. I think I can do my smaller DIP projects without a solder mask.

 

Anyway, I should probably stop deviating from the original subject so much! You've given me a lot of good information and have confirmed things as well.

My digital portfolio: www.jamisonjerving.com

My game company: www.polygonbyte.com

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

The flux should stop the solder bridging even without a solder mask.

Unfortunately, with high speed devices the pcb is not just an interconnect, but a vital component in the circuit. So home brewing your circuit boards is not so optimal. Not that the chip wont work, but it will most likely radiate RF. from a hobbyist perspective, it might mean that if you place a gps receiver close by, the receiver may not be able to receive the gps signal or limit the range on a rf link.