Jonathan Roy

TCNT not running

Discussion created by Jonathan Roy on Oct 7, 2009
Latest reply on Oct 8, 2009 by Daniel Lundin



I'm working with a MC9S12DP256 using TC4 as output compare, but I encounter troubles with the free run counter TCNT. This is how I initialize the timer :


// Enable Timer 4 for 1ms clickTIOS        = 0x10; TIE_C4I     = 1;TSCR1_TEN   = 1;TSCR1_TSWAI = 1;TSCR1_TSFRZ = 1;// Run timerTC4 = OS_TIMER_PERIOD;


I use CodeWarrior 5.9 under Vista, and TCNT is never incremented, the simulator indicates the value "undefined" for it, whereas it works well at school with CodeWarrior 3.1 under XP...What's the problem ?