Hello all,
I'm new to Pic Programming and need some help!
I would like to learn how to display text on a HD44780.
at this time I'm using a PIC16f690 using the Conections listed below:
D4 - PortA.0
D5 - PortA.1
D6 - PortA.2
D7 - PortA.3
RS Pin4 - PortA.4 ( 10K pull up) also tried it with out pull up and get the same thing
Enable Pin6 - PortB.6
VO Pin3 - 10k pot
R/W Pin5 Connected to Ground
After start up I just get Black Blocks on line 2.
I got this code from the Book "Picbasic Projects 30 Projects using Pic Basic"
The only thing that I changed was the Define for Enable. I had to change it to use Portb.6 because the Pic16f690 does not have a pin b.3.
Please help
Here is the Code:
DEFINE LCD_DREG PORTA 'SET THE DATA PORT
DEFINE LCD_DBIT 4 'Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTA ' Set LCD Register Select port
DEFINE LCD_RSBIT 4 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 6 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 2 ' Set number of lines on LCD
Cnt VAR Word
'CMCON = 7 'THIS DOES NOT WORK WITH THE PIC 16F690
TRISA = 0
TRISB = 0
PAUSE 500
Cnt = 0
LCDOUT $FE,1
RPT:
LCDOUT $FE,2
LCDOUT "CNT=",DEC CNT
PAUSE 1000
Cnt = Cnt +1
GOTO RPT
END
Bookmarks