View previous topic :: View next topic |
Author |
Message |
nina
Joined: 20 Apr 2007 Posts: 111
|
first lcd |
Posted: Fri May 18, 2007 7:37 am |
|
|
I wrote a simple program just to test a lcd.
Over lcd.c driver the conection of lcd is made on pin D. If I want change this conection and put on pin B what do I need to do
my program is
#include <16f877.h>
#use delay(clock=4000000)
#fuses nowdt,noput,nobrownout,nolvp,noprotect
#include <lcd.c>
#use standard_io (B)
void main(void)
{
lcd_init(); //Inicia LCD
set_tris_b(0x00); /*PortB output*/
lcd_putc("Teste"); //write teste
}
here is my layout
http://pg.photos.yahoo.com/ph/fernandoazevedo.rm/detail?.dir=d40ascd&.dnm=8aabscd.jpg
thanks |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri May 18, 2007 12:04 pm |
|
|
You need to tell the lcd driver to use Port B. You can do this by adding
the line shown below in bold to your program. Put it just above the
#include line for the lcd driver. Example:
Quote: |
#define use_portb_lcd 1
#include <lcd.c>
|
Also, delete the TRIS statement for Port B, and put a constant loop at
the end of your program. Put it just above the closing brace for main.
|
|
 |
nina
Joined: 20 Apr 2007 Posts: 111
|
tks |
Posted: Fri May 18, 2007 1:18 pm |
|
|
thank you very much PCM PROGRAMMER...
It is woking |
|
 |
|