Lcd Problem - I think its the Initialize
Posted: Thu Aug 14, 2008 4:26 am
Hello all,
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:
I tryied playing around with the LCD.bas to change the Initialize but atlast I am too new to Swordfish basic to understand fully what is going on in the function. Any help would be great! For my code in Swordfish (Copied pretty much from another post):
I do have a led hooked up to PORTB.0 and it does blink; good idea from the other forum post by someone. The LCD uses "SPLC780D" pretty much the same as a HD44780. Once again thanks for any help.
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