LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 933|回复: 3

付费 求写一段代码 watchdog程序

[复制链接]
发表于 2007-2-10 17:28:05 | 显示全部楼层 |阅读模式
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圆,我人在北京上地
发表于 2007-2-20 14:09:25 | 显示全部楼层
500太少了吧
回复 支持 反对

使用道具 举报

发表于 2007-2-20 18:00:54 | 显示全部楼层
不是解决了吗?怎么又发贴了?
回复 支持 反对

使用道具 举报

发表于 2007-2-26 11:45:30 | 显示全部楼层
可惜我不在北京,不然我帮你搞。没板子不好调试的。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表