⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 watchdog.lst

📁 This program shows how to configure the watchdog timer for the following chips: Atmel 80C51RA2 A
💻 LST
字号:
C51 COMPILER V6.14h  WATCHDOG                                                              08/30/2001 15:36:06 PAGE 1   


C51 COMPILER V6.14h, COMPILATION OF MODULE WATCHDOG
OBJECT MODULE PLACED IN watchdog.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE watchdog.c DEBUG OBJECTEXTEND

stmt level    source

   1          /*------------------------------------------------------------------------------
   2          watchdog.c : Sample Program that demonstrates the watchdog timer for the
   3          following microcontrollers
   4          
   5          Atmel Wireless & uC 80C51RA2
   6          Atmel Wireless & uC 80C51RD2
   7          Atmel Wireless & uC 80C54X2
   8          Atmel Wireless & uC 80C58X2
   9          Atmel Wireless & uC 83/87C51RB2
  10          Atmel Wireless & uC 83/87C51RC2
  11          Atmel Wireless & uC 83/87C51RD2
  12          Atmel Wireless & uC T87C5111
  13          Atmel Wireless & uC T87C5112
  14          Atmel Wireless & uC T89C51AC2
  15          Atmel Wireless & uC T89C51CC01
  16          Atmel Wireless & uC T89C51CC02
  17          Atmel Wireless & uC T89C51IB2
  18          Atmel Wireless & uC T89C51IC2
  19          Atmel Wireless & uC T89C51RB2
  20          Atmel Wireless & uC T89C51RC2
  21          Atmel Wireless & uC T89C51RD2
  22          
  23          Copyright (c) 1988-2001 Keil Elektronik GmbH and Keil Software, Inc.
  24          All rights reserved.
  25          --------------------------------------------------------------------------*/
  26          
  27          sfr  WDTRST  =   0xA6;			 
  28          sfr  WDTPRG  =   0xA7;			 
  29          
  30          /*------------------------------------------------------------------------------
  31          rst_Watchdog() : Resets the watchdog timer to avoid microcontroller reset
  32          				   This is done by writing to the WDTRST sfr with 0x1E and 
  33          				   then 0xE1.  This will reset the timer to 0x0.
  34          ------------------------------------------------------------------------------*/
  35          void rst_Watchdog( void )
  36          {
  37   1      	WDTPRG |= 0x07;
  38   1      	WDTRST  = 0x1E;
  39   1          WDTRST  = 0xE1;
  40   1      }
  41          
  42          /*------------------------------------------------------------------------------
  43          main() : Runs a while loop that simulated a condition that will cause the 
  44          		 watchdog timer to reset the microcontroller.
  45          ------------------------------------------------------------------------------*/
  46          void main( void )
  47          {
  48   1      	int i;
  49   1      
  50   1      	// Sets the watchdog time to reset after 2^21 - 1 clock cycles 
  51   1      	
  52   1      
  53   1      	rst_Watchdog();
  54   1      	
  55   1      	//Reset Watchdog to ensure timer doesn't reset
C51 COMPILER V6.14h  WATCHDOG                                                              08/30/2001 15:36:06 PAGE 2   

  56   1      	for( i = 0; i < 500; i++)
  57   1      	{
  58   2      		rst_Watchdog();
  59   2      	}
  60   1      
  61   1      	while(1)
  62   1      	{
  63   2      	  	//Simulating a error that would cause the watchdog timer to reset processor
  64   2      	}
  65   1      }


MODULE INFORMATION:   STATIC OVERLAYABLE
   CODE SIZE        =     32    ----
   CONSTANT SIZE    =   ----    ----
   XDATA SIZE       =   ----    ----
   PDATA SIZE       =   ----    ----
   DATA SIZE        =   ----    ----
   IDATA SIZE       =   ----    ----
   BIT SIZE         =   ----    ----
END OF MODULE INFORMATION.


C51 COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -