PPC65B-1x/Setup and Installation
v1.0
www.winsystems.com
Page 21
7.13 Reset CMOS BIOS Configuration
Jumpers can be used to reset the BIOS CMOS settings to the factory default. Enable/
disable the Clear CMOS Function hardware circuit, by placing or removing the jumper
from JP1 as needed. See “Reset CMOS BIOS Configuration” on page 56 for usage.
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 7–2:
Example code for WDT (Continued)