Register address is wrong.

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

Register address is wrong.

Jump to solution
747 Views
100asong
Contributor I

My CPU:9s12DP512.

 

void main(void)
{     
  MMCCTL1 =  1;                 
  /* DIRECT: DP15=0,DP14=0,DP13=0,DP12=0,DP11=0,DP10=0,DP9=0,DP8=0 */
  DIRECT = 0;                  
  /* IVBR: IVB_ADDR=255 */
  IVBR = 255;     
  
  ECLKCTL = 64;

 

  while(1);

}

 

 

some warning information here:

 

L1823: External object _MMCCTL1 in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default


L1823: External object _DIRECT in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default


L1823: External object _IVBR in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default


L1823: External object _ECLKCTL in E:\TestXgate\Project_2_Data\Standard\ObjectCode\main.c.o created by default

 

And then I debug it by BDM, find that :

MMCCTL1 address changed from 0x0013 t0 0x0000(Compiler setting).

DIRECT address is okay.

ECLKCTL address is wrong ,change to 0x03.

 

Why it is not right address.

Labels (1)
0 Kudos
1 Solution
519 Views
CrasyCat
Specialist III

Hello

 

- Which version of CodeWarrior are you using?
  To retrieve that info:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.

 

- How did you create the project? Did you use the project wizard?

  Project created with the wizard have all the required files to get you up and running quickly. 

 

Here you are obviously missing the definition for all the I/O registers.

I would recommend you to add the file mc9s12dp512.c (assuming you are using a mc9s12dp512 MCU) which contains the I/O definition for the various registers to your project.

 

There is something strange here though.

Register MMCCTL1 is only available in HCS12XE cores. How did you get it initialized in your startup code?

 

CrasyCat

View solution in original post

0 Kudos
1 Reply
520 Views
CrasyCat
Specialist III

Hello

 

- Which version of CodeWarrior are you using?
  To retrieve that info:
    - Start CodeWarrior
    - Select Help -> About Freescale CodeWarrior
    - Click on "Install Products"
    - CodeWarrior version used is displayed on top in the Installed Products dialog.

 

- How did you create the project? Did you use the project wizard?

  Project created with the wizard have all the required files to get you up and running quickly. 

 

Here you are obviously missing the definition for all the I/O registers.

I would recommend you to add the file mc9s12dp512.c (assuming you are using a mc9s12dp512 MCU) which contains the I/O definition for the various registers to your project.

 

There is something strange here though.

Register MMCCTL1 is only available in HCS12XE cores. How did you get it initialized in your startup code?

 

CrasyCat

0 Kudos