View previous topic :: View next topic |
Author |
Message |
tienguan
Joined: 06 Jan 2011 Posts: 12
|
ccs rev 9 prototyping board help |
Posted: Thu Jan 06, 2011 9:44 am |
|
|
I am using prototyping board and I am trying to use it to test keypad input and display on lcd display. I have tried simulation part (proteus) but having trouble how to use this prototyping board. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jan 06, 2011 2:23 pm |
|
|
We don't know what board you have. Post a link to the webpage for it.
Also, we don't know what drivers and example programs you are using for the lcd and keypad.
Also post your compiler version. |
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
Posted: Sun Jan 09, 2011 9:02 am |
|
|
http://www.ccsinfo.com/product_info.php?products_id=ACEdevkit
I am using this prototyping board
My schematic layout
My problem is to implement this schematic layout into the prototyping board.
I know how to load it but not sure how to connect the components into the prototyping board. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jan 09, 2011 5:51 pm |
|
|
Post your schematic on a free image hosting website such as
imageshack.com and then post a link to it here. |
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
Posted: Tue Jan 11, 2011 2:50 am |
|
|
Yes, I got the keypad and the lcd display module.
I real problem is how to connect the first three pins of the LCD module.
How do I connect the Vee? Do i connect it to +5V in the board? Do i need the 100k resistor?
What I did was connect the Vdd and Vee to +5V and Vss to the ground, which doesnt seem to work at all. |
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
Posted: Tue Jan 11, 2011 2:55 am |
|
|
Forgot to tell you that my LCD is not connected directly to the board like the pdf file suggested. I am using port C instead of the default port (port B) |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Tue Jan 11, 2011 3:11 am |
|
|
Read the data sheet for _your_ LCD.
Vee, is most definitely _not_ designed to connect to 5v. It is a bias voltage for the LCD. Depending on the LCD, it may need a voltage between a few volts negative, up to perhaps the supply rail. (many modern LCD's are setup to give a 'reasonable' output at 0v), few modern units will give _any_ output, if this is connected to 5v. Historically older displays usually needed a -ve voltage here, but few now do.
So, read the data sheet, and see what your LCD wants. I'd suspect that connecting Vee, to 0v, might well give you a display.
Best Wishes |
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
Posted: Tue Jan 11, 2011 9:47 am |
|
|
Do I need the 100k resistor?
How do I connect to 0V? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 11, 2011 11:30 am |
|
|
You can get 0v by connected the Vee pin to ground. On your schematic
it's the symbol that looks like this:
|
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
Posted: Wed Jan 12, 2011 10:02 pm |
|
|
The LCD is definitely on but it's not working as I hoped for. The keypad doesn't seem to able to enter any numbers and the LCD is displaying weird numbers randomly. I suspect it's because of my code.
Here's my code:
Code: |
#if defined(__PCH__)
#include <18F4620.h>
#endif
#device ICD=TRUE
#fuses HS,NOLVP,NOWDT,NOPROTECT
#use delay (clock=20000000)
#define LCD_RS_PIN PIN_C0
#define LCD_RW_PIN PIN_C1
#define LCD_ENABLE_PIN PIN_C2
#define LCD_DATA4 PIN_C4
#define LCD_DATA5 PIN_C5
#define LCD_DATA6 PIN_C6
#define LCD_DATA7 PIN_C7
#include "flex_lcd.c"
#include <kbd.c>
void main() {
char c;
lcd_init();
kbd_init();
lcd_putc("\fKeypad Testing..\n");
delay_ms(100);
while (TRUE) {
c=kbd_getc();
if(c!=0)
if(c=='*')
lcd_putc('\f');
else
lcd_putc(c);
}
}
|
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jan 13, 2011 12:57 pm |
|
|
Quote: | Yes, I got the keypad and the lcd display module. |
Does this mean you have the "official" CCS keypad and LCD that they
sell for the ACE kit ? This one:
http://www.ccsinfo.com/product_info.php?cPath=Store&products_id=lcdkeypad
If you those parts, they should just plug right into the ACE Kit board
with no problem.
Quote: | The real problem is how to connect the first three pins of the LCD module |
I don't have the ACE kit, and CCS does not post the PDF file for the
manual and the schematic on their website. But I would assume that
the ACE kit has all the connections for the LCD "pre-wired" and correct.
The photo of the LCD in the link above shows a resistor soldered on the
top side of the LCD, near the connector pins. I assume this is for the
LCD contrast circuit. Why do you believe you have to make additional
connections to the LCD ?
If you actually bought the ACE kit and the CCS LCD and keypad
and it doesn't work, then you should email CCS about it. |
|
|
tienguan
Joined: 06 Jan 2011 Posts: 12
|
|
Posted: Fri Jan 14, 2011 1:09 pm |
|
|
LCD and keypad problems are solved.
I need to know what's wrong with my code. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jan 14, 2011 1:35 pm |
|
|
Quote: |
The keypad doesn't seem to able to enter any numbers and the LCD is
displaying weird numbers randomly.
|
I think the problem is in the hardware. I just looked at your full
schematic (yesterday it didn't show the whole thing. But today I can see it all).
There's a problem with your keypad circuit. You have pull-up resistors
on the column pins of the keypad. That's wrong. They are supposed to
be on the Row pins. You need one pull-up on each row pin. |
|
|
|