PPC65BP-1x/Setup and Installation
v1.0
www.winsystems.com
Page 24
static void Write_EC (unsigned char index, unsigned char data)
{
IBF_Check ();
outportb (EC_CMD, EC_CMD_WRITE);
IBF_Check ();
outportb (EC_DATA, index);
IBF_Check ();
outportb (EC_DATA, data);
}
static unsigned char Read_EC (unsigned char address)
{
unsigned char data;
IBF_Check ();
outportb (EC_CMD, EC_CMD_READ);
IBF_Check ();
outportb (EC_DATA, address);
OBF_Check();
data = inportb (EC_DATA);
return data;
}
void EC_WDT_Trigger ()
{
/* WDT Counter */
Write_EC (WDT_SEC, 0x05);
/* if use minute mode */
/* Write_EC (WDT_MIN, 0x05); */
/* 0x01 is second mode */
/* 0x03 is minute mode */
Write_EC (WDT_MODE, 0x01);
}
Write_EC ((b->wdt.ec.count_m_addr & 0xFF), b->wdt.ec.timeout);
Write_EC ((b->wdt.ec.cfg_addr & 0xFF), 0x03); // WDTCFG[1:0]=11
int main ()
{
int i;
EC_WDT_Trigger ();
for (i = 0; i < 5; i++)
{
printf ("Reset counter ...................%d\n", 5 - i);
delay (1000);
}
return 0;
}
Table 5: Example code for WDT (Continued)
Summary of Contents for PPC65BP-1 Series
Page 59: ...PPC65BP 1x v1 0 www winsystems com Page 59 PPC65BP 12 Dimensions...
Page 60: ...PPC65BP 1x v1 0 www winsystems com Page 60 PPC65BP 15 Dimensions...
Page 61: ...PPC65BP 1x v1 0 www winsystems com Page 61 PPC65BP 17 Dimensions...
Page 62: ...PPC65BP 1x v1 0 www winsystems com Page 62 PPC65BP 19 Dimensions...