Fujitsu F2MC-8FX MB95200H/210H Series Application Note
Fujitsu F2MC-8FX MB95200H/210H Series Application Note

Fujitsu F2MC-8FX MB95200H/210H Series Application Note

8-bit microcontroller watchdog timer
Hide thumbs Also See for F2MC-8FX MB95200H/210H Series:

Advertisement

Quick Links

Fujitsu Microelectronics (Shanghai) Co., Ltd.
MCU-AN-500013-E-11
Application Note
F²MC-8FX FAMILY
8-BIT MICROCONTROLLER
MB95200H/210H SERIES
WATCHDOG TIMER
APPLICATION NOTE

Advertisement

Table of Contents
loading

Summary of Contents for Fujitsu F2MC-8FX MB95200H/210H Series

  • Page 1 Fujitsu Microelectronics (Shanghai) Co., Ltd. MCU-AN-500013-E-11 Application Note F²MC-8FX FAMILY 8-BIT MICROCONTROLLER MB95200H/210H SERIES WATCHDOG TIMER APPLICATION NOTE...
  • Page 2: Revision History

    To obtain up-to-date information and/or specifications, contact your Fujitsu sales representative or Fujitsu authorized distributor. 2. Fujitsu will not be liable for infringement of copyright, industrial property right, or other rights of a third party caused by the use of information or drawings described in this manual.
  • Page 3: Table Of Contents

    WATCHDOG TIMER V1.1 Contents Contents REVISION HISTORY ......................2 CONTENTS .......................... 3 1 INTRODUCTION ......................4 2 WATCHDOG TIMER ......................5 Key Features ......................5 Block Diagram ......................5 Registers ......................... 6 2.3.1 Watchdog Timer Control Register (WDTC) ..........6 2.3.2 Watchdog Timer Selection ID Register (WDTH, WDTL) ......
  • Page 4: Introduction

    WATCHDOG TIMER V1.1 Chapter 1 Introduction 1 Introduction This application note describes how to use the watch-dog timer. The application note describes the functions of the watchdog timer and gives some examples. MCU-AN-500013-E-11 – Page 4...
  • Page 5: Watchdog Timer

    WATCHDOG TIMER V1.1 Chapter 2 Watchdog Timer 2 Watchdog Timer Basic function of the watchdog timer 2.1 Key Features The watchdog timer functions as a counter used to prevent program from running out of control. Once the watchdog timer is activated, its counter needs to be cleared at specified intervals regularly.
  • Page 6: Registers

    WATCHDOG TIMER V1.1 Chapter 2 Watchdog Timer 2.3 Registers Please refer to Chapter 11 and Chapter 22 of MB95200H/210H Series Hardware Manual for detailed register setting. 2.3.1 Watchdog Timer Control Register (WDTC) This register is used to activate or clear the watchdog timer. Address bit7 bit6...
  • Page 7: Nvr (Non-Volatile Register) Function

    WATCHDOG TIMER V1.1 Chapter 2 Watchdog Timer 2.4 NVR (Non-Volatile Register) function The NVR interface enables users to select hardware or software watchdog timer by modifying the 16-bit watchdog timer selection ID. Please note that the watchdog timer selection ID cannot be modified while the CPU is running, therefore please modify NVR in Flash Area first, then the MCU will copy these values to NVR interface (IO Area) automatically after a reset.
  • Page 8: Interval Time

    WATCHDOG TIMER V1.1 Chapter 3 Interval time 3 Interval time This section describes the interval time of the watchdog timer The interval times of the watchdog timer are shown in Table 3-1. If the counter of watchdog timer is not cleared, a watchdog reset is generated between the minimum time and the maximum time.
  • Page 9: Usage And Examples

    WATCHDOG TIMER V1.1 Chapter 4 Usage and Examples 4 Usage and Examples Functions and examples for watchdog timer This section describes the usage of watchdog timer and gives some examples. 4.1 Functions and Operations of watchdog timer Please write certain values to NVR flash area address FFBE and FFBF to choose the watchdog timer operation mode.
  • Page 10: Software Watchdog Timer

    The following example shows how to set up watchdog Timer for operation with software mode. /* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. /* FUJITSU MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY /* FOR ANY ERRORS OR ELIGIBILITY FOR ANY PURPOSES. (C) Fujitsu Microelectronics (Shanghai) Co., LTD.
  • Page 11: Hardware Watchdog Timer

    The following example shows how to set watchdog timer for operating in hardware mode. /* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. /* FUJITSU MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY /* FOR ANY ERRORS OR ELIGIBILITY FOR ANY PURPOSES.
  • Page 12: Note On Using Watchdog Timer

    WATCHDOG TIMER V1.1 Chapter 5 Note on Using Watchdog Timer 5 Note on Using Watchdog Timer Take account of the following points when using the watchdog timer. Stopping the watchdog timer Once activated, the watchdog timer cannot be stopped until a reset is generated. If a HWWDT is select, it will resume operation after a reset.
  • Page 13: Additional Information

    WATCHDOG TIMER V1.1 Chapter 6 Additional Information 6 Additional Information For more information on FUJITSU MICROELECTRONICS Products, please visit the following website at: Simplified Chinese Version: http://www.fujitsu.com/cn/fmc/services/mcu/mb95200/ English Version: http://www.fujitsu.com/cn/fmc/en/services/mcu/mb95200/ MCU-AN-500013-E-11 – Page 13...
  • Page 14: Appendix

    WATCHDOG TIMER V1.1 Chapter 7 Appendix 7 Appendix 7.1 List of Figures Figure 2-1: Block Diagram of Watchdog Timer ............... 5 Figure 2-2: WDTC ........................6 Figure 2-3: Watchdog Timer Selection ID Register (WDTH, WDTL) ........6 Figure 2-4: Retrieval of NVR during Reset ................7 Figure 3-1: Clearing Timing and Interval Time of Watchdog Timer .........
  • Page 15: List Of Tables

    WATCHDOG TIMER V1.1 Chapter 7 Appendix 7.2 List of Tables Table 2-1: Watchdog Timer Selection ID ................7 Table 3-1: Interval Times of Watchdog Timer ................. 8 MCU-AN-500013-E-11 – Page 15...
  • Page 16: Sample Code

    WATCHDOG TIMER V1.1 Chapter 7 Appendix 7.3 Sample Code 7.3.1 Project Name: SWWDT Software watchdog timer main.c #include "mb95200.h" /*--------------------------------------------------------------------------- name: Delay(); function: delay function -----------------------------------------------------------------------------*/ void Delay (unsigned int i) while(i--) asm("\tNOP"); /*--------------------------------------------------------------------------- name: InitWDT(); function: initial watchdog timer -----------------------------------------------------------------------------*/ void InitCompTimer (void) WDTC = 0x05;...
  • Page 17 WATCHDOG TIMER V1.1 Chapter 7 Appendix while(1) PDR0_P05 = ~PDR0_P05; // show program is normal run Delay (500); WDTC |= 0x05; // clear WDT timer within a certain amount of time startup.asm ;-------------------------------------------------------------------------- ; variable define declaration ;-------------------------------------------------------------------------- #define HWD_DISABLE ;...
  • Page 18: Project Name: Hwwdt

    WATCHDOG TIMER V1.1 Chapter 7 Appendix 7.3.2 Project Name: HWWDT Hardware watchdog main.c #include "mb95200.h" /* Hardware watchdog timer starts automatically after a reset and cannot be stopped */ /* The internal time is fixed to 2 /*--------------------------------------------------------------------------- name: Delay(); function: delay function -----------------------------------------------------------------------------*/ void Delay (unsigned int i)
  • Page 19 WATCHDOG TIMER V1.1 Chapter 7 Appendix startup.asm ;-------------------------------------------------------------------------- ; variable define declaration ;-------------------------------------------------------------------------- ;#define HWD_DISABLE ; if define this, Hard Watchdog will disable. ;-------------------------------------------------------------------------- ; Hard Watchdog ;-------------------------------------------------------------------------- #ifdef HWD_DISABLE .SECTION WDT, CONST, LOCATE=H FFBE .DATA.W 0xA596 #endif MCU-AN-500013-E-11 – Page 19...

Table of Contents