EM78P259N 管脚唤醒功能的应用
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
管脚唤醒功能的应用
义隆电子股份有限公司
第一版
2008年11月
Trademark Acknowledgments:
IBM is a registered trademark and PS/2 is a trademark of IBM.
Windows is a trademark of Microsoft Corporation.
ELAN and ELAN logo are trademarks of ELAN Microelectronics Corporation.
Copyright © 2008 by ELAN Microelectronics Corporation
All Rights Reserved
Printed in Taiwan
The contents of this specification are subject to change without further notice. ELAN Microelectronics assumes no responsibility concerning the accuracy, adequacy, or completeness of this specification. ELAN Microelectronics makes no commitment to update, or to keep current the information and material contained in this specification. Such information and material may change to conform to each confirmed order.
In no event shall ELAN Microelectronics be made responsible for any claims attributed to errors, omissions, or other inaccuracies in the information or material contained in this specification. ELAN Microelectronics shall not be liable for direct, indirect, special incidental, or consequential damages arising from the use of such information or material.
The software (if any) described in this specification is furnished under a license or nondisclosure agreement, and may be used or copied only in accordance with the terms of such agreement.
ELAN Microelectronics products are not intended for use in life support appliances, devices, or systems. Use of ELAN Microelectronics product in such applications is not supported and is prohibited.
NO PART OF THIS SPECIFICA TION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY ANY MEANS WITHOUT THE EXPRESSED WRITTEN PERMISSION OF ELAN MICROELECTRONICS.
ELAN MICROELECTRONICS CORPORA TION
Headquarters:
No. 12, Innovation Road 1 Hsinchu Science Park Hsinchu, Taiwan 308 Tel: +886 3 563-9977 Fax: +886 3 563-9966 Hong Kong:
Elan (HK) Microelectronics
Corporation, Ltd.
Flat A, 19F., World Tech Centre
95 How Ming Street, Kwun Tong
Kowloon, HONG KONG
Tel: +852 2723-3376
Fax: +852 2723-7780
elanhk@
USA:
Elan Information Technology
Group (USA)
P.O. Box 601
Cupertino, CA 95015
USA
Tel: +1 408 366-8225
Fax: +1 408 366-8225
Shenzhen:
Elan Microelectronics Shenzhen, Ltd.
3F, SSMEC Bldg., Gaoxin S. Ave. I Shenzhen Hi-tech Industrial Park (South Area), Shenzhen
CHINA 518057
Tel: +86 755 2601-0565
Fax: +86 755 2601-0500Shanghai:
Elan Microelectronics Shanghai, Ltd.
#23, Zone 115, Lane 572, Bibo Rd. Zhangjiang Hi-Tech Park Shanghai, CHINA 201203
Tel: +86 21 5080-3866
Fax: +86 21 5080-4600
EM78P259N
管脚唤醒功能的应用
目录
一、相关寄存器 (2)
1、RF(中断状态寄存器1) (2)
二、使用步骤 (2)
三、范例 (2)
EM78P259N
管脚唤醒功能的应用
EM78P259N管脚唤醒功能的应用
一、 相关寄存器
1、RF(中断状态寄存器1)
- - ADIF CMPIF ADWE CMPWE ICWE TCIF Bit 1(ICWE):Port5 输入状态改变唤醒控制使能位
0:禁止Port5输入状态改变唤醒
1:使能Port5输入状态改变唤醒
二、 使用步骤
1.PORT5唤醒口设为输入;
2.可以根据需要选择PORT5唤醒口的内部上拉或下拉;
3.读取PORT5(MOV 0X05,0X05);
4.设置寄存器RE的ICWE位为“1”,使能唤醒功能;
5.执行“SLEP”指令。
三、 范例
;************************************************
;以下程式实现的是在I/O口唤醒后P67驱动点亮LED
;************************************************
;MCU:EM78P259N
;Oscillator:crystal4MHz
;Clock:2
;WDT:Enable
;编译软件:WicePlus Version 2.6081015
INCLUDE "EM78P259N.INC"
ORG 0X00
JMP INITIAL
ORG 0X50
EM78P259N
管脚唤醒功能的应用
INITIAL:
IOR IOCE0
AND A,@0B01111111
IOW IOCE0 ;禁止WDT
MOV A,@0XFF
IOW IOC50 ;设定PORT5为输入口
MOV A,@0X00
MOV PORT6,A
IOW IOC60 ;设定PORT6为输出,初始值为低电平
MOV A,@0X00
IOW IOCD0 ;使能PORT5上拉功能
MOV A,@0x02
MOV RE,A ;使能PORT5状态改变唤醒功能
MOV PORT5,PORT5 ;读取PORT5
DISI ;禁止所有中断
SLEP ;进入睡眠模式
NOP
NOP
NOP
MOV A,@0X80
MOV PORT6,A ;点亮PORT67
JMP $。