|
|
View previous topic :: View next topic |
Author |
Message |
noplacelikehome
Joined: 23 Nov 2005 Posts: 4
|
HELP! - LCD420.C |
Posted: Tue Dec 06, 2005 11:31 pm |
|
|
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
|
|
Posted: Wed Dec 07, 2005 12:39 am |
|
|
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:
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". |
|
|
|
|
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
|