[En-Nut-Discussion] NutOS system timer for Mega2561
PragmaLab
info at pragmalab.nl
Tue Aug 22 22:28:20 CEST 2006
Hello all,
due to weird timer behaviour of our freshly ported application (Mega128 ->
Mega2561), I came accross '\arch\avr\dev\ostimer.c' and discovered that no
longer Timer0 is used as the system timer but Timer2:
#if defined(MCU_AT90CAN128) || defined(MCU_ATMEGA2561)
#define TCCRx TCCR2A
#define TCNTx TCNT2
#define OCRx OCR2A
#define TIFR_OCFx _BV(OCF2A)
#define TIFR_TOVx _BV(TOV2)
#define sig_TIMER sig_OUTPUT_COMPARE2 <------- Mega2561 uses Timer2
#else
#define TCCRx TCCR0
#define TCNTx TCNT0
#define OCRx OCR0
#define TIFR_OCFx _BV(OCF0)
#define TIFR_TOVx _BV(TOV0)
#define sig_TIMER sig_OUTPUT_COMPARE0 <------ Mega128 uses Timer0
I might have missed some postings on this subject, but searching the Nut
Archives did not help me much
1) does anybody now the reason for this change (Timer0->Timer2)?
2) are there more modifications like this applied to NutOS when adding
Meag2561 support?
Thanks,
regards,
Rob van Lieshout
More information about the En-Nut-Discussion
mailing list