[En-Nut-Discussion] EVK1100 Timing Problem

Thiago A. Corrêa thiago.correa at gmail.com
Wed Oct 8 13:13:31 CEST 2014


Hi,

    Are you using a timer or thread context switching with a NutSleep?
I think the later has no way to ensure accuracy by the very nature of
cooperative threads but the first should be much closer. I've never
tried to do anything that depends on a delay on Nut/OS but the timer
calculation should be correct. I haven't checked in years, it's in in
arch/avr32/dev/ostimer.c:

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));

    sig_sysCompare.ir_handler = handler;

    register_interrupt(SystemCompareIrqEntry, AVR32_CORE_COMPARE_IRQ,
AVR32_INTC_INT0);
}

Should be correct.

Kind Regards,
     Thiago A. Correa



On Tue, Oct 7, 2014 at 4:50 AM,  <philippgl at freenet.de> wrote:
>
> Hi,
> I´m using the EVK1100 with Ethernut 4.10 (5.10 has problems with ETH).
> My problem is, if I start a Thread, let´s say toggling a LED with 1sec.
> The delay between the toggling is far beyond 1sec around 3 secs.
> I tried increasing the priority of the thread but nothing changed.
>
> The EVK1100 has a 12MHz oscillator and printf(“%d”,NutGetCpuClock);
> gives out 60MHz just FYI
>
>
>
> ---
> Alle Postfächer an einem Ort. Jetzt wechseln und E-Mail-Adresse mitnehmen! Rundum glücklich mit freenetMail
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion


More information about the En-Nut-Discussion mailing list