5756 views|1 replies

1379

Posts

0

Resources
The OP
 

AT89S51 watchdog program example [Copy link]

AJMP MAIN

MAIN:

;Start watchdog
Mov 0A6H,#01EH ;Send 1E first
Mov 0A6H,#0E1H ;Send E1 later

; Main program
START:

ACALL WDT ;Call reset watchdog subroutine

AJMP START

;Main program

;Reset watchdog subroutine
WDT:
Mov 0A6H,#01EH ;Send 1E first
Mov 0A6H,#0E1H ;Send E1 later
RET

END

Notes:
1. The watchdog of 89S51 must be activated by the program before it starts working. Therefore, it is necessary to ensure that the CPU has a reliable power-on reset.
Otherwise, the watchdog will not work.
2. The watchdog uses the crystal oscillator of the CPU. When the crystal oscillator stops oscillating, the watchdog is also invalid.
3. 89S51 has only a 14-bit counter. The watchdog must be fed at least once in 16383 machine cycles. And this time is
fixed and cannot be changed. When the crystal oscillator is 12M, the watchdog needs to be fed once every 16 milliseconds.

This post is from 51mcu

Latest reply

Finally, I don't understand why it is 14 bits, is it a dedicated counter for the watchdog?  Details Published on 2011-2-8 10:48
 

7815

Posts

57

Resources
2
 
Finally, I don't understand why it is 14 bits, is it a dedicated counter for the watchdog?
This post is from 51mcu
 
Personal signature

强者为尊,弱者,死无葬身之地

 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list