'' ********************************************************************** ' ** Program name: S1DEB7.BAS - Version : 1.1 - 02 June 1999 ** ' ** Compiler : BASCOM LT, (IDE V.1.20, LIB V.1.27) ** ' ** Board : GPC(r) 554 ** ' ** 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 ** ' ** ** ' ** Written by: Graziano Gaiba ** ' ********************************************************************** ' ' This program shifts the lighting of a LED to one direction or the other ' according to the status of jumper 2. If jumper 2 is connected shifts from ' the red LEDs to the others. ' To achieve the visualization of the lines, you should connect the CN5 ' connector of GPC(r) 554 board to the CN15 connector of DEB(r) 01 board by ' a 20 to 26-pin adapter flat cable. ' ATTENTION! To address correctly the 80552 I/O lines you shuold select the ' 80552 register file. To do this, select tab Misc from the Options/Compiler ' menu, click in the Register file text box then select the file 80552.DAT. ' '************************ Compiler Directives ******************************* ' $romstart = &H8050 ' start address of machine code $ramstart = &HD000 ' start address of data area $ramsize = &H2800 ' 10k of data area $crystal = 22118400 ' clock of microcontroller $baud = 19200 ' RS-232 baud rate $large ' 16 bit addressing mode ' '************************** Constant declarations **************************** ' Dim Rundebug As Const &HFFFD ' run/debug register ' '************************** Variable declarations **************************** ' Dim Shifter As Byte ' Lighting shifter Dim J2 As Byte ' Stores status of jumper 2 Dim Port4 As Bit ' If 1 selects port 4, else selects port 1 Waitms 1 ' Delay for signals settling ' '***************************** Main Program ********************************** ' Print " Demonstration program 7 for section 1 of DEB(r) 01 board" Print : Print " Shifts the lighting of a LED to one direction (from red LEDs to others)" Print " if jumper 2 is connected, otherwise shifts to the other direction." Print : Print " Running..." Print Shifter = 1 ' Starts with the LSB Port4 = 1 ' Selects port A as first Do Shifter = Not Shifter ' Negates to drive LEDs in negated logic If Port4 = 0 Then ' If port 4 selected P1 = 255 ' Turns off port 1 LEDs P4 = Shifter ' Drives port 4 LEDs Else P1 = Shifter ' Drives port 1 LEDs P4 = 255 ' Turns off port 4 LEDs End If Shifter = Not Shifter ' Restores normal value for rotation Waitms 255 ' Delay for few rotations per second J2 = Inp(rundebug) ' Reads the run/debug register J2 = J2 And &B10000000 ' Isolates jumper 2 If J2 = 0 Then ' If jumper 2 is connected Rotate Shifter , Left ' Shift from red LEDs to others Else Rotate Shifter , Right ' Else does the opposite End If If Shifter = 0 Then ' If rotation is over Port4 = Not Port4 ' Switch selection between port A and C If J2 = 0 Then ' If jumper 2 is connected Shifter = 1 ' Restart shifting from red LEDs to others Else Shifter = 128 'Else restart shifting to the other direction End If End If Loop End ' '*************************** End of Main program ***************************** '