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

flex_lcd please help

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



Joined: 26 Jul 2008
Posts: 2

View user's profile Send private message

flex_lcd please help
PostPosted: Sat Jul 26, 2008 4:06 pm     Reply with quote

I have a test card and I have following connections for 2x16 lcd.
http://img77.imageshack.us/my.php?image=tara0001li7.jpg

How can I change the flex_lcd.c code to run the lcd ?

Please help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 27, 2008 1:26 am     Reply with quote

Edit the #define statements at the beginning of the Flex_lcd.c file,
and change them to this:
Code:

#define LCD_DB4   PIN_B4
#define LCD_DB5   PIN_B5
#define LCD_DB6   PIN_B6
#define LCD_DB7   PIN_B7

#define LCD_E     PIN_A0
#define LCD_RS    PIN_A1
// #define LCD_RW    PIN_A2   // Not used

//  #define USE_LCD_RW   1     // Must be commented out

On your board, you must configure JMP4 and JMP5 so that
these connections exist:
Quote:
LCD 'E' is connected to PIC pin A0
LCD 'RS' is connected to PIC pin A1

Use an ohmmeter to check the connections between the PIC and the
LCD if you are not sure.

In your code, make sure that you call the lcd_init() function at the
beginning of main(), before you call any other lcd functions.
Guest








PostPosted: Sun Jul 27, 2008 2:32 am     Reply with quote

I have already used that but it couldn't help me. As you can see my lcd interface with 8 bit rather than 4 bit. I think the problem occure for that reason
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 27, 2008 11:58 am     Reply with quote

You don't have to use the 8-bit interface just because your board has
all 8 data lines connected. I think probably all 16x2 LCDs will operate
in 4-bit mode.

Your board has other jumpers on it that need to be configured for the
LCD to work, such as JMP3. I suggest that you email the manufacturer
of the board and ask them for instructions on how to configure the board
to use the LCD.
egemenak



Joined: 26 Jul 2008
Posts: 2

View user's profile Send private message

PostPosted: Tue Jul 29, 2008 2:24 am     Reply with quote

I spoke with the manufacturer and he said that he program lcd with basic and basic has define commands that can define all the lcd pins. such as DEFINE LCD_DREG PORTB 'LCD
DEFINE LCD_DBIT 4
DEFINE LCD_EREG PORTB 'LCD
DEFINE LCD_EBIT 3 'LCD
DEFINE LCD_RWREG PORTB ‘LCD RW
DEFINE LCD_RWBIT 2 ‘LCD RW

although the lcd works with his basic codes it isn't work with c codes.

is there a any definitions code for c like basic stated above.
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