View previous topic :: View next topic |
Author |
Message |
Coax Guest
|
PVC160203P LCD & pic16f84a test program |
Posted: Wed Dec 29, 2004 5:27 am |
|
|
Hi !
I have buyed this LCD display ( 2 x 16 ) but i can't find any schematics for pins (on the lower side you have 14 pins + K,A pins) and ond left side power (PICVUE).
Thus anyone knows which pins ( on PIC and LCD ) must i use to write
simple program like "Hello world" on LCD ?
This is the basic, but what pins to use ?
------------------------------------
#include <16F84a.h>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 1200000) //----------12 MHZ XT
#include "lcd.c"
void main()
{
lcd_init();
printf(lcd_putc,"First Line");
printf(lcd_putc,"\nSecond Line");
while(1);
}
------------------------------------ |
|
|
Guest
|
|
|
Coax Guest
|
PVC160203P LCD & pic16f84a test program |
Posted: Wed Dec 29, 2004 12:12 pm |
|
|
Thanx Michael !
I found the datasheets.
Can u point me how to define the pins for PIC 16f84a to make some test program for LCD ?
Thanx in advance |
|
|
Guest
|
|
Posted: Wed Dec 29, 2004 12:53 pm |
|
|
Hi, here is a small quote from lcd.c file :
Quote: | // As defined in the following structure the pin connection is as follows:
// D0 enable
// D1 rs
// D2 rw
// D4 D4
// D5 D5
// D6 D6
// D7 D7
//
// LCD pins D0-D3 are not used and PIC D3 is not used.
// Un-comment the following define to use port B
// #define use_portb_lcd TRUE
|
With this small text program (Your own) :
Code: |
#include <16F84a.h>
#fuses XT, NOWDT, NOPROTECT
#use delay(clock = 1200000) //----------12 MHZ XT
#define use_portb_lcd TRUE
#include "lcd.c"
void main()
{
lcd_init();
printf(lcd_putc,"First Line");
printf(lcd_putc,"\nSecond Line");
while(1);
}
|
the #define use_portb_lcd TRUE lets the compiler know that we are going to use port B
on the PIC (a PIC16F84A doesnt have a Port D that are default used) so you Pin layout will look like this :
Code: | PIC LCD
B0 Enable
B1 RS
B2 RW
B4 D4
B5 D5
B6 D6
B7 D7 |
Pins D0-D3 arent used as we are talking to the LCD in 4bit mode.
Regards
Michael |
|
|
mkent
Joined: 09 Sep 2003 Posts: 37 Location: TN, USA
|
|
Posted: Thu Dec 30, 2004 12:58 am |
|
|
Hello coax, Your #use delay(clock) is not 12 MHZ but 1.2 MHZ.
Happy New Year to all. Mick |
|
|
Coax Guest
|
PVC160203P LCD & pic16f84a test program |
Posted: Thu Dec 30, 2004 4:02 am |
|
|
Hi !
Thanx !. I will try it and i will send replay today or tomorrow !
p.s. Thanx for typing error, corection :-) |
|
|
cambo Guest
|
|
Posted: Thu Oct 11, 2007 2:26 am |
|
|
I also had this problem, thanks. |
|
|
hoong Guest
|
pls help me |
Posted: Sat Jun 14, 2008 9:46 am |
|
|
can i have a full c program including all the part that i need to enter into my program so that i can test my 16x2 LCD ?? Thank... can email me to [email protected]
thx alot |
|
|
|