' ********************************************************************** ' ** Program name: PPOCN3AU.BAS - Version : 1.1 - 31 January 2001 ** ' ** Compiler : BASCOM AVR, (IDE V.1.11.4.0, LIB 1.11.4.0) ** ' ** Board : K51-AVR ** ' ** 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 turns on in sequence the 16 TTL lines available on ' connector CN3. ' ' '*********************************************************************** ' '********************* Compiler Directives ***************************** ' $regfile = "8515def.dat" ' AT90s8515 registers $romstart = &H0 ' code start address $crystal = 5529600 ' micro clock frequence $baud = 19200 ' baud rate 'Config Debounce = 50 ' time to wait to convalidate ' a key pressed ' Es: 10= 10ms, 50= 50ms ' ' *************************** PIN list AT90s8515 ************************** Config Porta = Output Config Portc = Output ' '*********************** Variables declaration ************************* ' Dim Pout As Byte ' value for output lines Dim X As Byte ' genearal purpose variable Dim Valore As Byte , Valore1 As Byte ' value of counts ' '*************************** Main program ****************************** ' Main: ' delay for signals settling Waitms 1 Do Valore = 1 ' starting value Valore1 = 128 For X = 1 To 7 ' initialize cycle Pout = Not Valore ' complement the value Porta = Pout Pout = Not Valore1 ' complement the value Portc = Pout Valore = Valore * 2 ' left shift of bits Valore1 = Valore1 / 2 ' right shift of bits Waitms 255 ' delay Next X For X = 1 To 7 ' initialize cycle Pout = Not Valore ' complement the value Porta = Pout Pout = Not Valore1 ' complement the value Portc = Pout Valore = Valore / 2 ' right shift of bits Valore1 = Valore1 * 2 ' left shift of bits Waitms 255 ' ritardo Next X Loop End ' '**************************** Program end ******************************** '