Appendix
MI979 Series
User’s Manual
75
2.
Sample Code: The file MAIN.CPP
//---------------------------------------------------------------------------
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
// PURPOSE.
//
//---------------------------------------------------------------------------
#include <dos.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include "NCT6116D.H"
//---------------------------------------------------------------------------
int main (void);
void WDTInitial(void);
void WDTEnable(unsigned char);
void WDTDisable(void);
//---------------------------------------------------------------------------
int main (void)
{
char SIO;
SIO = Init_NCT6116D();
if (SIO == 0)
{
printf("Can not detect Nuvoton NCT6116D, program abort.\n");
return(1);
}
WDTInitial();
WDTEnable(10);
WDTDisable();
return 0;
}
//---------------------------------------------------------------------------
void WDTInitial(void)
{
unsigned char bBuf;
Set_NCT6116D_LD(0x08);
//switch to logic device 8
bBuf = Get_NCT6116D_Reg(0x30);
bBuf &= (~0x01);
Set_NCT6116D_Reg(0x30, bBuf);
//Enable WDTO
}
//---------------------------------------------------------------------------
Summary of Contents for MI979 Series
Page 5: ...MI979 Series User s Manual v This page is intentionally left blank ...
Page 8: ...viii MI979 Series User s Manual This page is intentionally left blank ...
Page 14: ...6 MI979 Series User s Manual 1 6 Block Diagram ...
Page 17: ...General Information MI979 Series User s Manual 9 1 1 8 Dimensions ...
Page 18: ...10 MI979 Series User s Manual This page is intentionally left blank ...
Page 42: ...34 MI979 Series User s Manual This page is intentionally left blank ...
Page 50: ...42 MI979 Series User s Manual This page is intentionally left blank ...
Page 76: ...68 MI979 Series User s Manual This page is intentionally left blank ...