B&B Electronics UNO-2170 user manual Appendix B Programming the Watchdog Timer

Page 38

Appendix B Programming the Watchdog Timer

Bellow is a sample of programming code for controlling the Watchdog Timer function.

-----------------------------------------------------------------------------------

Enter the extended function mode, interruptible double-write

-----------------------------------------------------------------------------------

MOV DX,2EH

MOV AL,87H

OUT DX,AL

OUT DX,AL

-----------------------------------------------------------------------------

Configured logical device 8, configuration register CRF6

-----------------------------------------------------------------------------

MOV DX,2EH

MOV AL,2BH

OUT DX,AL

MOV DX,2FH

IN AL,DX

AND AL.OEFH;Setbit 4=0 Pin 89=WDTO

OUT DX,AL

MOV DX,2EH

MOV AL,07H; point to Logical Device Number Reg.

OUT DX,AL

MOV DX,2FH

MOV AL,08H; select logical device 8 OUT DX,AL;

MOV DX,2EH

MOV AL,30H;Set watch dog activate or inactivate

OUT DX,AL

MOV DX,2FH

MOV AL,01H; 01:activate 00:inactivate OUT DX,AL;

MOV DX,2EH

MOV AL,F5H; Setting counter unit is second

OUT DX,AL

MOV DX,2FH

MOV AL,00H

OUT DX,AL;

MOV DX,2EH

MOV AL,F6H

OUT DX,AL

MOV DX,2FH

MOV AL,05H; Set 5 seconds

OUT DX,AL

;------------------------------------------

; Exit extended function mode

;------------------------------------------

MOV DX,2EH

MOV AL,AAH

OUT DX,AL

UNO-2170 User Manual

32

Image 38
Contents UNO-2170 Support Product Warranty Page Contents Appendix Appendix Programming the Watchdog TimerSystem Settings and Pin Assignments Overview Introduction Hardware Specifications Relative humidity 95% @ 40C Weight 1.6 kgSafety Precautions Always ground yourself to remove any static electricChassis Dimensions Chassis DimensionsPage Hardware Functionality RS-232 Interface COM1~COM2 Front panel of UNO-21702 RS-422/485 detection RS-232/422/485 Interface COM3~COM41 16C550 UARTs with 16-byte standard Automatic Data Flow Control Function for RS-485RS-422/485 jumper setting 5 RS-232/422/485 SelectionPage IRQ and Address Setting Vector address for share IRQ 1D0HPS/2 Keyboard and Mouse Connector LAN Ethernet ConnectorPower Connector USB ConnectorVGA Display Connector Pcmcia PC Card SlotLithium Battery Specification Battery Backup SramReset Button Page Initial Setup Inserting a CompactFlash Card Chassis GroundingBios Setup and System Assignments Connecting PowerInstalling a Hard Disk Page System Settings Pin Assignments Appendix a System Settings and Pin Assignments 1SystemI/OAddressandInterruptAssignmentTable A.2 UNO-2170 Interrupt Assignment Board Connectors and Jumpers Figure A.2 UNO-2170 connector and jumper locations back-sideTable A.3 UNO-2170 Connectors and Jumpers RS-232 Standard Serial Port COM1~COM2 Ethernet RJ-45 Connector LAN1~LAN2 RS-232/422/485 Serial Port COM3~COM4Phoenix Power Connector PWR USB Connector USB1~USB2 Page Programming Watchdog Timer Appendix B Programming the Watchdog Timer AppendixB