Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Switching PLL configuration
PostPosted: Tue May 19, 2009 3:50 pm 
Offline

Joined: Wed Jan 07, 2009 6:56 pm
Posts: 5
Hi all,

I am developing an application using (AT91Sam7s64) that has a requirement to switch from a fast PLL speed to a slow one for power saving. Out of 150 units 4 of then reset continuously (watchdog reset caused by undefined instructions).

I thought I was being careful and following the datasheet but I must be doing something wrong!

speeding the PLL clock up I.......

disabled_interrupts();
AT91C_BASE_PMC->PMC_PLLR = 0x00191c05; // Set PLL output to 95.8464Mhz
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000004)); // Wait for PLL to stabilise
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000008)); // Wait for master clock to be ready
AT91C_BASE_PMC->PMC_MCKR &= 0xffffffef; // Set PLL/2 = 47.923200MHz
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000008)); // Wait for master clock to be ready
AT91C_BASE_PMC->PMC_MCKR |= 0x00000003; // Select PLL
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000008));

and slowing it down I....

disabled_interrupts();
AT91C_BASE_PMC->PMC_PLLR = 0x003f1c0a; // Set PLL output to 117.964800Mhz
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000004)); // Wait for PLL to stabilise
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000008)); // Wait for master clock to be ready
AT91C_BASE_PMC->PMC_MCKR |= 0x00000014; // Set PLL/32 = 3.6864MHz
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000008)); // Wait for master clock to be ready AT91C_BASE_PMC->PMC_MCKR |= 0x00000003; // Select PLL
while(!(AT91C_BASE_PMC->PMC_SR & 0x00000008));

The only method I have come across that seems to fix this bug is to enable the MCKRDY interrupt! This seems very unlikely to be the real solution as am polling MCKRDY but I'm wondering if its a clue.

I have also tried setting PRES and CSS seperately but to no avail.

Does anyone have any hints or tips for me?

Help!

swilson


Top
 Profile  
 
 Post subject: Re: Switching PLL configuration
PostPosted: Wed Jun 03, 2009 9:20 pm 
Offline

Joined: Tue Sep 25, 2007 8:41 am
Posts: 3
Location: Duisburg
Hello,

why not switch to slow or main (oscilator) clock first, then change parameters for pll, wait for pll to stabilize and then switch back?


Also note that there is a speed range where the flash does not work properly. If this range is touched while changing the speed with the pll I expect an undefined error.

MCK: Limited Master Clock Frequency Ranges
If the Flash is operating with ... wait states, the frequency of the Master Clock MCK must be
lower than 3 MHz or higher than ... MHz.


Greetings,
Thorsten


Top
 Profile  
 
 Post subject: Re: Switching PLL configuration
PostPosted: Wed Jun 24, 2009 5:23 pm 
Offline

Joined: Wed Jan 07, 2009 6:56 pm
Posts: 5
Hi Thorstenw,

Thanks for the reply.

Interestingly I do use one wait state and I'm setting my MCK to 3.6864MHz. So I should expect a data abort??

However if i set MCK within range (I have tried 1.8432Mhz & 29.4912MHz) I still have the same problem.

Sarah


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: