[En-Nut-Discussion] EVK1100 Timing Problem

philippgl at freenet.de philippgl at freenet.de
Wed Oct 8 15:34:13 CEST 2014


        Hello Thiago,

Thank you for answering!
I´m using a Thread switching with a NutSleep(1000)
So you suggest that i should use a Timer instead of Threads?
If you don´t mind i would send you my source code.
The Problem with the SPI is in there too!
Some other thing happend: If i define my hardware SPI as a Master
it´s Frequency gets stuck at around 7kHz no matter what i implement in the
NUTSPI node.

Btw: What Ethernut version are you using? I have to use the 4.10. because 
in 5.X the TCP does not work.


Thank you very much!


> -----Ursprüngliche Nachricht-----
> Von: Thiago A. Corrêa 
> Gesendet: Mi. 08.10.2014 13:13
> An: Ethernut User Chat (English) , 
> Betreff: Re: [En-Nut-Discussion] EVK1100 Timing Problem
>
> 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,   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
>>
> _______________________________________________
>> href="http://lists.egnite.de/mailman/listinfo/en-nut-discussion"
> target="_blank">http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> _______________________________________________
> target="_blank">http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
> -----Ursprüngliche Nachricht Ende-----




---
Alle Postfächer an einem Ort. Jetzt wechseln und E-Mail-Adresse mitnehmen! http://email.freenet.de/basic/Informationen




More information about the En-Nut-Discussion mailing list