[En-Nut-Discussion] Timing on AVR32

Daniel Fiedler (Ethernut) ethernut at fitus.de
Thu May 17 01:22:56 CEST 2012


Hello,

i have read back the PLL Control register of PLL0:

It's hex value: 0x10 0x09 0x01 0x0D

PLLMUL is set to 9
PLLDIV is set to 1

PLLOPT[0] uses 80 ... 180MHz range
PLLOPT[1] selects f(pll) = f(vco)/2

With these options f(pll) is calculated: 
f(vco)= ( 9 + 1 ) / 1 * f(osc) = 120MHz
f(pll) = 60MHz

Seems to be correct. 

In file /nut/arch/avr32/dev/ostimer.c I found this function.

void NutRegisterTimer(void (*handler) (void *))
{
    /* Set compare value for the specified tick frequency. */
//    Set_system_register(AVR32_COMPARE, NutGetCpuClock() / NUT_TICK_FREQ + Get_system_register(AVR32_COUNT));
	Set_system_register(AVR32_COMPARE, NutGetCpuClock() / NUT_TICK_FREQ );

    sig_sysCompare.ir_handler = handler;

    register_interrupt(SystemCompareIrqEntry, AVR32_CORE_COMPARE_IRQ, AVR32_INTC_INT0);
}

I changed line 4 in line 5. Now system seems to run at the correct speed. 
But Nut/os needs about 15-20s for boot/init. 

Could someone explain this function?


Best regards
Daniel

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-bounces at egnite.de] Im Auftrag von Ethernut
Gesendet: Mittwoch, 16. Mai 2012 12:36
An: Ethernut User Chat (English)
Betreff: Re: [En-Nut-Discussion] Timing on AVR32

Hi Ole,

yes i think this too. I use the EVK1100. 

I'm new to Nut/os so i don't have figured out how board init works exactly yet.

An other possibility:
I have read something about a System Timer with 1ms. This Timer could Maybe to Slow.

Greetings
Daniel

Von meinem iPhone gesendet

Am 16.05.2012 um 12:05 schrieb Ole Reinhardt <ole.reinhardt at embedded-it.de>:

> Hi Daniel,
> 
>> I have written an Time-Clock for AVR32. I used an NutTimer with 
>> 1000ms timing. But clock counting is twice to slow.  I also created a 
>> BlinkingLed Thread. With a NutWait command with 150ms wait time but LED blinks slowly.
>> I resume the clock frequency of cpu is set not correctly. Or the 
>> system timer of nut/os is to slow.
> 
> I've never worked with the AVR32 plattform yet, but it sounds like a
> (wrong) PLL or Clock source setting issue. 
> 
> Do you use one of the supported development boards or an own setup?
> 
> bye,
> 
> Ole
> 
> --
> 
> Thermotemp GmbH, Embedded-IT
> 
> Embedded Hard-/ Software and Open Source Development, Integration and 
> Consulting
> 
> http://www.embedded-it.de
> 
> Geschäftsstelle Siegen - Steinstraße 67 - D-57072 Siegen - tel +49 
> (0)271 5513597, +49 (0)271-73681 - fax +49 (0)271 736 97
> 
> Hauptsitz - Hademarscher Weg 7 - 13503 Berlin Tel +49 (0)30 4315205 - 
> Fax +49 (0)30 43665002
> Geschäftsführer: Jörg Friedrichs, Ole Reinhardt Handelsregister Berlin 
> Charlottenburg HRB 45978 UstID DE 156329280
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
_______________________________________________
http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list