Programming Watchdog. Lippert Cool FrontRunner PC/104-Plus
Reklam
Reklam
Technical Manual “Cool FrontRunner” Version 2.7 17.06.2008 Page 31 of 43
-
- o 4E F0 o 4F 00
Now all GPIOs are set as outputs. Writing to configuration register F1h sets the GPIO’s value, when it is set as an output:
- o 4E F1
- o 4F FF
All GPIOs are set as outputs with the value ‘1’.
When the GPIOs are set as inputs (please look two steps above) or if the output values shall be verified, it is possible to read from configuration register F1h in the following manner:
-
- o 4E F1 i 4F
For further information, please refer to chapter 4.8 of the Winbond W83627HF datasheet.
5.4 Programming Watchdog
Since the Watchdog is disabled in delivery status, it must be programmed for proper use. Setting
GP33 of the Winbond SuperIO (logical device 9, bit 4) to high enables Watchdog, after that it has to be triggered by GP23 (logical device 8, bit 4). That means it has to be set to low and to high again within 600ms. If the Watchdog is not triggered within this time, the board will perform a hardware reset.
The following program in C is an example how to test Watchdog function under DOS. Programming the Watchdog is quite similar programming GPIO’s.
#include <stdio.h>
#include <conio.h> typedef unsigned char BYTE; void main()
{
BYTE trigger, temp; //define variables
printf("Watchdog is now activated and triggered.\n");
printf("Press any key to generate reset...");
//enter SuperIO configuration mode outp(0x4E, 0x87);
outp(0x4E, 0x87);
outp(0x4E, 0x07);
outp(0x4F, 0x09);
//enable logical device 9
//set GP33 as output in configuration register F0h Æ Bit4 = ‘0’ outp(0x4E, 0xF0);
outp(0x4F, 0xC7);
outp(0x4E, 0xF1);
temp = inp(0x4F);
//set GP33 (Bit4) value in cofiguration register F1h to ‘1’ enables
//watchdog function. Make sure to leave the other Bits unchanged!
temp = temp | 0x08;
outp(0x4F, temp);
outp(0x4E, 0x07);
outp(0x4F, 0x08);
outp(0x4E, 0xF1);
do
{
trigger = inp(0x4F);
trigger = trigger ^ 0x08;
outp(0x4F, trigger);
} while (!kbhit());
//trigger Watchdog by toggling Bit4 of logical Device 8
//enable logical device 8
//toggle Bit4 in configuration register F1h.
//create a loop
//read data register
//exor with 08h, to toggle Bit4
//write value to data register
//stop then any key is hit and reset will be created
//as indication that watchdog is acivated, a red LED is switched on.
İndir
Reklam