Hi Kef, thanks for your reply!
I'm using MC9S12A256.
You were right about SMCE being write once, I passed over that. Now, I'm writing PLLCTL once, with the value 0xE0.
Anyway, same thing happend.
It's strange, because it seems like self-clok mode were enable, because I've got a buzzer wich plays a tone everytime a key is stoke. When I introduce some noise over the XTAL line, while I'm stroking keys, the sound plays slowly as if the bus speed were slowly. Other times, happens what I'm mention in the other post, the MCU just remains still, frozen.
I didn't understand your last question:
Jump from ISR to _Startup works only if you are not assuming reset-default register values and initialize every register, which you are using in your code. Is it the case?
I'm jumping from ISR to _Startup... and register values are written inside the main function. The value written to PLLCTL is as I said before, 0xE0 (Self-Clock Mode Disable)
Now, I also have PLL LOCK IRQ disable... I just want the MCU to restart everytime the clock monitor fails
One more thing I'm discussing with the team here. The way I'm introducing noise over the XTAL line is by touching it (with my finger). What happend if I touch it fot too long (a second or two)? Let's assume the Crystal Monitor works, resets the MCU and _Startup is correctly executed. If I'm not wrong, when reseted the SCME = 1 so MCU will star with self clock, then when PLLCTL is written SCME = 0... Is it possible that the MCU won't start correctly because the XTAL is still noisy?
Thanks!