|
This letter describes Watch Dog Timer Function. User can easy to implement WDT step by step as
below example.
1-1 The Watch Dog Timer output pin (OD) is in Pin 2. This is active low level signal.
1-2 The Watch Dog Timer is disabled when the Pin 24 power-on tripped to low (default).
1-3 The Watch Dog Timer is enabled when the Pin 24 power-on tripped to high with 4.7K ohm. The time
is 10 second when the clock input is 24MHz. The Time is 5 second when the clock input is 48MHz.
1-4 Example setting Watch Dog Timer address is used 0x300 and 0x301.
outportb(0x4e, 0x77);
outportb(0x4e, 0x77); //Entry configuration mode
outportb(0x4e, 0x07); //Select register index 0x07.
outportb(0x4f, 0x08); //Select LDN 8
outportb(0x4e, 0x60); //Select LDN 8 register index 0x60
outportb(0x4f, 0x03); //Set Watch Dog timer base address high byte to 0x03
outportb(0x4e, 0x61); //Select LDN 8 register index 0x61
outportb(0x4f, 0x00); //Set Watch Dog Timer base address low byte to 0x00
outportb(0x4e, 0x30); //Select LDN 8 register index 0x30
outportb(0x4f, 0x01); //Enable Watch Dog Timer Device
outportb(0x4e, 0xaa); //Exit configuration mode
1-5 Example setting Watch Dog Timer is 20 second (address used 0x300 and 0x301).
outportb(0x300, 0x03); //Select unit to one second and clear time out status
outportb(0x301, 0x14);
outportb(0x301, 0x14); //Set timer to 20 second and enable timer
1-6 Example Reset Watch Dog Timer to 20 second (before time-out)
inportb(0x301); //Reset timer to 20 second
(** When read this register, WDT will re-start action.)
1-7 Example Disable Watch Dog Timer (before time-out)
outportb(0x301, xx); // Disabled timer,, xx is not setting data.
需求是
1、OS正常启动,系统启动以后加载watchdog。
2、启动watchdog程序,watchdog程序初始化watchdog定时器,并循环喂狗(定时刷新watchdog硬件中的定时器)。
3、当watchdog程序退出/或者系统软件/硬件当机(并不再喂狗时),系统自动复位重启。
联系方式QQ 8879811 手机:13264156660
需要一段C代码,酬劳500圆,我人在北京上地 |
|