Hi
I am using an AT91SAM7s256 using embOS.
I am attempting to switch from PLL to just using the Main Oscillator in order to conserve power as I need this to run off a battery.
Every time I try to switch off the PLL, the microcontroller does wierd things, such as overwrite the embOS data structures.
My switching code is:
_PMC_MCKR = 1; /* (PMC) Clock from PLL is selected */
while((_PMC_SR & (1 << 3)) == 0); /* Wait until main clock is ready */
_PMC_MCKR |= (0 << 2);
while((_PMC_SR & (1 << 3)) == 0); /* Wait until main clock is ready */
_PMC_PLLR = 0;
while((_PMC_SR & (1 << 3)) == 0); /* Wait until main clock is ready
This is driving me crazy
Thanks
Lawrence
I am using an AT91SAM7s256 using embOS.
I am attempting to switch from PLL to just using the Main Oscillator in order to conserve power as I need this to run off a battery.
Every time I try to switch off the PLL, the microcontroller does wierd things, such as overwrite the embOS data structures.
My switching code is:
_PMC_MCKR = 1; /* (PMC) Clock from PLL is selected */
while((_PMC_SR & (1 << 3)) == 0); /* Wait until main clock is ready */
_PMC_MCKR |= (0 << 2);
while((_PMC_SR & (1 << 3)) == 0); /* Wait until main clock is ready */
_PMC_PLLR = 0;
while((_PMC_SR & (1 << 3)) == 0); /* Wait until main clock is ready
This is driving me crazy
Thanks
Lawrence