Hi again, I'm trying to do a simple "hello world" between my pic16f690 and a 2 line lcd screen based on the hd44780. I have connected it as follows:
LCD -----> PIC
4(RS) --- 12(RB5)
6(E) --- 11(RB6)
11(D4) --- 16(RC0)
12(D5) --- 15(RC1)
13(D6) --- 14(RC2)
14(D7) --- 7(RC3)
I have tied pins 1,3,5,16 to ground and got +5v on pins 2, 15.
After my own code failing I found some code by a moderator here called Joe S in a different thread which I am now using:
The program is running and not hanging as the led flashes, however on the lcd I just have a row of black blocks on the top and nothing on the bottom. I have gone over and redone my wiring many times, also tried a different bread board and a different lcd. Not sure what else I can change or try if anyone has any ideas.Code:define OSC 4 DEFINE LCD_DREG PORTC 'Set port C for the data lines DEFINE LCD_DBIT 4 DEFINE LCD_RSREG PORTB 'Set the RS Port and Pin DEFINE LCD_RSBIT 5 DEFINE LCD_EREG PORTB 'Set LCD Enable bit and pin DEFINE LCD_EBIT 6 DEFINE LCD_BITS 4 ' Set number of lines on LCD DEFINE LCD_LINES 2 ' Set command delay time in us DEFINE LCD_COMMANDUS 2000 ' Set data delay time in us DEFINE LCD_DATAUS 50 ANSEL = 0 ANSELH = 0 CM1CON0 = 0 CM2CON0 = 0 Cnt VAR WORD 'Start Program TRISC = 0 TRISB = 0 Pause 500 cnt=0 RPT: HIGH PORTB.6 LCDOUT $FE,1 'CLEAR LCD SCREEN pause 500 LCDOUT $FE,2,"CNT=", DEC CNT Pause 1000 CNT=CNT+1 GOTO RPT END
Thanks


progress! lol


Bookmarks