Sample Code; Project Name: Swwdt - Fujitsu F2MC-8FX MB95200H/210H Series Application Note

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

Advertisement

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;
}
/*---------------------------------------------------------------------------
name: main();
function: main loop
-----------------------------------------------------------------------------*/
void main(void)
{
PDR0_P05 = 0;
DDR0_P05 = 1;
InitWDT ();
WATCHDOG TIMER V1.1
Chapter 7 Appendix
// set count clock is 2
// start WDT counter
// initial value
// set P05 as output
MCU-AN-500013-E-11 – Page 16
21
/F
CH

Advertisement

Table of Contents
loading

Table of Contents