' ********************************************************************** ' ** Program: S1DEB1 - Rel : 1.1 - 18 February 1999 ** ' ** Compiler : BASCOM LT, (IDE Rel.1.20, LIB Rel.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 the developping system monitor and on ' the A port a HEX number between 0 and F selected by the keybord. On the ' A port the number will appear in binary value. ' 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 ' '****************** Declaration of the constants ************************** ' Dim Cnt As Const &HFA03 ' register of command end control of the 82c55 Dim Pda As Const &HFA00 ' data register of A port ' '****************** Declaration of the procedure ************************** ' Declare Sub Acqu_tasto ' acquisition key of the keybord ' '****************** Declaration of the variables ************************** ' Dim Tasto As Byte ' identify the press key Dim Codice As Integer ' identify the ASCII code of the press key ' '************************* Program main *********************************** ' Main: Waitms 1 ' delay for the signals arrangement Out Cnt , 139 ' program 0 mode , B port end C port = input ' instead the A port = output Out Pda , 255 ' led off in the start time Print Do Print " Press any HEX key between 0 e f (reset for exit): "; Do Tasto = Inkey ' read key Loop Until Tasto <> 0 ' pression key control Codice = Tasto And &H7F ' Elimination of the 8 bit Print Chr(tasto) ' Print the character of key press Acqu_tasto ' Procedure that check the HEX code Loop End ' '************************ End of program ******************************** ' ' '**************************** Procedure ******************************** ' ' Procedure that is used for the acquisition of the keybord key between 0 ' end F end for it visualitation on A port. ' input parameter: nothing ' output parameter: codice = key press value that will be visualizzated on A port Sub Acqu_tasto If Codice >= 48 Then ' Control of the press key, If Codice <= 57 Then ' the key must be between 0 to 9 Codice = Codice - 48 ' Comparation of the code with right number Codice = Not Codice ' Make a not Out Pda , Codice ' write on A port the key value Else If Codice >= 65 Then ' Control of the press key If Codice <= 70 Then ' the key must be between A to F Codice = Codice - 55 ' Change the letter code in its decimal value Codice = Not Codice ' make a not Out Pda , Codice ' write on A port the key value Else If Codice >= 97 Then ' control of the press key If Codice <= 102 Then ' the key must be between a to f Codice = Codice - 87 ' Change the letter code in its decimal value Codice = Not Codice ' make a not Out Pda , Codice ' write on A port the key value Else ' if the press key is not one of the previous case then: Print " THE NUMBER SI NOT CORRECT " Print End If End If End If End If End If End If End Sub