I am new to this CCS compiler.
I tried the ex_lcdkb.c example listed below on my
ccs software (with 16F877). I connected
the 3x4 keyboard and 16x2 LCD with experience board
My platform includes the ccs C compiler, MPLAB IDE 6.0
connected with the experience board. I compiled the
code and programed 16F877 and run the example.
I failed to see anything on the LCD. Do I miss
anything? Thanks for your help.
What port is the LCD connected to ? Is it Port B ?
If so, then you need to add a #define statement to
the EX_LCDKB.C file. Put it just above the #include
statement for lcd.c. Example:
Code:
#define use_portb_lcd TRUE // Add this line
#include <lcd.c>
#include <kbd.c>
Do this only if you are using Port B for the LCD.
If you are using Port D, then don't add that line.
-------------------
Also, do you have a 10K trimpot on pin 3 of the LCD,
for contrast adjustment ? One end of the trimpot should
connect to +5v, and the other end to Ground. The tap
should go to pin 3 on the LCD. Set the trimpot so that
pin 3 is at +0.425 volts. This should set the contrast
to a good initial value. You should see characters now.
carlosma
Joined: 24 Mar 2004 Posts: 53 Location: Portugal
Posted: Thu Mar 25, 2004 2:35 am
Keyboard at Port B
LCD Port D
and
ON KBD.C
// Un-comment the following define to use port B
#define use_portb_kbd TRUE
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