![background image](http://html1.mh-extra.com/html/premio/vio-100-pc100-series/vio-100-pc100-series_user-manual_1596728103.webp)
VIO-100(200)/PC100 | User’s Manual
103
WDT Sample Code
Sample Code:
Set watchdog timer to 30 seconds
AddrPort =0x4e;
DataPort=0x4f;
SIO_UNLOCK_VALUE=0x87;
SIO_LOCK_VALUE=0xaa;
WATCHDOG_LDN=0x07;
WDT_ UNIT=0x60; // 0x60=sec, 0x68=min, 0x40=disable watchdog timer
WDT_TIMER= 30;
// Set watchdog timer to 30 seconds
// enable config mode, switch WDT configuration
WriteByte(AddrPort, SIO_UNLOCK_VALUE);
usleep(4000); //delay
WriteByte(AddrPort, SIO_UNLOCK_VALUE);
WriteByte(AddrPort, 0x07);
WriteByte(DataPort, WATCHDOG_LDN);
// activate wdt
WriteByte(AddrPort, 0x30);
data=ReadByte(DataPort);
data=data|0x01;
WriteByte(DataPort, data);
// set timer value
WriteByte(AddrPort, 0xf6);
WriteByte(DataPort, WDT_TIMER);
// set unit
WriteByte(AddrPort, 0xf5);
WriteByte(DataPort, WDT_UNIT);
// enable reset
WriteByte(AddrPort, 0xfa);
data=ReadByte(DataPort);
data=data|0x01;
WriteByte(DataPort, data);
// close config mode
WriteByte(AddrPort, SIO_LOCK_VALUE);
Appendix – WDT & GPIO
Содержание VIO-100/PC100 Series
Страница 1: ...USER S MANUAL VIO 100 PC100 Series VIO 200 PC100 Series Industrial Panel PCs ...
Страница 13: ...Chapter 1 Product Introductions ...
Страница 44: ...Chapter 2 Switches and Connectors ...
Страница 60: ...Chapter 3 Front Panel Controls ...
Страница 65: ...Chapter 4 System Setup ...
Страница 80: ...VIO 100 200 PC100 User s Manual 3 Lock the below 6 screws M4X5L to finish assembly 80 Chapter 4 System Setup ...
Страница 81: ...Chapter 5 BIOS Setup ...
Страница 102: ...Appendix WDT GPIO This appendix provides the sample codes of WDT Watch Dog Timer and GPIO General Purpose Input Output ...
Страница 107: ...Copyright Premio Inc All Rights Reserved www premioinc com ...