LCD problems when EBIT is changed
I am using a 28pin PIC16F73 (compatible with 16F877).
If I connect my pic to a LCD using PORTB pin 3 as the EBIT, my LCD works perfectly.
DEFINE LCD_DREG PORTA
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTA
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
TRISB=0 ' PORTB is output
TRISA=0 ' PORTA is output
ADCON1 =7 ' PORTA is digital
However, I need PORTB to connect a keypad and if I now change the EBIT definition to PORTA pin5:
DEFINE LCD_EREG PORTA
DEFINE LCD_EBIT 5
and move the connection to RA5, then my LCD suddenly won't work?
I have tried anything but cannot understand why this is happening.