Remi Forcet

MC9S0AC16 I/O direction lost at wake up from Stop3 until registers are re-initialised.

Discussion created by Remi Forcet on Jun 22, 2012
Latest reply on Jun 22, 2012 by bigmac



I am using the MC9S08AC16 micro

The program I am working on makes the uP go to sleep (Stop3) about 20 seconds after power up, then it gets awaken by IRQ.

All outputs I am using then seem to change into inputs until all the registers are configured properly.

This is a problem because this means outputs are floating for about 2ms.


I have been using the CodeWarrior debugger, and I could see that pin E1 would be an input right after wake up/power up and set properly as an output only after this code:


 for( x = 0; x <= 13; x++ )    /* load registers 0 to 13 */
     *((near byte *) x) = register_setup[x];


I would like the uP to keep the same data direction after wake up as before (Note that the I/O direction is kept OK during sleep)

Can you help?