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 Control Wires Split Across 2 PORTS

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



Joined: 25 Nov 2005
Posts: 13
Location: San Diego

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

LCD Control Wires Split Across 2 PORTS
PostPosted: Sat Nov 26, 2005 11:56 pm     Reply with quote

Greetings. I bought the PCWH software last week and am trying to get familiar with it. I am pretty familiar with the pic assembler, and am now trying to branch into the C language.

I am using:

Microcontroller: PIC 18LF4520
LCD: 4x16 character Hitachi HD44780 LCD.

and I have #included the lcd.c file from the PICC C library.

In the new project wizard I selected to have the LCD driver installed. Now I am trying to see how I am going to adapt your LCD library to my application. I see in the LCD program it relies on me overlaying the “struct lcd_pin_map” over a port. I am not sure how to make this work for me.

struct lcd_pin_map { // This structure is overlayed
BOOLEAN enable; // on to an I/O port to gain
BOOLEAN rs; // access to the LCD pins.
BOOLEAN rw; // The bits are allocated from
BOOLEAN unused; // low order up. ENABLE will
int data : 4; // be pin B0.
} lcd;

In my application:

My LCD Pin setup:
RE0: RS
RA5: R/W
RA4: Enable

RA0: LCD-DB4
RA1: LCD-DB5
RA2: LCD-DB6
RA3: LCD-DB7

My problem lies in the RE0 pin. Is this going to be a major problem that I am split across two ports? I don’t have an entire port to dedicate to the LCD. PORTA is the only contiguous port I have available. PORTA starts at 0xF80, and PORTE starts at 0xF84.

What is my best solution?

If anyone has any ideas let me know. I would appreciate any help any one has.

Best Regards,
Mark McKinley
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Nov 27, 2005 12:07 am     Reply with quote

Quote:
My problem lies in the RE0 pin. Is this going to be a major problem that I am split across two ports.

Look in the CCS Code Library forum. There are drivers posted there
that allow you to spread the LCD signals over two or more ports.

http://www.ccsinfo.com/forum/viewtopic.php?t=20182
http://www.ccsinfo.com/forum/viewtopic.php?t=24661
kg6vkg



Joined: 25 Nov 2005
Posts: 13
Location: San Diego

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

Thanks for the code
PostPosted: Thu Dec 01, 2005 9:45 pm     Reply with quote

That code worked perfect, thanks for the links. My LCD is working great now.

-Mark
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