this is very roufe. Im still debugging and playing.
'
' PIC Defines
' -----------
@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT ' System Clock Options Saves A6, A7
@ DEVICE pic16F628, WDT_ON ' Watchdog Timer
@ DEVICE pic16F628, PWRT_ON ' Power-On Timer
@ DEVICE pic16F628, MCLR_OFF ' Master Clear Options (Internal) Saves A5
@ DEVICE pic16F628, BOD_ON ' Brown-Out Detect
@ DEVICE pic16F628, LVP_OFF ' Low-Voltage Programming
@ DEVICE pic16F628, CPD_OFF ' Data Memory Code Protect
@ DEVICE pic16F628, PROTECT_OFF ' Program Code Protection
VRCON = 0 ' A/D Voltage reference disabled
CMCON = 7 ' disable analog comparators on almost any PIC so equipped
TRISA=%00000000 ' Or TRISA = 0 sets all the PORTA pins to outputs
TRISB=%01000000
Include "modedefs.bas" ' Include serial modes
' Ports
pLcd_dat var PORTA ' LCD 8 bit data bus
pRS Var PORTB.0 ' RS
pE VAR PORTB.4 ' E
pCs1 VAR PORTB.7 ' Cable Select 1
pLed Var PORTB.3 ' Status LED
GoTo init '****** jump past the routines below ******
send:
pCs1 = 0 ' TODO Change
'pause 1
pRS = gRS
pause 2
'pause 42
pLcd_dat = glcd_dat
PORTB.6 = glcd_dat.4
PORTB.5 = glcd_dat.5
'pause 1
pE = 1
'pauseUS 10
'pause 100
pause 2
'pause 60
pE = 0
'pause 1
pRS = 0
pCs1 = 1
'pCs2 = 1
'pCs3 = 1
pause 7
'pause 140
Return
init: 'Initialization
' H
for i=0 to 4
LOOKUP2 i,[$7F,$08,$08,$08,$7F],glcd_dat
GoSub send
Next
goto init
Bookmarks