' ********************************************************************** ' ** Program: S1DEB5 - Version : 1.1 - 1 March 1999 ** ' ** Compilator : BASCOM LT, (IDE V.1.20, LIB V.1.27) ** ' ** Card : GPC(r) F2 ** ' ** Firm: grifo(r) ITALIAN TECHNOLOGY ** ' ** Via Dell' Artigiano 8/6 40016 San Giorgio di Piano (BO) ** ' ** Tel.+39 051 892 052 Fax +39 051 893 661 ** ' ** http://www.grifo.com http://www.grifo.it ** ' ** sales@grifo.it tech@grifo.it grifo@grifo.it ** ' ** ** ' ** Developed by: Enea Tassinari ** ' ********************************************************************** ' ' This program allows to display on A port, the C port status if switch 1 ' of the dip switch is on ON position and his opposit, if switch 1 is on ' OFF position. ' 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)F2 CN2 ' connector to TIO 16 CN1 connector, or DEB 01 CN15 connector. ' '*********************************************************************** ' '****************** Compiler directive ********************************* ' $romstart = &H8050 ' address start of the code machine $ramstart = &HD000 ' address start of the data area $ramsize = &H2800 ' put to 10K the data area $crystal = 11059200 ' clock frequency of the microcontroller $baud = 9600 ' RS-232 comunication speed $large ' address to 16 bit ' '****************** Constant declaration ******************************* ' Dim Cnt As Const &HFA03 ' register of command end control of the 82c55 Dim Pda As Const &HFA00 ' data register of A port Dim Pdb As Const &HFA01 ' data register of B port Dim Pdc As Const &HFA02 ' data register of C port ' '****************** Variables declaration ***************************** ' Dim Portb As Byte ' read of the B port Dim Portc As Byte ' read of the C port Dim Lett_pdb As Byte ' read of B port masked Dim Neg_pdc As Byte ' read of the opposit of the C port ' '************************* Program main ******************************** ' Main: Waitms 1 ' delay for the signals arrangement Out Cnt , 139 ' program 0 mode, A port=output and B,C port=input Out Pda , 255 ' led off in the start time Print Print " VISUALIZATION OF THE C PORT STATUS ON A PORT IN PROGRESS " Print " If switch 1 of dip switch=OFF you see the opposit of C port, " Print " if switch 1 of dip swtich=ON you see the status of C port. " Print " Reset the card for exit" Print Print Print " Status of the A port : " Do Waitms 50 Lett_pdb = Inp(pdb) ' read tthe B port status Portb = Lett_pdb And 1 ' mask all bit of B port except the bit 1 Portc = Inp(pdc) ' read the C port status If Portb = 0 Then Out Pda , Portc ' write on port A, the C port status Portc = Not Portc ' make a not Print " " ; Portc ; " "; Else Neg_pdc = 255 - Portc Out Pda , Neg_pdc ' write on A port, the opposit of C port status Neg_pdc = Not Neg_pdc ' make a not Print " " ; Neg_pdc ; " "; End If Print Chr(13); Loop End ' '************************ End main program ***************************** '