[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] OT: anyone successfully use the CLKPR feature in them
RE: [avr-gcc-list] OT: anyone successfully use the CLKPR feature in themega88?
Tue, 03 Oct 2006 14:05:09 -0600
> -----Original Message-----
> From: larry barello [mailto:address@hidden
> Sent: Tuesday, October 03, 2006 10:54 AM
> To: 'Eric Weddington'
> Cc: AVR GCC List
> Subject: RE: [avr-gcc-list] OT: anyone successfully use the
> CLKPR feature in themega88?
> Ok, if you insist. It just is so off topic...
Actually it's not off topic. Talking about IAR would be off-topic. ;-)
I'm actually going to be implementing an API for avr-libc for the CLKPR
register in the near future.
> The overt symptoms are that the clock doesn't bump up
> reliably. I suspect
> that it doesn't bump down reliably either, but at 11mhz &
> 50hz timer tick I
> wouldn't notice the code taking several tries. @ 100khz and
> .5 hz I notice
> when it misses as a complete control cycle occurs at a glacial pace...
Here is this from the ATmega1281 datasheet. Have you seen this?
"The ripple counter that implements the prescaler runs at the frequency of
the undivided clock, which may be faster than the CPU's clock frequency.
Hence, it is not possible to determine the state of the prescaler - even if
it were readable, and the exact timer it takes to switch from one clock
division to the other cannot be exactly predicted. From the time the CLKPS
values are written, it takes between T1 + T2 and T1 + 2 * T2 before the new
clock frequency is active. In this interval, 2 active clock edges are
produced. Here, T1 is the previous clock period, and T2 is the period
corresponding to the new prescaler setting."
Could this have something to do with it?