AnsweredAssumed Answered

how to goto VECTOR 2

Question asked by everk image on Apr 9, 2020
Latest reply on Apr 9, 2020 by everk image

My mcu is MC9S12XE.The Vector 0 is __Startup(),it's the default startup routine.And Vector 2 is __cop_reset_startup(),just like:

 

byte gb_flag = 0x00;

void __cop_reset_startup(void)

{

   Init();

   gb_flag = 0x55;

   main();

}

 

In main(),cop is enabled without feeding,after about 1 seconds later,system restart but don't goto __cop_reset_startup(),cause gb_flag == 0x00;

 

Also i change "VECTOR 2 __cop_reset_startup" to "VECTOR ADDRESS 0xFFFA __cop_reset_startup",result is same.

 

I debug the project and find that when system restart,PC is equal to 0xFF13.

Outcomes