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 support@ccsinfo.com

HELP! - LCD420.C

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



Joined: 23 Nov 2005
Posts: 4

View user's profile Send private message

HELP! - LCD420.C
PostPosted: Tue Dec 06, 2005 11:31 pm     Reply with quote

ok, I've altered the lcd420 file to use the D port. BUT,
i put together a PCB and accidently layed my wires incorrectly!! How silly!

I've unsuccessfully tried to alter the file to use RS as pin 19, RW as pin 21, and Enable as pin 20.

Any suggestions?

---------------------
struct was changed to:

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 07, 2005 12:39 am     Reply with quote

Quote:
ok, I've altered the lcd420 file to use the D port. BUT,
i put together a PCB and accidently layed my wires incorrectly!! How silly!

I've unsuccessfully tried to alter the file to use RS as pin 19, RW as pin 21, and Enable as pin 20.

I assume you're using a 16F877 in the 40-pin DIP package.
So that gives:

RS: pin D0
EN: pin D1
RW: pin D2

Therefore, you need to change the LCD420.C file as follows:

1. Change the pin map structure so it looks like this:
Code:
struct lcd_pin_map {             
           BOOLEAN rs;          // Pin D0               
           BOOLEAN enable;      // Pin D1     
           BOOLEAN rw;          // Pin D2   
           BOOLEAN unused;           
           int     data : 4;    // Pins D4-D7
        } lcd;


2. Change the #byte statement so it looks like this:
Code:
#byte lcd = 8 


3. Finally, there are three places in the driver where it has "set_tris_b".
Edit those three lines and change them to "set_tris_d".
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