{ ********************************************************************** ** Program: S1DEB9.PAS Version: 1.1- 17 February 1999 ** ** Firm: GRIFO(r) Via Dell'Artigiano 8/6 ** ** 40016 San Giorgio di Piano (BO) ** ** Tel. 051-892052 FAX 051-893661 ** ** Developed by : Tassinari Enea ** ********************************************************************** This program allows to display the led sliding from right to left and one from left to right. If you put the jumper j10 in 2-3 position, when there is the crossing of the two leds, the buzzer sound. In order to make an easier visualization of the status lines, it is necessary to get a 20 pins flat cable for connecting GPC(r)15R CN9 connector to TIO 16 CN1 connector, or DEB-01 CN15 connector. } program S1DEB9; {$C-} { disable the Ctrl+C } const CNT=$17; { Control and command register of the PPI 82C55 } PDA=$14; { Data register of the A port } PDB=$15; { Data register of the B port } PDC=$16; { Data register of the C port } RIT=100; { Delay of 100 ms } var INDIRIZZO:BYTE; STATO:byte; TASTO:char; OUTPDA:integer; OUTPDC:integer; procedure INIZIALIZZAZIONE; { Initialization of the control register of the 82C55 } begin port[CNT]:=130; end; procedure SCRITTURA (STATO:byte; INDIRIZZO:byte); { Write on A-C port } begin port[INDIRIZZO]:=STATO; end; procedure BUZZER; { This procedure is used to produce one square wave for the buzzer sound. } var BIT:byte; INDICE:integer; RITARDO:integer; begin for INDICE:=1 to 500 do { Loop for the square wave } begin BIT:=OUTPDC and 127; { Read the status of the OUTPDC variable and sensibilize only bit 7. } SCRITTURA(255-BIT,PDC); for RITARDO:=1 to 8 do; BIT:=OUTPDC or 128; { Read the leds status and change only bit 7 (bit 7 always=1) } SCRITTURA(255-BIT,PDC); for RITARDO:=1 to 8 do; end; end; begin {program main } clrscr; INIZIALIZZAZIONE; gotoxy(10,3); writeln('VISUALIZATION OF THE LEDS RUN ON A-C PORT IN PROGRESS'); gotoxy(25,4); write('Press any key for exit'); begin OUTPDA:=1; OUTPDC:=128; repeat begin SCRITTURA(255-OUTPDA,PDA); SCRITTURA(255-OUTPDC,PDC); delay(RIT); if OUTPDA=128 then OUTPDA:=1 { You can lighting in sequence the last and first LED. } else OUTPDA:=OUTPDA shl 1; { You can shift in left direction the middle bits. } if OUTPDC=1 then begin BUZZER; OUTPDC:=128; end { You can lighting in sequence the firs and last LED. } else OUTPDC:=OUTPDC shr 1; { You can shift in right direction the middle bits. } end; until keypressed; end; SCRITTURA(255,PDA); SCRITTURA(255,PDC); { Led off in the end time } read(kbd,TASTO); end.