MCF5206e and timers

View: New views
1 Messages — Rating Filter:   Alert me  

MCF5206e and timers

by Jaysen Roper :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

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");

      }

 

coldfire@... Send a post to the list. coldfire-join@... Join the list. coldfire-digest@... Join the list in digest mode. coldfire-leave@... Leave the list.