Sign in

username:

password:



Not a member?

Search AT91SAM



Search tips

Subscribe to AT91SAM



Ads

Discussion Groups

Discussion Groups | AT91SAM ARM | AW: AT91SAM9260 timer register

For users of the Atmel AT91SAM7 and AT91SAM9 ARM CPU chips. Atmel has taken a new direction by combining on chip flash and ram with the ARM CPU on a single die. This provides low cost devices for small systems using the ARM CPU. This group is to exchange information to help users get started and learn how to use the devices.

AW: AT91SAM9260 timer register - "ICLI, Bekir (EXT)" - Jan 17 10:42:51 2008

The exact explanation I needed..!
Really appreciated..

Mit freundlichem Gruß / Best regards

Bekir ICLI

________________________________

Von: A...@yahoogroups.com [mailto:A...@yahoogroups.com] Im Auftrag von Matthias Wieloch
Gesendet: Donnerstag, 17. Januar 2008 16:35
An: A...@yahoogroups.com
Betreff: AW: [AT91SAM] AT91SAM9260 timer register

The Master Clock (MCK) defines the frequency of the controller. The MCK can be derived from Slow Clock (SCK), Main Clock (MAINCK), or PLL Clock (PLLCK).

SCK is generated by an internal RC Oscillator and it is not possible to change it.

Most eval boards with Atmel processors use an 18,432MHz crystal Main Oscillator (responsible for Main Clock). The main oscillator can be bypassed (as most applications do) when using the PLL to generate MCK.

As far as you code snippet goes you are right the MCK is set by PLL. I don't know any details of the SAM9260 but I think the mechanism is similar to SAM7 series.

The Power Management Controller is set to use PLL to generate MCK with divider 9 and multiplier 96.

In general MCK generation works as follows:

In one register you choose which clock is used to generate MCK, as far as I know this can be SCK, MAINCK or PLL, and a prescaler.

If PLL is used for MCK generation: Main Clock (18,423 MHz) is divided by PLL_DIV (9) and multiplied by PLL_MUL + 1 (96 + 1) = PLLCK (198,656MHz)

Then at the end the prescaler determines how fast the MCK goes. In your example the prescaler divides the input clock by 2, so the MCK on your eval board is 99,328 MHz.

For further details have a look in the datasheet, especially the chapters about PMC, Clock generator and System Controller, and see how the demo application handles this on initialisation.

________________________________

Von: sentto-14415064-3210-1200575568-matthias_wieloch=w...@returns.groups.yahoo.com [mailto:sentto-14415064-3210-1200575568-matthias_wieloch=w...@returns.groups.yahoo.com] Im Auftrag von ICLI, Bekir (EXT)
Gesendet: Donnerstag, 17. Januar 2008 14:13
An: A...@yahoogroups.com
Betreff: AW: [AT91SAM] AT91SAM9260 timer register

Hi Eric,

Thanks for the answer.

My specific interest in this is that I need to measure how long, for example, my data copy operation takes.

And I want to be precise on that. So RTTC is out of question. I guess I should use TC0 which works with MCK/2.

But I do not understand what is MCK.

There are "Main Clock", "Master Clock", "Processor Clock", "PLL", "MCK".. And I am really lost in them, what they are used for.

In the example code delivered with the devkit, it says

#define BOARD_MAINOSC 18432000

#define BOARD_MCK (((18432000 * 97) / 9)/2)

And there is this

/* Initialize PLLA at 200MHz (198.656) */

AT91C_BASE_PMC->PMC_PLLAR = BOARD_CKGR_PLLA

| BOARD_PLLACOUNT /* 63<<8 */

| BOARD_MULA /* 96<<16 */

| BOARD_DIVA; /* 9 */

I understand here he is trying to do the settings for getting MCK, but he is doing these settings in PLL register.

That I dont understand why. :( Also in the manual, it says that main oscillator is 12 MHz, but here he sets it to 18432000..

I am so confused in all these..

Mit freundlichem Gruß / Best regards

Bekir ICLI

________________________________

Von: A...@yahoogroups.com [mailto:A...@yahoogroups.com] Im Auftrag von Eric Pasquier
Gesendet: Donnerstag, 17. Januar 2008 13:35
An: A...@yahoogroups.com
Betreff: Re: [AT91SAM] AT91SAM9260 timer register

Hi Bekir,

SAM9260 has 3 timers (TC) that you can use to measure external events like width or period of a pulse with a 16 bits resolution of a selectable clock.

It also have a "real time timer" (RTTC) which can be used for longer events, but with a lower resolution (32kHz clock max).

And, you also have a "periodic interval timer" (PIT) that can be used to increment a "software clock" and a defined rate.

The use of each timer depends of your application and what you would like to measure.

I hope this help.

Eric Pasquier

----- Original Message -----

From: ICLI, Bekir (EXT)

To: A...@yahoogroups.com

Sent: Thursday, January 17, 2008 12:15 PM

Subject: [AT91SAM] AT91SAM9260 timer register

Hi,

I want to implement a time measurement function which i can use for different kinds of purposes.

From my earlier experiences with other processors (powerpc), i know that there is a timer register which increments with the cpu clock.

Therefore, the calculation was easy and straightforward.

Does anybody have such kind of experience or knowledge, whether AT91SAM9260 has such a timer register?

PS: I have seen the timer counters which work at most half the master clock fast, but just wanted to makes sure if there was a hardwired timer register.

Best regards

Bekir ICLI





(You need to be a member of AT91SAM -- send a blank email to AT91SAM-subscribe@yahoogroups.com )