IIC, RTI and STOP2 MC9S08QG8 Headache!

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IIC, RTI and STOP2 MC9S08QG8 Headache!

1,174 Views
Rhioponomous
Contributor I
Hi All,
 
I am trying to use the RTI, set at a 1024 ms interval, to wake up out of STOP2.  When the MCU wakes up from STOP2 it sends out 2 bytes to a slave on the IIC bus and then go back to sleep in STOP2.  I have it working so that I can go to sleep and wake up from STOP2 using the RTI.  Separately (int another program) I have it so that I can send messages on the IIC as well as do other things in sequence (So I know it isn't stuck in the IIC write function).  When I combine the STOP2 code with the IIC code I am able to write to the IIC when the first time the CPU turns on, I am then able to go into STOP2 and then 1 second later the RTI fires and I wake up.  The problem then comes when I try to write to write to the IIC after waking up from STOP2.  When I try to STOP into STOP2, It just hangs out in STOP2 and my RTI never triggers...
 
Any help would be much appreciated!  

Labels (1)
0 Kudos
2 Replies

262 Views
Rhioponomous
Contributor I

Thanks for your response! 

 

I do re-initialize all peripherals after coming out of STOP2.

 

What is very weird is that I am able to get an ACK after I write the address byte but unable to get an ACK after I write the first byte of data after waking up from SOTP2.

 

What state are the pins held in during stop2? And is there a way to change that? 

0 Kudos

262 Views
tonyp
Senior Contributor II
Coming out of STOP2 is similar to a reset, so all peripherals must be re-initialized before using.  Do you do that?
0 Kudos