编程示例 - Advantech ITA-3650G Series User Manual

Compact fanless embedded high-performance industrial computer
Hide thumbs Also See for ITA-3650G Series:
Table of Contents

Advertisement

Available languages

Available languages

A.3
编程示例
1.
启用看门狗定时器,并将超时间隔设置为 10 秒。
;-----------------------------------------------------------
Mov dx,A65h ; 选择寄存器 65h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 65h
Mov al,80h ; 将计时单位设置为秒
Out dx,al
Mov dx,A66h ; 选择寄存器 66h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 66h
Mov al,10
; 将超时间隔设置为 10 秒然后开始计时
Out dx,al
;-----------------------------------------------------------
2.
启用看门狗定时器功能并将超时间隔设置为 5 分钟。
;-----------------------------------------------------------
Mov dx,A65h ; 选择寄存器 65h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 65h
Mov al,00h ; 将计时单位设置为分钟
Out dx,al
Mov dx,A66h ; 选择寄存器 66h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 66h
Mov al,5
; 将超时间隔设置为 5 分钟然后开始计时
Out dx,al
;-----------------------------------------------------------
3.
启用鼠标复位看门狗定时器功能。
;-----------------------------------------------------------
Mov dx,A67h ; 选择寄存器 67h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 67h
In al,dx
Or al,4h
Out dx,al
;-----------------------------------------------------------
4.
启用键盘复位看门狗定时器功能。
;-----------------------------------------------------------
Mov dx,A67h ; 选择寄存器 67h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 67h
In al,dx
Or al,2h
Out dx,al
;-----------------------------------------------------------
5.
定时器不计时时,产生超时信号
;-----------------------------------------------------------
Mov dx,A68h ; 选择寄存器 68h, 看门狗定时器的 I/O 端口地址 A00h+ 寄存器偏移 68h
In al,dx
Or al,4h
Out dx,al
;-----------------------------------------------------------
; 启用鼠标复位看门狗定时器
; 启用键盘复位看门狗定时器
; 立即产生超时信号
51
ITA-3650G 系列用户手册

Advertisement

Chapters

Table of Contents
loading

Table of Contents