I tryed using the LCD.bas file as shown on several other topics ( Example: http://www.sfcompiler.co.uk/forum/viewt ... hlight=lcd) That did help me find out why it was taking so long for my code to run But now I think it has to do with an Initialize problem. I have the LCD up and running on a Rabbit 1800 board (single board computer) so I know the lcd works (Using 4pin, RS, E). My code on the Rabbit Looks like this:
Code: Select all
Nibble(2); //Set 4bit mode
Delay(100) //US
WriteByte ( '\B00101100' ); //4bit/lines/pixels
WriteByte ( '\B00001110' );//Turn on display and cursos non-blinking
WriteByte ( '\B00000110' );////inc address and shift cursos with each char write
Code: Select all
Device = 18F1320
Clock = 8
#option LCD_DATA = PORTB.4
#option LCD_RS = PORTB.3
#option LCD_EN = PORTB.2
#option LCD_DATA_US = 200
// import LCD library...
Include "io.bas"
Include "LCD.bas"
Include "utils.bas"
Const UpdateMS = 50
LCD.Cls
WriteAt(1,1,"Hello World")
While true
Toggle(PORTB.0)
DelayMS(500)
Wend
//Also copied from another forum post or two
Module IO
'Set clock source to internal oscillator, I/O on RA6 & RA7
config osc = INTIO2
Config MCLRE = OFF
ADCON1 = $7F
OSCCON = %01110110