mg84fl54 Megawin Technology, mg84fl54 Datasheet - Page 61

no-image

mg84fl54

Manufacturer Part Number
mg84fl54
Description
Full-speed Usb Micro-controller
Manufacturer
Megawin Technology
Datasheet
15.3. Wake-up from Power-Down
To exit from Power-Down mode, it is recommended to insert at least one NOP instruction following the
instruction that invokes Power-Down mode (See Fig 15-2). The NOP instruction is used to eliminate the
possibility of unexpected code execution when returning from the interrupt service routine.
Fig 15-2 Example Wake-up from Power-Down
;******************************************************************************************
; Wake-up-from-power-down by /INT0 interrupt
;******************************************************************************************
INT0
EA
EX0
;
IE0_isr:
;
start:
Resume_operation:
;
Note:
MEGAWIN
/INT0 is used in this example
BIT
BIT
BIT
CSEG
JMP
CSEG
JMP
CLR
;... do something
;...
RETI
;...
;...
SETB
CLR
SETB
SETB
SETB
ORL
NOP
;If /INT0 is triggered by a falling-edge, the CPU will wake up, enter "IE0_isr",
;and then return here to run continuously !
;...
;...
0B2H
0AFH
0A8H
AT
start
AT
IE0_isr
EX0
INT0
IE0
IT0
EA
EX0
PCON,#02h
0000h
0003h
;P3.2
;IE.7
;IE.0
;/INT0 interrupt vector, address=0003h
;pull high P3.2
;clear /INT0 interrupt flag
;may select falling-edge/low-level triggered
;enable global interrupt
;enable /INT0 interrupt
;put CPU into power-down mode
;! Note: here must be a NOP
MG84FL54B Data sheet
61

Related parts for mg84fl54