View previous topic :: View next topic |
Author |
Message |
noisepic
Joined: 24 Jul 2005 Posts: 20
|
put characters on LCD |
Posted: Sun Jul 24, 2005 5:16 am |
|
|
This is my first post.I try to put a character on LCD I can't see it on LCD
this is my code
Code: |
#include<16f84a.h>
#include<lcd.c>
#fuses NOWDT,PUT,HS,NOPROTECT
#use delay(clock=12000000)// crystal 12MHZ
main()
{
lcd_init();
lcd_putc('b');
}
|
I connect pic 16f84A the same with guide in lcd.c (driver folder in picc).
I don't know why
Any one help me to display a character on LCD ? |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Mon Jul 25, 2005 8:04 am |
|
|
1) put a continuous loop at the end of your program.
2) When I compile this, it complains about a tris_d. Your chip doesn't have
a port D. Thus the ports you defined are wrong.
Code: | #include<16f84a.h>
#include<lcd.c>
#fuses NOWDT,PUT,HS,NOPROTECT
#use delay(clock=12000000)// crystal 12MHZ
main()
{
lcd_init();
while(1)
{
lcd_putc('b');
}
}
|
Fix these two things. See if can figure it out. |
|
|
Bieli
Joined: 15 Sep 2003 Posts: 9
|
|
Posted: Tue Jul 26, 2005 6:24 am |
|
|
If I remember the #include <lcd.c> should be after #use delay becouse it ise delay function.
#include<16f84a.h>
#fuses NOWDT,PUT,HS,NOPROTECT
#use delay(clock=12000000)// crystal 12MHZ
#include<lcd.c>
main()
{
lcd_init();
lcd_putc('b');
} |
|
|
Mustafa Guest
|
Then problem with lcd.c |
Posted: Sat Jan 14, 2006 8:03 pm |
|
|
I did this but got an error: Undefined identifier set_tris_d while compiling. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jan 15, 2006 12:05 am |
|
|
Look at the 4th post in the following thread. It has a good example
for using the 16F84A with a LCD. Because the 16F84A doesn't have
a port D, you must connect the LCD to Port B, and then tell the LCD
driver to use that port. Note how he does that, with the #define
statement.
http://www.ccsinfo.com/forum/viewtopic.php?t=21376&highlight=useportblcd |
|
|
|