ST72361J6 STMicroelectronics, ST72361J6 Datasheet - Page 219

no-image

ST72361J6

Manufacturer Part Number
ST72361J6
Description
8-bit MCU
Manufacturer
STMicroelectronics
Datasheet

Specifications of ST72361J6

Hdflash Endurance
100 cycles, data retention 40 years at 85°C
5 Power Saving Modes
Halt, Auto Wake Up From Halt, Active Halt, Wait and Slow
IMPORTANT NOTES (Cont’d)
software sequence is given for both cases (global
interrupt disabled/enabled).
Case 1: Writing to PxOR or PxDDR with Global In-
terrupts Enabled:
LD A,#01
LD sema,A
LD A,PFDR
AND A,#02
LD X,A
PxOR/PxDDR
LD A,#$90
LD PFDDR,A ; Write to PFDDR
LD A,#$ff
LD PFOR,A
LD A,PFDR
AND A,#02
LD Y,A
PxOR/PxDDR
LD A,X
cp A,#02
jrne OUT
TNZ Y
jrne OUT
LD A,sema
edge is detected
CP A,#01
jrne OUT
call call_routine; call the interrupt routine
OUT:LD A,#00
LD sema,A
.call_routine
PUSH A
PUSH X
PUSH CC
.ext1_rt
LD A,#00
LD sema,A
IRET
Case 2: Writing to PxOR or PxDDR with Global In-
terrupts Disabled:
SIM
LD A,PFDR
AND A,#$02
; set the interrupt mask
; set the semaphore to '1'
; store the level before writing to
; store the level after writing to
; check for falling edge
; check the semaphore status if
; entry to call_routine
; entry to interrupt routine
; Write to PFOR
LD X,A
PxOR/PxDDR
LD A,#$90
LD PFDDR,A; Write into PFDDR
LD A,#$ff
LD PFOR,A
LD A,PFDR
AND A,#$02
LD Y,A
PxDDR
LD A,X
cp A,#$02
jrne OUT
TNZ Y
jrne OUT
LD A,#$01
LD sema,A ; set the semaphore to '1' if edge is
detected
RIM
LD A,sema ; check the semaphore status
CP A,#$01
jrne OUT
call call_routine; call the interrupt routine
RIM
OUT:
JP while_loop
.call_routine ; entry to call_routine
PUSH A
PUSH X
PUSH CC
.ext1_rt
LD A,#$00
LD sema,A
IRET
16.1.4 Unexpected Reset Fetch
If an interrupt request occurs while a "POP CC" in-
struction is executed, the interrupt controller does
not recognise the source of the interrupt and, by
default, passes the RESET vector address to the
CPU.
Workaround
To solve this issue, a "POP CC" instruction must
always be preceded by a "SIM" instruction.
; store the level before writing to
; store the level after writing to PxOR/
; check for falling edge
RIM
; entry to interrupt routine
; reset the interrupt mask
; Write to PFOR
ST72361
219/225

Related parts for ST72361J6