[En-Nut-Discussion] Timer1, AT90CAN128 & NutOS

Harald Kipp harald.kipp at egnite.de
Sat Jan 17 20:52:42 CET 2009


jaripetteri wrote:

> I have tried to get Timer1 to run on my 90CAN128 running with NutOS without
> success. Is there something I need to notice when using guide like here with
> NutOS?

Not really, Nut/OS allows to use native interrupts and directly access
all hardware registers (at least for AVR targets).

> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=50106

This tutorial doesn't include interrupts, so it'd be interesting to see
how you implemented them.

The AT90CAN128 is a bit different from the ATmega128, though.

1. Due to a bug on the chip, the stack needs to be in internal RAM.
Nut/OS handles this automatically, when you selected the right MCU.

2. The timer structure is different, actually similar to the ATmega256x.
SO Nut/OS uses Timer2 for these chips, instead of Timer0 used for the
m128. But Timer1 is OK.


> So is there sample anywhere how to use native Timer1 on NutOS? Or can anyone
> give me some info how to go forward with this?

Yes, inside the OS: arch/avr/dev/ostimer.c.
Because of the different options supported, it might be a bit difficult
to read, though.

Harald




More information about the En-Nut-Discussion mailing list