English
Language : 

MC68HC908AT32 Datasheet, PDF (90/378 Pages) Freescale Semiconductor, Inc – Microcontrollers
System Integration Module (SIM)
SBSW can be read within the break state SWI routine. The user can modify the return address on the
stack by subtracting one from it. The following code is an example of this. Writing 0 to the SBSW bit
clears it.
; This code works if the H register has been pushed onto the stack in the break
; service routine software. This code should be executed at the end of the
; break service routine software.
HIBYTE EQU 5
LOBYTE EQU 6
;
If not SBSW, do RTI
BRCLR SBSW,SBSR, RETURN ; See if wait mode or stop mode was exited
; by break.
TST LOBYTE,SP
; If RETURNLO is not zero,
BNE DOLO
; then just decrement low byte.
DEC HIBYTE,SP
; Else deal with high byte, too.
DOLO DEC LOBYTE,SP
; Point to WAIT/STOP opcode.
RETURN PULH
RTI
; Restore H register.
7.7.2 SIM Reset Status Register
This read-only register contains flags to show reset sources. A power-on reset sets the POR flag and
clears all other flags. Reset sources other than power-on reset do not clear all other flags.
Reading the reset status register clears all reset flags. Reset service can read the reset status register to
clear the register after power-on reset and to determine the source of any subsequent reset.
NOTE
Only a read of the reset status register clears all reset flags. After multiple
resets from different sources without reading the register, multiple flags
remain set.
Address: $FE01
Bit 7
6
5
4
3
2
Read: POR
PIN
COP
ILOP
ILAD
0
Write:
Reset: 1
X
0
0
0
0
= Unimplemented
X = Indeterminate
1
Bit 0
LVI
0
X
0
Figure 7-18. SIM Reset Status Register (SRSR)
POR — Power-On Reset Flag
1 = Power-on reset since last read of RSR
0 = Read of RSR since last power-on reset
PIN — External Reset Flag
1 = External reset since last read of RSR
0 = Power-on reset or read of RSR since last external reset
MC68HC908AT32 Data Sheet, Rev. 3.1
90
Freescale Semiconductor