MCF5206e and timers

"Jaysen Roper" <[email protected]> Fri, 17 Oct 2008 14:38:49 +0100
Newsgroups gmane.comp.hardware.motorola.microcontrollers.coldfire
Message-ID <000001c9305d$b002e000$1008a000$@com>
Im having some problems getting the timers operational on my 5206e chip.

 

TCN1 is always 771 [0x0303] so I don't think my timer is actually counting??

 

All help and pointers would be greatly appreciated.

 

 

      IMR = IMR & ~TIMER1_IMR;      /* remove the interrupt mask for T1 */

      ICR9 = 0x84;                        /* timer 1 = AVEC / IL1 / IP0
[vec25] */

      TRR1 = 0xFFFF;                      /* counter target */

      TCN1 = 0x00;                        /* reset the counter */

      TER1 = 0x03;                        /* clear CAP and REF */

      TMR1 = 0xff3B;                      /* prescaler=FF / NoCap /
autoRestart / use MasterSysClk / reset */

 

      static volatile WORD TCNData;

 

      while (1)

      {

            TCNData = TCN1;

            asm ("nop");

      }