Hi, I'm working on a project with MC9S08QD2. The CPU awake from stop mode 2 from a free count RTI every 250ms. After waking up the processor should restore the output I/O pins and check input pins before going to sleep again. My problem is how I can restore the I/Os after waking up. I know that I have to store the I/O status in RAM before going to sleep. I added this code in .prm file:
SECTIONSSOME_CONSTANTS = READ_ONLY 0x1000 TO 0x1010; /* RAM area */ENDPLACEMENTMY_CONSTANTS INTO SOME_CONSTANTS;END
and this in my .c file:
#pragma CONST_SEG MY_CONSTANTSvolatile int store_IO; /* place in global namespace */#pragma CONST_SEG DEFAULT
It seems that the the variable is not stored in RAM correctly. Can anyone help me out there? Some sample code would be help much. Thanks.