View previous topic :: View next topic |
Author |
Message |
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
OT LCD Question |
Posted: Mon Sep 26, 2005 2:04 pm |
|
|
I'm using a HD44780 LCD (16x4) and I would like to differentiate some menu text on the screen from general text. I was thinking of underlining the menu text by generating custom characters. My reading indicates that there are only the possibility of 8 custom characters. However, I need generally 12 at a time on screen. As I write this I just thought of a simple way to test a possible solution....
But the question is:
Can I generate a custom character, write to the screen and do that repeatedly and exceed the 8 character limit. In otherwords, does the character have to exist in CGRAM during the entire screen life of that character?
Or, if anyone has any good ideas about differentiating text on screen for menus I'd love to hear them.
Thanks,
John |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Mon Sep 26, 2005 2:16 pm |
|
|
You can display a maximum of 8 user-defined characters at any time. If you displayed 8 underlined characters, then went and "built" the next 4 (you said 12), then 4 of the original 8 would change to the new characters you just wrote into CGRAM. Unfortunately, you can't get away from this 8 character limit with the Hitachi controller.
Could you put "..." after each menu entry? Or a custom character like a right-facing solid triangle similar to ">"? That would be enough to let the user know there's something special about the text. |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Mon Sep 26, 2005 2:36 pm |
|
|
Excellent idea....duhhhh.
Newguy, I'll just bracket menu item in arrows....... <HOME> like you suggested.
Thanks. |
|
|
SBS
Joined: 15 Aug 2005 Posts: 18
|
|
Posted: Mon Sep 26, 2005 3:22 pm |
|
|
Hi,
I'm just getting started on my PIC project and I will also be incorporating a 16 x 4 LCD.
Since you already have this working I was wondering if you could help me out.
1) Did you start with any sample code?
2) What method did you use to control the LCD? SPI?
If you would be willing to send me your LCD code it would be greatly appreciated. I'm looking for any examples for communicating with an LCD driver.
sbs_motorsports@hotmail.com
Thanks,
Sal |
|
|
jecottrell
Joined: 16 Jan 2005 Posts: 559 Location: Tucson, AZ
|
|
Posted: Mon Sep 26, 2005 3:42 pm |
|
|
1. Yes, the LCD.C code in the drivers folder.
2. It is serial but everything is taken care of by the driver. Remember that the CCS driver only uses D4-D7 on the LCD. Look at the driver and layout schematics and boards using the standard pinouts, it will make life easier.
Code is easily modified for 4 line display:
Code: |
#define lcd_line_two 0x40 // LCD RAM address for the second line
#define lcd_line_three 0x10 // LCD Ram address for the third line
#define lcd_line_four 0x50 // LCD Ram address for the fourth line |
Code: |
void lcd_gotoxy( BYTE x, BYTE y) {
BYTE address;
switch(y){
case 1 : address = 00; break;
case 2 : address = lcd_line_two; break;
case 3 : address = lcd_line_three; break;
default : address = lcd_line_four; break;
}
address+=x-1;
lcd_send_byte(0,0x80|address);
}
|
And that should get you going..... |
|
|
|