SCI and ATD setup registers not declared? What? - S12XDT512

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

SCI and ATD setup registers not declared? What? - S12XDT512

Jump to solution
2,501 Views
gruuvin
Contributor II
I am familiar with CW version 3.1 programming the HCS12C32. I wrote code that uses SCI and ATD registers for the C32, which works fine on that platform. However, for my project, I needed much more RAM for variables (8 arrays of 200 elements each), so I ordered the S12XDT512 project module for use with my student learning kit with breadboard. This new MCU module came with CW IDE version 5.7.0. I installed this because I needed the derivitive for this new MCU. So now I have fired it up and am porting my program over for the new MCU. I figure it should be pretty easy, because I have read the pertinent info in the XDT512 data sheet, and it looks like the register specs are the same as the C32. I have started a new project including the correct derivitives.

So, this is where I am, and so now here is the problem. I get compile errors on the following lines, which are the first lines in "main":

SCIBDL=9;
SCICR1=0x04;
SCICR2=0x08;
ATDCTL2=0b10000000;
ATDCTL3=0b00011000;
ATDCTL4=0b00000001;

(please ignore the switching between decimal, hex, and binary values, as it should not matter)

The compile errors I get are all the same: "SCIBDL not declared (or typname)". Of course, each compile error is the same complaint about each respective register. In other words, it seems CW doesnt recognize these as registers for the XDT512 MCU and assumes they are some sort of variable that has not been declared.

This is silly! I have also tried this with a new project using the XDP512 derivitive (since it is the only data sheet actually available), but same problem. For good measure, I tried to compile my code in a new project with C32 derivitive on this new codewarrior, and it has no problem with those registers.

Ok, sorry this is long winded. It is not a complicated problem. I just wanted to be perfectly clear about what is going on. I actually need help pretty quickly on this because I am now behind schedule in trying to port this over to a newly aquired MCU. Please help!
Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,317 Views
gruuvin
Contributor II
"Well my first suggestion would be to look at the register definition file."

Thank you! This got me in the right direction.

:smileyhappy:

View solution in original post

0 Kudos
Reply
3 Replies
1,317 Views
CrasyCat
Specialist III
Hello
 
Well my first suggestion would be to look at the register definition file.
 
Check is SCIBDL is really called that way or if the naming is different. You may have to adjust your C32 register names to the names defined in the DT512 register definition file.
 
Alternatively you can define macros (#define) to remap  SCIBDL (and the other registers) to whatever their name is on the new device.
 
CrasyCat
0 Kudos
Reply
1,318 Views
gruuvin
Contributor II
"Well my first suggestion would be to look at the register definition file."

Thank you! This got me in the right direction.

:smileyhappy:
0 Kudos
Reply
1,317 Views
J2MEJediMaster
Specialist I
First, check to see that your project is actually using the derivative files mc9s12xdt512.h, mc9s12xdt512.c, and mc9s12xdt512.inc (for assembly). If the project is using other header files, you'll have problems.

Second, check to see if the compiler command line (use the HC12 Compiler Options settings panel) is set to generate code for the correct processor. It should be set to generate code for the HCS12X family (-CPUHCS12X). It shouldn't make that much of a difference, but you want to cover every possibility here.

---Tom

0 Kudos
Reply