OK all fixed now and working ....well almost :-)
This line was causing my problem
LCDINIT LcdCurBlink
so just took it out ! See the working code below ;-)
Now there just one problem to sort out ... the "hello world' message writes itself on one long string and then repeats without anyspaces on the first and second lines ....
something like this
Hello||World||Hello||World||Hello||World||Hello||W orld||Hello||World||Hello||World||
How do I format it to something like
Hello
World
?
Code:'************************************* 'LCD code for 16 X 2 HD4x lcd '************************************* 'Ocsillator selections here OSCCON = $70 'Int CLK 8MHz OSCTUNE.6 = 1 'PLL 4x ADCON1= %00001111 '$0F = disable A/D converter 'END of oscillator selections 'Port IO directions and presets for port pins begin here TRISA = %00000000 'All pins are outputs TRISB = %00000000 TRISC = %00000000 TRISD = %00000000 TRISE.0 = 0 TRISE.1 = 0 TRISE.2 = 0 'End of Port IO directions and presets for port pins begin here 'timer/oscillator defines DEFINE OSC 32 '4x 8MHz 'END of timer/oscillator defines 'LCD defines begin here DEFINE LCD_BITS 4 'defines the number of data interface lines (4 or 8) DEFINE LCD_DREG PORTD 'defines the port where data lines are connected to DEFINE LCD_DBIT 4 'defines the position of data lines for 4-bit interface (0 or 4) DEFINE LCD_RSREG PORTD 'defines the port where RS line is connected to DEFINE LCD_RSBIT 2 'defines the pin where RS line is connected to DEFINE LCD_EREG PORTD 'defines the port where E line is connected to DEFINE LCD_EBIT 3 'defines the pin where E line is connected DEFINE LCD_RWREG 0 'defines the port where R/W line is connected to (set to 0 if not used) DEFINE LCD_RWBIT 0 'defines the pin where R/W line is connected to (set to 0 if not used) DEFINE LCD_COMMANDUS 2000 'defines the delay after LCDOUT statement DEFINE LCD_DATAUS 200 'delay in micro seconds 'END of LCD DEFINES Pause 500 ' Wait for LCD to startup loop1: Lcdout $fe, 1 ' Clear LCD screen Lcdout "Hello" ' Display Hello Pause 500 ' Wait .5 second Lcdout $fe, 1 ' Clear LCD screen Lcdout "World" Pause 500 ' Wait .5 second Goto loop1 ' Do it forever




Bookmarks