I need to program the LCD in C but the datasheet for the matrix multimedia board doesn't give me enough information.
Does anyone know what the RS, E, RW and Data pins are on PORTB?
And is it a 4bit or 8bit interface?
LCD RS, E, RW and Data pins
- Steve
- Matrix Staff
- Posts: 3421
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
We connect to it using the 4bit interface. The LCD driver chip used is the KS0066U. Looking at its datasheet (do a web search) might give you some more clues, although I think we have replicated most of the important info inour own datasheets.
Here's the basic procedure to send info to the LCD:
RS is set high to send characters to the display, or set low to send commands.
Assuming the above code has been created in a function called "LCD_RawSend", where the first parameter is the data and the second is the appropriate setting for RS, the following actions can be performed:
Init:
Clear:
Print Char:
I hope this helps.
Here's the basic procedure to send info to the LCD:
Code: Select all
Put high nibble on B0-B3
Set or clear RS (B4) appropriately
Wait 100us
Set E high
Wait 100us
Set E low
Put low nibble on B0-B3
Set or clear RS (B4) appropriately
Wait 100us
Set E high
Wait 100us
Set E low
Assuming the above code has been created in a function called "LCD_RawSend", where the first parameter is the data and the second is the appropriate setting for RS, the following actions can be performed:
Init:
Code: Select all
LCD_RawSend(0x33, 0); //set to 4-bit mode
LCD_RawSend(0x32, 0); //set 4-bit mode (repeat)
LCD_RawSend(0x2c, 0); //2-line, 5x11
LCD_RawSend(0x06, 0); //move left, no display shift
LCD_RawSend(0x0c, 0); //display on, cursor off
LCD_Clear();
Code: Select all
LCD_RawSend(0x01, 0); //clear display
delay_ms(1);
LCD_RawSend(0x02, 0); //home
delay_ms(1);
Code: Select all
LCD_RawSend(Character, 0x10);