#define LCD_E PIN_A0
#define LCD_RS PIN_A1
// #define LCD_RW PIN_A2 // Not used
// #define USE_LCD_RW 1 // Must be commented out
On your board, you must configure JMP4 and JMP5 so that
these connections exist:
Quote:
LCD 'E' is connected to PIC pin A0
LCD 'RS' is connected to PIC pin A1
Use an ohmmeter to check the connections between the PIC and the
LCD if you are not sure.
In your code, make sure that you call the lcd_init() function at the
beginning of main(), before you call any other lcd functions.
Guest
Posted: Sun Jul 27, 2008 2:32 am
I have already used that but it couldn't help me. As you can see my lcd interface with 8 bit rather than 4 bit. I think the problem occure for that reason
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sun Jul 27, 2008 11:58 am
You don't have to use the 8-bit interface just because your board has
all 8 data lines connected. I think probably all 16x2 LCDs will operate
in 4-bit mode.
Your board has other jumpers on it that need to be configured for the
LCD to work, such as JMP3. I suggest that you email the manufacturer
of the board and ask them for instructions on how to configure the board
to use the LCD.
egemenak
Joined: 26 Jul 2008 Posts: 2
Posted: Tue Jul 29, 2008 2:24 am
I spoke with the manufacturer and he said that he program lcd with basic and basic has define commands that can define all the lcd pins. such as DEFINE LCD_DREG PORTB 'LCD
DEFINE LCD_DBIT 4
DEFINE LCD_EREG PORTB 'LCD
DEFINE LCD_EBIT 3 'LCD
DEFINE LCD_RWREG PORTB ‘LCD RW
DEFINE LCD_RWBIT 2 ‘LCD RW
although the lcd works with his basic codes it isn't work with c codes.
is there a any definitions code for c like basic stated above.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum