CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

modification tp LCD:C driver

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ezequiel
Guest







modification tp LCD:C driver
PostPosted: Thu Jan 30, 2003 9:29 pm     Reply with quote

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
PostPosted: Fri Jan 31, 2003 11:56 am     Reply with quote

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

View user's profile Send private message Send e-mail MSN Messenger

PostPosted: Sun Jan 22, 2006 5:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jan 22, 2006 10:44 am     Reply with quote

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]
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group