![background image](http://html1.mh-extra.com/html/ibase-technology/mbd301/mbd301_user-manual_605016063.webp)
Appendix
MBD301
User’s Manual
55
printf("Fintek 81846 watch dog program\n");
SIO = Init_F81846();
if (SIO == 0)
{
printf("Can not detect Fintek 81846, program abort.\n");
return(1);
}//if (SIO == 0)
if (argc != 2)
{
printf(" Parameter incorrect!!\n");
return (1);
}
bTime = strtol (argv[1], endptr, 10);
printf("System will reset after %d seconds\n", bTime);
if (bTime)
{
EnableWDT(bTime); }
else
{
DisableWDT(); }
return 0;
}
//---------------------------------------------------------------------------
void EnableWDT(int interval)
{
unsigned char bBuf;
bBuf = Get_F81846_Reg(0x2B);
bBuf &= (~0x20);
Set_F81846_Reg(0x2B, bBuf);
//Enable WDTO
Set_F81846_LD(0x07);
//switch to logic device 7
Set_F81846_Reg(0x30, 0x01);
//enable timer
bBuf = Get_F81846_Reg(0xF5);
bBuf &= (~0x0F);
bBuf |= 0x52;
Set_F81846_Reg(0xF5, bBuf);
//count mode is second
Set_F81846_Reg(0xF6, interval);
//set timer
bBuf = Get_F81846_Reg(0xFA);
bBuf |= 0x01;
Set_F81846_Reg(0xFA, bBuf);
//enable WDTO output
bBuf = Get_F81846_Reg(0xF5);
bBuf |= 0x20;
Set_F81846_Reg(0xF5, bBuf);
//start counting
}
//---------------------------------------------------------------------------
void DisableWDT(void)
{
unsigned char bBuf;
Set_F81846_LD(0x07);
//switch to logic device 7
Summary of Contents for MBD301
Page 8: ...viii MBD301 User s Manual This page is intentionally left blank ...
Page 13: ...General Information MBD301 User s Manual 5 1 1 6 Block Diagram ...
Page 16: ...8 MBD301 User s Manual This page is intentionally left blank ...
Page 42: ...34 MBD301 User s Manual ...
Page 49: ...BIOS Setup MBD301 User s Manual 41 4 4 4 6 CPU Configuration 4 4 7 USB Configuration ...