' ********************************************************************** ' ** Program name: S1DEB6.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. ' 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 ' '************************** Variable declarations **************************** ' Dim Shifter As Byte ' Lighting shifter Dim Port4 As Bit ' If 1 shift the port 4 LEDs, else ' shift the port 1 LEDs. Waitms 1 ' Delay for signals settling Port4 = 1 ' Selects port 4 as first ' '***************************** Main Program ********************************** ' Print " Demonstration program 6 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 : Print " Running..." Print Do Shifter = 1 ' Starts shifting from LSB While Shifter <> 0 Shifter = Not Shifter ' To pilot LEDs in negated logic If Port4 = 1 Then ' If port A selected P4 = Shifter ' Writes shifter value to port 4 P1 = 255 Else ' Else P4 = 255 P1 = Shifter ' Writes shifter value to port 1 End If Shifter = Not Shifter ' Restore normal value for rotation Rotate Shifter , Left ' Next LED Waitms 255 ' Delay to light few LEDs per second Wend Port4 = Not Port4 ' Switches between port 4 and 1 Loop End ' '*************************** End of Main program ***************************** '