View previous topic :: View next topic |
Author |
Message |
lmercor
Joined: 31 May 2007 Posts: 20
|
LCD and porta & porte |
Posted: Thu May 31, 2007 2:47 pm |
|
|
I want to use an LCD on the porta as data and porte as (RS,RW, ENA) I'm using the PIC18F4550 I set the lcd like this:
Code: | #define LCD_ENABLE_PIN PIN_E0
#define LCD_RS_PIN PIN_E1
#define LCD_RW_PIN PIN_E2
#define D4 PIN_A0
#define D5 PIN_A1
#define D6 PIN_A2
#define D7 PIN_A3
#define LCD_TYPE 2
#include <lcd.c> |
but the LCD only shows black squares on the firs line, nothing appears.
somebody could give me any idea.
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 31, 2007 2:52 pm |
|
|
Where did you get the "lcd.c" driver ?
"Black squares" could mean:
1. The lcd_init() function is not being called.
2. The connections to the LCD are not correct.
3. The contrast voltage is wrong. |
|
|
lmercor
Joined: 31 May 2007 Posts: 20
|
LCD and porta & porte |
Posted: Thu May 31, 2007 3:24 pm |
|
|
the "lcd.c" is the one that comes in the drivers folder. I've already check the connections and everithing is fine. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu May 31, 2007 3:28 pm |
|
|
What compiler ?
I just did a full text search on the CCS directory, for vs. 4.039, for
this search string:
I didn't get any hits.
I also looked at the LCD.c file and it doesn't contain any such #define
statements.
------------
I am starting to think you mean a CCS directory within the Proteus
installation directory. If so, here is link to Proteus forum:
http://support.labcenter.co.uk/forum/viewforum.php?f=9 |
|
|
lmercor
Joined: 31 May 2007 Posts: 20
|
LCD and porta & porte |
Posted: Thu May 31, 2007 4:19 pm |
|
|
I got LCD_ENABLE_PIN from the wizard of the compiler. I use the wizard to look how to set the pins and also I checked the forum and I found some post of that. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
elphi
Joined: 17 Apr 2007 Posts: 20 Location: tijuana,bajacalifornia,mexico
|
It actually came fromm the CCs wizar. |
Posted: Wed Jun 13, 2007 11:17 am |
|
|
You should check before speak (write), because this lines might have came from the CCS wizard.
check the option 15 "LC options", it make this lines in code.
Also, I think you are been rude. _________________ Every little thing gonna be alright |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed Jun 13, 2007 1:43 pm |
|
|
Well, I think this guy just shot his own foot off.
It's a bad idea to come here and ask for help and then insult the people that are the most knowledgable ones, trying to help.
Ronald |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 13, 2007 3:11 pm |
|
|
I don't have the CCS IDE. I just own the command line compilers and
use them with MPLAB. That's why I couldn't understand where those
lines came from.
But, I downloaded the CCS PCWH Demo and installed it.
In the Wizard, it has a selection for "LCD Options". If you click on it,
it displays an LCD tab. You can configure it to put these definitions
into the code, as shown in your post. You are correct on that.
Quote: |
#define LCD_ENABLE_PIN PIN_E0
#define LCD_RS_PIN PIN_E1
#define LCD_RW_PIN PIN_E2
#define D4 PIN_A0
#define D5 PIN_A1
#define D6 PIN_A2
#define D7 PIN_A3
#define LCD_TYPE 2
#include <lcd.c>
|
However, there's a problem with this. The "lcd.c" file that's included with
the Demo doesn't use any of those lcd pin constants. The lcd.c file is
basically the same old CCS lcd driver, in which an "lcd_pin_map"
structure is overlayed on a port.
The constants shown above are similar to (but not exactly the same as)
the ones that are used in my "Flex" 16x2 LCD driver in the Code Library.
But I don't see any kind of "flex" type lcd driver in the CCS drivers
directory that's included with the demo.
My suggestion is to use the "flex" driver in the Code Library:
http://www.ccsinfo.com/forum/viewtopic.php?t=24661 |
|
|
|