Today I found a book said that we can set some vector process function to do user settings, and then I began to use some vectors, and I wrote a oscillator vector process function and watchdog vector process function, but when a watchdog reset happens, the mcu just reset and didn't go into the function, and when my oscillator was disturbed by outside electromagnetic ,I thought that the mcu may reset ,and the source is oscillator monitor interrupt, but it also reset,and didn't go into my process.
I wonder if the process is valid ,and I also want to write a vector of all of reset to debug our program to find out the source of reset, Does this practicable ?
Hi,
COP recognition and principles are described in
S12 FAMILY DEVICES COP RECOGNITION CONSIDERATIONS_v2.0.pdf
S12 FAMILY DEVICES COP RECOGNITION CONSIDERATIONS - calculator.xlsx
As a development platform I can provide you code for different MCU but principle and code is the same. (attached)
I see your issue in COP recognition (capacitor on reset pin) and probably usage of local variable in the COP subroutine (the variable can be placed onto stack by compiler and after reset there is no stack initialized.
Note, the S12P (used in example) has the same reset timing as S12HY. I mention it because S12HY is not mentioned in the documents I presented above.
Best regards,
Ladislav