Ruth Hendrix

Resetting HCS12 using software

Discussion created by Ruth Hendrix Employee on Jan 28, 2006
Latest reply on Aug 25, 2009 by william rodriguez
This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.
Posted: Tue Sep 20, 2005 5:40 pm    
Is it possible, to cause the HCS122 to reset itself using softare.
Posted: Wed Sep 21, 2005 8:09 pm    
yes surely

just activate the cop, register COPCTL
and trigger directly with a false value written to the ARMCOP register.

Normally you would write 0x55 and then 0xAA; try some other value and you will get a reset at once

COPCTL = 0x01; // cop activated with shortest timeout
ARMCOP = 0x47; // her we will get kicked by the dog
Posted: Thu Sep 22, 2005 4:55 pm    
 am assuming that Quantum needs to "simulate" a Power-On reset.
If you make sure that the COP reset vector is the same as the Power-On reset vector, Cristian's method should work perfectly.

I tried the suggested approach, it didn't work with me. I read a little in the "CPU12 Reference Manual" and figured the reason is probably that the HC12 differentiates between 4 types of Reset (Power-On, External Reset, COP/Watchdog and Clock Monitor Reset). The first two types use the same Reset vector, the other two have their own vectors.

Another possibility which I have used is to wire the (open drain) /RESET pin to an I/O pin (possibly with a diode in between?). Now if you make the I/O pin be a LOW output, it resets the controller (making the I/O pin an input).

a) without the diode the I/O pin should not be set to be a HIGH output (potential short-circuit)
b) this is not a pure SW method