[En-Nut-Discussion] EVK1100 Timing Problem

Thiago A. Corrêa thiago.correa at gmail.com
Mon Oct 13 13:19:17 CEST 2014


On Mon, Oct 13, 2014 at 6:21 AM, Philippgl2 <mt1961 at thi.de> wrote:
>> 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);
>> }


This looks like a workaround to a datasheet errata. There are many
silicon bugs in the earlier batches of the processor. I think most
recent is revision K.
Is your board populated with -ES (Engeneering Sample) or is it a newer version.
First EVK1100, including mine, are ES.


>> 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?
>>

It sets an interrupt to occur at a fixed number of executed
instructions which depend on CPU cycles. It gives us a timer without
using a TC.

>> Best regards
>> Daniel
>
> Now i wanted to ask if there is any solution today to this problem? Maybe
> replay the Get_system_register(AVR32_COUNT) with a fix value?
>

It is a fixed value, AVR32_COUNT is a constant that represents the
address of a system register. It retrieves the current instruction
count, and discards it since it's not stored anywhere. Probably it is
just flusing the bus or something when you do a read before a write
there.Usually the errata workarounds does the oposite, they do a read
after a write. The interrupt enable registers on most peripherals need
this sort of workaround.

Kind Regards,
     Thiago A. Correa


More information about the En-Nut-Discussion mailing list