CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

first lcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

first lcd
PostPosted: Fri May 18, 2007 7:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri May 18, 2007 12:04 pm     Reply with quote

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.
Code:
while(1);
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

tks
PostPosted: Fri May 18, 2007 1:18 pm     Reply with quote

thank you very much PCM PROGRAMMER...

It is woking
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group