IBASE SI-83 User Manual

Page 75

Advertising
background image

Copyright © 2013 IBASE Technology Inc. All Rights Reserved.

67

IBASE Technology Inc.

//---------------------------------------------------------------------------

int main (void)

{

char SIO;

SIO = Init_NCT5523D();

if (SIO == 0)

{

printf("Can not detect Nuvoton NCT5523D, program abort.\n");

return(1);

}

WDTInitial();

WDTEnable(10);

WDTDisable();

return 0;

}

//---------------------------------------------------------------------------

void WDTInitial(void)

{

unsigned char bBuf;

Set_NCT5523D_LD(0x08);

//switch to logic device 8

bBuf = Get_NCT5523D_Reg(0x30);

bBuf &= (~0x01);

Set_NCT5523D_Reg(0x30, bBuf);

//Enable WDTO

}

//---------------------------------------------------------------------------

void WDTEnable(unsigned char NewInterval)

{

unsigned char bBuf;

Set_NCT5523D_LD(0x08);

//switch to logic device 8

Set_NCT5523D_Reg(0x30, 0x01);

//enable timer

bBuf = Get_NCT5523D_Reg(0xF0);

bBuf &= (~0x08);

Set_NCT5523D_Reg(0xF0, bBuf);

//count mode is second

Advertising