-
define lcd
Hi all,
here show my code for 16F877A.
Pic 16f877a pin connect to LCD 16x2:
portb.0 DATA
portb.1
portb.2
portb.3
portd.0 RS
portd.3 E
rw GND
-------------------------
DEFINE LCD__DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTD
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE COMMANDUS 2000
DEFINE LCD_DATAUS 50
pause 1000
lcdout $fe,1, "HELLO"
lcdout $fe,$C0,"WORLD"
end
--------------------------------
but not work. Why?
THX
chip_
-
add this
DEFINE OSC <ur osc>
i.e:
DEFINE OSC 20 'for 20 Mhz
and this line:
ADCON1 = 7 ' fidn out more here http://www.melabs.com/support/ ' mcu_hints.htm
-
DEFINE LCD__DREG PORTB <<---- The underscore doesn't look right...
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTD
DEFINE LCD_RSBIT 0
Double-check your DEFINEs... if you have a spelling or other typo the compiler will NOT flag any error in your DEFINE lines - your program will just not work as expected.
-
Thx!
THANK YOU!!!
for Melanie smack.
by
chip_