Software reset for MC9S12G controller

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

Software reset for MC9S12G controller

680 Views
abhijithshankarenn
Contributor I

Hi,
Can you please provide the software code for MC9S12G to do a software reset.

(For example for S32K144 there is a function name SystemSoftwareReset which does the software reset)

 

Regards

Abhijith

0 Kudos
1 Reply

673 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

In order to generate SW reset you can use COP (watchdog) by writing immediate value different from 0x55,0xAA.
See attached example.
The MCU then generates internal reset which is recognized on the basis of the RC timing constant of the circuitry connected to a reset pin. If this constant is long then POR/External reset is recognized and MCU start at reset vector 0xFFFE,0xFFFF. If the RC is short the COP is recognized and the MCU started at reset vector address 0xFFFA, 0xFFFB.
Hor RC constant works is described in the document:

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-FAMILY-DEVICES-COP-RECOGNITION-CONSIDER...

If you want to have always POR even internal reset is launched then use large Cap at the reset pin >100nF. However, if you want to be able recognize COP reset then use Cap around 10nF or less or none (R is not considered).

Moreover, I have attached an example for S12G device and COP reset processing. However, there is no solution for internal imediate COP SW reset. Because of this I have attached also example for COP at XET device. The principle of this peripheral is the same and in the file main.c you can find 3 options how to generate COP SW reset (option 2 is, I believe, the most frequently used). Of course, you will also see that comments are also the same for both devices because, as I have already written, the peripherals are the same.

Best regards,

Ladislav

0 Kudos