AnsweredAssumed Answered

difficulty setting up TSCR1 for MC9S12D using full chip simulation, new to Codewarrior

Question asked by Christopher Perna on Mar 9, 2009
Latest reply on Mar 17, 2009 by Tom Thompson

Hello all,

 

I'm new to codewarrior and attempting to convert some of my existing C programs compiled in EGNU for the Dragon 12 development board.

 

For now I'm creating and testing projects using the MC9S12D32, C, ANSI startup code option, no processor expert, no PC Lint, none selected for floating point, small memory model, and full chip simulation.

 

My problem is....

 

Any time I try to set the TFFCA bit in TSCR1, it doesn't seem to get set.  All this effort is to try to replicate a delay function written in C that uses the modulus counter and timer fast flag clear all feature.  I could re-write the code to not use TFFCA, but it's bugging me why I can't set it as I used to.

 

I have tried many methods to set TFFCA such as

 

TSCR1_TFFCA = 1;

 

TSCR1 |= 0x10;

 

TSCR1 |= TSCR1_TFFCA_MASK;

 

and tried inline asm too thinking i didn't understand register mapping:

 

BSET  0x46,#16

 

 

I can set only bits 7,6 and 5 of TSCR1 but TFFCA remains a 0 no matter what I try to set it to.  If I write a 0x90 to TSCR1, bit 7 gets set fine and DATA1 window in full chip simulation returns a 128 for _TSCR1.  TFFCA remains a 0.

 

I'm surely making a common beginner error.

 

thanks

Outcomes