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

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

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

Jump to solution
2,236 Views
chrisp_
Contributor I

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

Labels (1)
Tags (1)
0 Kudos
1 Solution
681 Views
J2MEJediMaster
Specialist I

1) Right. The updater will handle everything regarding your current version number. Step increases in the version (such as 4.6 and 4.7) require a download.

 

2) Here's what I do:

 

a) Save the license.dat file located in the CodeWarrior installation folder somewhere else, because you'll need it to finsh the update. It's not a bad idea to save it to a Flash drive in case your system ever craters.

b) Run the installer and have it remove that version of CodeWarrior.

c) When that operation completes, go into the C:\Program Files\Freescale folder and move the CodeWarrior folder to the recycle bin.

d) Install the later version of CodeWarrior.

e) Copy the license.dat file you saved previously into the CodeWarrior installation directory to overwrite the license.dat file that is acting as a placeholder.

 

That should take care of it. Note: steps b) and c) might be overkill since the installer will make a new CodeWarrior installation directory with the later version name that is separate from the old one. However, I just like trying to keep a clean system, and if you are tight for disk space, you need to delete the older version.

 

You can keep the older version of CW around if you want to. Just install the later version and copy the license.dat file into the new CodeWarrior directory. However, you have to be careful when you double-click on a project file icon that the desired version of CodeWarrior launches.

 

---Tom

Message Edited by J2MEJediMaster on 2009-03-17 09:21 AM

View solution in original post

0 Kudos
5 Replies
681 Views
chrisp_
Contributor I
forgot to add i'm using codewarrior 5.7.0
0 Kudos
681 Views
chrisp_
Contributor I

Update:

 

Setting TFFCA bit works normally with real hardware (Adapt9S12C MC9S12C32 development board and Softec inDART HCS12 BDM).

 

With a MC9S12C32 full chip simulation as I described in my first email, cannot set TFFCA bit. 

0 Kudos
681 Views
CrasyCat
Specialist III

Hello

 

This looks like a tool defect.

 

I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.

CrasyCat

0 Kudos
681 Views
chrisp_
Contributor I

Thanks CrasyCat,

 

I did in fact send a service request for this, and you were right, it was a bug.  I was having some difficulty identifying what CW version I had, which added to the confusion. I incorrectly stated in a previous forum post the version number of the IDE instead of the program version.   

 

This version I have is CW 4.5 and I received it on a CD along with a piece of Softec debugging/programming hardware we purchased in Jan of 2009.

 

Here is the response from Freescale support:


Thanks for your feedback.
Your original problem (cannot set TFFCA in full chip simulation) is a bug of CW4.5 which has been fixed in CW4.7.


V4.5 license is a super set of V4.7 license. Which means v4.5 license could be used for V4.7. but v4.7 license will not work on v4.5 due to license key reduction since v4.6.

Hope this helps! Please let me know if you have any doubt on it.


 

Now this raises interesting questions about CW software versions and upgrades.

 

1. My "CodeWarrior Updater" program in the CW program group reports that my version is up to date.  So I can only assume that this updater works only within a specific version number.  E.g. CW Updater will not update you from version 4.5 to 4.6, it will only get you all the updates specific to the version you have installed currently.  Is that assumption true?

 

2. What is the "right way" to update CW to another version number?  According to Freescale support it appears now I should update my CW version to 4.7.  Does that mean a full-out uninstall of what I have and reinstall CW 4.7 from scratch?

 

thanks,

 

chris

 

 

0 Kudos
682 Views
J2MEJediMaster
Specialist I

1) Right. The updater will handle everything regarding your current version number. Step increases in the version (such as 4.6 and 4.7) require a download.

 

2) Here's what I do:

 

a) Save the license.dat file located in the CodeWarrior installation folder somewhere else, because you'll need it to finsh the update. It's not a bad idea to save it to a Flash drive in case your system ever craters.

b) Run the installer and have it remove that version of CodeWarrior.

c) When that operation completes, go into the C:\Program Files\Freescale folder and move the CodeWarrior folder to the recycle bin.

d) Install the later version of CodeWarrior.

e) Copy the license.dat file you saved previously into the CodeWarrior installation directory to overwrite the license.dat file that is acting as a placeholder.

 

That should take care of it. Note: steps b) and c) might be overkill since the installer will make a new CodeWarrior installation directory with the later version name that is separate from the old one. However, I just like trying to keep a clean system, and if you are tight for disk space, you need to delete the older version.

 

You can keep the older version of CW around if you want to. Just install the later version and copy the license.dat file into the new CodeWarrior directory. However, you have to be careful when you double-click on a project file icon that the desired version of CodeWarrior launches.

 

---Tom

Message Edited by J2MEJediMaster on 2009-03-17 09:21 AM
0 Kudos