Hi,
When the reset pin is released, the MCU enters a mode of operation based on the state of MODC, MODB, MODA pins. Please refer to MC9S12DP512DGV1, Table 4-1.
So please check the states of the pins to see which mode the MCU enters without the debugger.
In Normal Single Chip mode or Emulation modes, some registers can be written only once, whereas in Special Single Chip mode anytime. The specification is always in the description of each register. So, I would check how many times you write these registers.
From your description, I’m unable to say what the MCU does. However, you can attach the debugger to running MCU (without reset). In CodeWarrior, you can choose Hotsync instead of Connect(Reset) and then halt the MCU, check registers such as MODE register.
If you are unable to Hotsync with the MCU, please check the reset pin with a scope. There is a chance the MCU keeps resetting itself.
Regards,
Daniel