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

LCD problems

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







LCD problems
PostPosted: Thu Mar 03, 2005 3:56 am     Reply with quote

Hi all. I seem to be having problems getting an lcd to work properly.
I am using a 1602 series lcd's 16*2 lines connected to port b. I am using the lcd driver provided by CCS. ( ver 3.207)

The lcd.c file in this version is slightly different from a previous one I used(unfortunately I can't remember the previous ver Sad , I think it was 3.187)
With the previous version I did not have any problems...

The LCD structure is set up like this:

Code:
struct lcd_pin_map { 
         
                                  int     data : 4; 
                                  BOOLEAN enable;         
                                 BOOLEAN rs;             
                                 BOOLEAN rw;   
                                 BOOLEAN unused; 
                          } lcd;

With this structure the lcd WON'T work.

If I set up the lcd like this:

struct lcd_pin_map {
BOOLEAN enable;
BOOLEAN rs;
BOOLEAN rw;
BOOLEAN unused;
int data : 4;

} lcd;

Then the lcd works fine. Obviously I change the wiring to match the STRUCT!!!

With the previous version I could move the (DATA:4) , and rs , rw , e at will with no probs.

Any ideas what I'm doing wrong.
Cheers
Rob
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Thu Mar 03, 2005 6:59 am     Reply with quote

Well I think I have 3.217 installed and the LCD.C file has a date of June 2003 so I do not believe they changed it. My guess is that you are not changing the LCD_READ and LCD_WRITE constants which control the tris registers.
DavidHudd



Joined: 07 Mar 2005
Posts: 2
Location: BRISTOL, U.K.

View user's profile Send private message

PostPosted: Tue Mar 15, 2005 12:56 pm     Reply with quote

The reason it does not work is that the driver assumes the data nibble is D5-7 and does operations (e.g. on tris) without refering to the structure you modified.
You will need to do more extinsive changes to the driver or change the wiring.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Tue Mar 15, 2005 1:22 pm     Reply with quote

DavidHudd wrote:
The reason it does not work is that the driver assumes the data nibble is D5-7 and does operations (e.g. on tris) without refering to the structure you modified.
You will need to do more extinsive changes to the driver or change the wiring.


No way, the driver does not assume at all. None of the code has to be changed at all. Only as I said before
Quote:
the LCD_READ and LCD_WRITE constants which control the tris registers.
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