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

8Bit initialization for LCD

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







8Bit initialization for LCD
PostPosted: Mon Jan 30, 2006 12:12 pm     Reply with quote

Hi, I'm looking for an 8-bit initialization routine for Pic-C PCWH. I've look everywhere but could not find any routines for C language. Could someone here provide me a working routine for 8 bits ??? I have pleanty for 4 bit but no 8 bit.

Thank's

Acme

P.S. Please send me private message
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Mon Jan 30, 2006 12:48 pm     Reply with quote

Guests can't receive private messages.

http://www.geocities.com/dinceraydin/lcd/commands.htm
Guest








PostPosted: Mon Jan 30, 2006 11:12 pm     Reply with quote

I know how to initialize in assembler I'm looking for initialization routine in C language, a working 8 bit initialization routine in C for CCS PicC.
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Mon Jan 30, 2006 11:47 pm     Reply with quote

Okay.

So you know how to do it in assembly. What information in the link was for assembly only?

I'll spell it out. This is from the lcd.c driver that comes with the compiler:
Code:
#define lcd_type 2           // 0=5x7, 1=5x10, 2=2 lines
#define lcd_line_two 0x40    // LCD RAM address for the second line


BYTE const LCD_INIT_STRING[4] = {0x20 | (lcd_type << 2), 0xc, 1, 6};
                             // These bytes need to be sent to the LCD
                             // to start it up.


The LCD_INIT_STRING is sent to the lcd during initialization. The first parameter to be sent is 0x20 | (lcd_type << 2). In other words, 0x28.

So according to the web page I pointed you to, 0x28 sets the lcd to 4 bit interface, 2 lines. Huh.

I wonder what you'll have to change it to to get it to start up in 8 bit mode? Hint: it's the first entry in the table in the linked page. If you can't find the compiler's own lcd.c driver, there have been many examples posted here. Search.
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