Manual Number: 00650-144-1
Page 19
procedure LoadCtr(c,val:integer);
begin
port[c] := lo(val);
port[c] := hi(val);
end;
function ReadCtr(c:integer) : integer;
begin
port[3] := c shl 6;
ReadCtr := port[c] + (port[c] shl 8);
end;
{
**********************************************************
PROCEDURE set_counter
Parameters: None
Returns: None
Purpose: This procedure performs the setup operations on the counter/timer chip.
Calls: None
Uses: ADDRESS Constant defined at top of program.
************************************************************
}
PROCEDURE set_counter;
VAR
temp,control_word : BYTE;
BEGIN
temp:=port[7];
CtrMode(0,3); {program the counters for the REQUIRED modes}
CtrMode(1,2);
CtrMode(2,1);
LoadCtr(0,-1); {-1 is full load value, long reset and high
granular}
LoadCtr(1,10);
END; { End set_counter }
VAR
read_back : BYTE;
loop : WORD;
ch : CHAR;
BEGIN
clrscr;
writeln(‘Pascal Sample #1: Use Of Counter/Timer Chip with Watchdog’);
writeln(‘This program demonstrates how to program the 82C54 counter/timer’);
writeln(‘chip on the Watchdog Timer board. The Watchdog address should be set’);
writeln(‘to 350 hex. A keystroke will stop the program.’);
writeln;
writeln(‘Press any key to start.’);
ch := readkey; { Grab keystroke. }
set_counter; { programs counters }
port[7] := 0; { Starts counters counting }
for loop := 1 to 1000 do
begin
CtrMode(1,2);
LoadCtr(1,10); {prompt counter 1--don’t need to prompt 0}
Writeln(‘Updating counter 1. Loop number : ‘, loop);
GotoXY(1, 7);
Содержание PCI-WDT 500
Страница 1: ...Model PCI WDT 500 501 Product Manual MANUAL NUMBER 00650 144 1B...
Страница 3: ...Page iv This page intentionally left blank...
Страница 7: ...Page viii This page intentionally left blank...
Страница 19: ...Manual Number 00650 144 1 Page 10 PCI WDT 500 501 Manual This page intentionally left blank...
Страница 23: ...Manual Number 00650 144 1 Page 14 PCI WDT 500 501 Manual This page intentionally left blank...
Страница 31: ...Manual Number 00650 144 1 Page 22 PCI WDT 500 501 Manual This page intentionally left blank...
Страница 35: ...Manual Number 00650 144 1 Page 26 PCI WDT 500 501 Manual This page intentionally left blank...