Sam3x8e maximum spi clock rate

Discussion around product based on ARM Cortex M3 core.
This forum will be discontinued soon.

Moderators: nferre, ncollot

hessa59
Posts: 5
Joined: Mon May 02, 2016 3:03 am

Sam3x8e maximum spi clock rate

Mon May 02, 2016 5:23 am

Does any body no the maximum clock rate for the SPI on the SAM 3X8E

I have turned the baud rate divisor down to 1 and am only gettting about 3.5 MHZ.

It seems like the clock rate is determined by dividing the master clock.

I might need to speed up the master clock for the SPI but I don't know how.

Any help would be greatly appreciated :)
tsvoipio
Posts: 54
Joined: Wed Aug 19, 2015 9:44 pm

Re: Sam3x8e maximum spi clock rate

Mon May 02, 2016 9:09 am

Please get and read the processor datasheet. The limitations are clearly written there, in the sections of the clock generator, SPI and electrical characteristics.

When run at the proper configuration (fast enough master clock), you should get at least 35 MHz.

--

-TV
hessa59
Posts: 5
Joined: Mon May 02, 2016 3:03 am

Re: Sam3x8e maximum spi clock rate

Mon May 02, 2016 2:17 pm

Thanks for your quick response tv. While I am very relieved to here the clock frequency is much higher, I am still at a loss of how to proceed.

I am making the transition to atmel studio and c from the arduino world and am finding the 1500 page manual at a bit daunting.

I was not able to find anything about maximum clock rate in the SPI section but I did find a reference to group 2 pins on page 1413 of the manual saying they could be driven up to 35mhz.

I am finding the whole master clock documentation extremely confusing. Could you point me to some sample code or suggest which register will tell me my current master clock speed.

Thanks again
tsvoipio
Posts: 54
Joined: Wed Aug 19, 2015 9:44 pm

Re: Sam3x8e maximum spi clock rate

Mon May 02, 2016 4:41 pm

The clock generation is in sections 27 and 28 of the datasheet (Atmel-11057C), starting from page 519 on my copy. Depending on the timing reference (32 kHz crystal, 3-20 MHz crystal, none), the master clock has to be set up for the desired clock speed. For best flexibility, the main clock is usually set up to run using the PLL (phase locked loop).

The SPI is described in section 32, starting from page 676.

The SPI electrical timing limitations are in section 45.10, pages 1413 to 1417.

The Atmel Studio has a software package called ASF (which I'm not very fond of), which handles much of the low-level handling for the processor set-up. However, it does not free you from understanding what needs to run under the covers to make the thing tick. The Arduino packages have taken care of this kind of details for you, but at a cost: you're not free to choose the set-up details in another way.

For the Atmel Studio and ASF questions, I'm the wrong address. I'm not using either with my SAM's.

--

-TV
hessa59
Posts: 5
Joined: Mon May 02, 2016 3:03 am

Re: Sam3x8e maximum spi clock rate

Tue May 03, 2016 12:29 am

I was using the ASF functions to initialize the system clocks and I assumed (hoped?) they would set things up for maximum output frequency on the peripherals. This was an ASF board project for an Arduino Due.

I am digging through your suggested readings in the datasheets. If I find the solution to boosting the SPI clock frequency I will post it here.

Thanks again :)

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest