TCNT not running

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

TCNT not running

1,590 Views
Psych0o0
Contributor I

Hi,

 

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 ?

 

Regards.

 

Jonathan

Labels (1)
0 Kudos
4 Replies

471 Views
kef
Specialist I

In true time simulator menu "HCS12 FCS"->"Set Derivative...", try selecting MC9S12DP256B.

 

Also if you used project wizard, included "derivative.h" should contain something like this:

 

#pragma LINK_INFO DERIVATIVE "mc9s12dp256b"

If you don't want to include derivative.h, then try adding above pragma to one of your *.c files.

0 Kudos

471 Views
Psych0o0
Contributor I

I tried to replace the following pragma in "derivative.h" : 

#include <mc9s12dp256.h>#pragma LINK_INFO DERIVATIVE "mc9s12dp256"

by

 

#include <mc9s12dp256.h>#pragma LINK_INFO DERIVATIVE "mc9s12dp256b"

 

and it works ! Thanks for your help !

 

Jonathan.

Message Edited by Psych0o0 on 2009-10-08 11:46 AM
0 Kudos

471 Views
Lundin
Senior Contributor IV
You should post a service request for this so that Freescale fixes it. MC9s12dp256b is a very buggy obsolete silicon mask that you DONT want to use. Remove the "B" and you will get the correct part number.
0 Kudos

471 Views
kef
Specialist I

Then TCNT should run. It works OK for me with all your settings listed above, TCNT advances properly while stepping or running.

 

0 Kudos