View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
LCD problems |
Posted: Thu Mar 03, 2005 3:56 am |
|
|
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 , 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 |
|
![](templates/subSilver/images/spacer.gif) |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Thu Mar 03, 2005 6:59 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
DavidHudd
Joined: 07 Mar 2005 Posts: 2 Location: BRISTOL, U.K.
|
|
Posted: Tue Mar 15, 2005 12:56 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Tue Mar 15, 2005 1:22 pm |
|
|
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. |
|
|
![](templates/subSilver/images/spacer.gif) |
|