That's a good laugh. I thought someone would have that reply.
Excellent!Originally Posted by wildbilly
Does your main program have this section (modified for your hardware of course).
The old lcd DEFINES can be commented out.
Code:;----[ Change these to match your LCD ]--------------------------------------- </i></b></font><b>LCD_DB4 </b><font color="#008000"><b>VAR </b></font><b>PORTA</b>.<font color="#800000"><b>0 </b></font><b>LCD_DB5 </b><font color="#008000"><b>VAR </b></font><b>PORTB</b>.<font color="#800000"><b>3 </b></font><b>LCD_DB6 </b><font color="#008000"><b>VAR </b></font><b>PORTB</b>.<font color="#800000"><b>7 </b></font><b>LCD_DB7 </b><font color="#008000"><b>VAR </b></font><b>PORTC</b>.<font color="#800000"><b>1 </b></font><b>LCD_RS </b><font color="#008000"><b>VAR </b></font><b>PORTD</b>.<font color="#800000"><b>4 </b></font><b>LCD_E </b><font color="#008000"><b>VAR </b></font><b>PORTA</b>.<font color="#800000"><b>1 </b></font><b>LCD_Lines </b><font color="#008000"><b>CON </b></font><font color="#800000"><b>2 </b></font><font color="#0000FF"><b><i>' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines) </i></b></font><b>LCD_DATAUS </b><font color="#008000"><b>CON </b></font><font color="#800000"><b>50 </b></font><font color="#0000FF"><b><i>' Data delay time in us </i></b></font><b>LCD_COMMANDUS </b><font color="#008000"><b>CON </b></font><font color="#800000"><b>2000 </b></font><font color="#0000FF"><b><i>' Command delay time in us </i></b></font><font color="#008000"><b>INCLUDE </b></font><font color="#FF0000">"LCD_AnyPin.pbp" </font><font color="#0000FF"><b><i>; *** Include MUST be AFTER LCD Pin assignments ****</i></b></font>
DT
Hi Darrel. I added the list below and no longer have the error but no longer have a display on
the LCD. I only have two black bars.
'LCD_DB4 VAR PORTB.0
'LCD_DB5 VAR PORTB.1
'LCD_DB6 VAR PORTB.2
'LCD_DB7 VAR PORTB.3
'LCD_RS VAR PORTB.4
'LCD_E VAR PORTB.7
The list below works fine.
'LCD Parameters
'============
DEFINE LCD_DREG PORTB ' LCD Data port
DEFINE LCD_DBIT 0 ' starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' LCD Register Select port
DEFINE LCD_RSBIT 4 ' LCD Register Select bit
DEFINE LCD_EREG PORTB ' LCD Enable port
DEFINE LCD_EBIT 7 ' LCD Enable bit
DEFINE LCD_BITS 4 ' LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 4 ' Number of lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time in us
My LCD is connected just like your example " http://www.pbpgroup.com/files/2_LCDs.gif
OK,
Just to make sure, I went thru the steps again myself.
Have it working here on a 16F88. One thing I had to add that wasn't mentioned here, although it was in the other thread ...But so that I can compare Apples to Apples, What PIC are you using?Code:PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this, ; but some displays are picky)
I bought 25ft of ribbon today, just to make sure. But haven't hooked it up yet.
DT
I added the code
PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD
with the same result. I am using the 16F877a
Apples it is ..
Built a 16F877A breadboard. With LCD on the above mentioned ports.
Still haven't hooked up the ribbon yet, just wanted 1 LCD at this point.
Here's the Breadboard.
Click image to enlarge
And here's the program it's running.Can you see anything I've done different??Code:@ __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF ADCON1 = 7 CMCON = 7 DEFINE OSC 4 ;----[ Change these to match your LCD ]--------------------------------------- LCD_DB4 VAR PORTB.0 LCD_DB5 VAR PORTB.1 LCD_DB6 VAR PORTB.2 LCD_DB7 VAR PORTB.3 LCD_RS VAR PORTB.4 LCD_E VAR PORTB.7 LCD_Lines CON 2 ' # of Lines on LCD, 1 or 2 (Note: use 2 for 4 lines) LCD_DATAUS CON 50 ' Data delay time in us LCD_COMMANDUS CON 2000 ' Command delay time in us INCLUDE "LCD_AnyPin.pbp" ; *** Include MUST be AFTER LCD Pin assignments **** PAUSE 500 : LCDOUT $FE,1 : PAUSE 250 ; Initialize LCD (You may not need this, ; but some displays are picky) LCDOUT $FE,1,"Hello wildbilly",$FE,$C0,"Must be something",$FE,$94,"In the Hardware" Main: ; toggle LED pause 1000 goto Main
<br>
DT
Bookmarks