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

Having trouble with flex lcd

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



Joined: 04 Sep 2011
Posts: 9

View user's profile Send private message

Having trouble with flex lcd
PostPosted: Wed Sep 14, 2011 6:28 pm     Reply with quote

I need help too !!

I am having the exact same trouble.

Using 18F4620

Have modified flex_lcd for following pins

E D5
RS D4
Data D0 - D3

Have tried both lcd and flex_lcd and only get black squares
I know my physical layout is OK as the lcd and chip works perfectly with basic compiler
Here is my program
Code:

#include <test001.h>

#define ENABLE_PIN D5
#define RS_PIN D4
#define Data4 D0
#define Data5 D1
#define Data6 D2
#define Data7 D3
#include <flex_lcd.c>



void main()
{
   lcd_init();         
   while(1)
      {
      lcd_putc("Hello World");
      delay_ms(500);
}

}

PCWH compiler purchased w/i last few weeks. I have been at this for 10 days and can't make the &%*^ work. Able flash an led w/o problem. Using pickit 2. Any thoughts appreciated.
temtronic



Joined: 01 Jul 2010
Posts: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Sep 15, 2011 9:38 am     Reply with quote

Unless you've modified the original flex_lcd.c driver and renamed the pins definitions....to YOUR assignments..

#define ENABLE_PIN D5
#define RS_PIN D4
#define Data4 D0
#define Data5 D1
#define Data6 D2
#define Data7 D3
...

then the driver will use , in the following case,,

PIN_B4 for the LCD_DB4 defines.

// my modified flex_lcd.c
//called test_flex_lcd.c

#define LCD_DB4 PIN_B4
#define LCD_DB5 PIN_B5
#define LCD_DB6 PIN_A1
#define LCD_DB7 PIN_A2

#define LCD_E PIN_B1
#define LCD_RS PIN_B3
#define LCD_RW PIN_B2 //not used !


I'd suggest you copy the original flex_lcd.c to 'my_flex_lcd.c' and then redefine the LCD_... defines to match your pin layout.This way you still have the original to look at if(when) your program fails.It also makes it easy to have several LCD pin layouts for different projects.

hth jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19510

View user's profile Send private message

PostPosted: Thu Sep 15, 2011 9:50 am     Reply with quote

Also, obvious thing, pin numbers are in the form 'PIN_D5', not 'D5'......

Best Wishes
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