View previous topic :: View next topic |
Author |
Message |
Ezequiel Guest
|
modification tp LCD:C driver |
Posted: Thu Jan 30, 2003 9:29 pm |
|
|
Hello,
Does anybody tried to modify the LCD.C driver, so it can be use with a 4 lines x 20 chars LCD?
Thanks
Zeke
___________________________
This message was ported from CCS's old forum
Original Post ID: 11143 |
|
|
Shane Rowell Guest
|
Re: modification tp LCD:C driver |
Posted: Fri Jan 31, 2003 11:56 am |
|
|
Zeke,
I think that it should not be that big of an effort.
You will need to add the following:
define lcd_line_three 0x14
define lcd_line_four 0x54
These are the ram locations of the first character in the third and fourth lines respectively.
You will also need to modify the lcd_gotoxy function to allow for the four possible changes. If you are using the '\n' command you will have to modify it. I typically just use the lcd_gotoxy function.
Let me know if there is anything more I can help with.
Shane
:=Hello,
:= Does anybody tried to modify the LCD.C driver, so it can be use with a 4 lines x 20 chars LCD?
:=Thanks
:=Zeke
:=Hello,
:= Does anybody tried to modify the LCD.C driver, so it can be use with a 4 lines x 20 chars LCD?
:=Thanks
:=Zeke
___________________________
This message was ported from CCS's old forum
Original Post ID: 11168 |
|
|
jruibarroso
Joined: 07 Jan 2006 Posts: 64 Location: Braga
|
|
Posted: Sun Jan 22, 2006 5:02 am |
|
|
if it was not much trouble, would you post here the lcd.c complete with this modification for 4 lines LDC ?? i'm kind a newby and i'm kind a problems to do this, thank you |
|
|
specialk
Joined: 12 Nov 2005 Posts: 27
|
|
Posted: Sun Jan 22, 2006 10:44 am |
|
|
In your LCD420.c file, change:
Code: | #byte lcd = 6 // This puts the entire structure
// on to port B (at address 6) |
to
Code: | #if defined(__PCH__)
#if defined use_portb_lcd
#byte lcd = 0xF81 // This puts the entire structure
#else
#byte lcd = 0xF83 // This puts the entire structure
#endif
#else
#if defined use_portb_lcd
#byte lcd = 6 // on to port B (at address 6)
#else
#byte lcd = 8 // on to port D (at address 8)
#endif
#endif |
and use
Code: | void lcd_gotoxy( BYTE x, BYTE y) {
BYTE address;
switch(y) {
case 1 : address=0x80;break;
case 2 : address=0xc0;break;
case 3 : address=0x94;break;
case 4 : address=0xd4;break;
}
address+=x-1;
lcd_send_byte(0,address);
} |
-special [k] |
|
|
|