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

LCD code with PIC16F628

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



Joined: 03 Mar 2006
Posts: 4

View user's profile Send private message

LCD code with PIC16F628
PostPosted: Fri Mar 03, 2006 8:01 am     Reply with quote

Hi , i wrote the following code , using the LCD with a PIC16F628, but it doesnt work, i'm using the library mod_lcd.c, that is provided with PCW.i wrote a code in assembly and it works perfectly.

anyone could help me ?
thanks for anyhelp

#include <16f628.h>
#use delay(clock=4000000)
#fuses NOWDT,INTRC_IO,NOPUT,NOPROTECT,NOBROWNOUT,NOMCLR,NOLVP,NOCPD
#include "mod_lcd.c"

void main()
{

setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);

lcd_init();
lcd_putc("\fTeste...\n");

while (true)
{
}
}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 03, 2006 1:08 pm     Reply with quote

Quote:
using the library mod_lcd.c, that is provided with PCW.

I don't think that file comes with PCW. The CCS driver is called LCD.C.
You may have modified LCD.C and renamed as "mod_lcd.c".

You can use the CCS driver with the 16F628, but you need to configure
the driver to use Port B. To do this, make the changes shown in bold
below.

Notice that I have changed #include statement to use the LCD.C driver
(not "mod_lcd.c"). Also notice the #define statement above the
#include. That statement configures LCD.C to use Port B.

Quote:

#include <16F628.h>
#fuses INTRC_IO,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOMCLR,NOLVP,NOCPD
#use delay(clock=4000000)


#define use_portb_lcd 1
#include <lcd.c>

void main()
{
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);

lcd_init();
lcd_putc("\fTeste...\n");


while(1);
}
Guest








PostPosted: Fri Mar 03, 2006 1:31 pm     Reply with quote

You're right, i made mess, the driver for lcd that comes with the PCW is LCD.c, so i will do the modifications that you propose.

thanks for the help.

Smile
Guest








PostPosted: Mon Mar 06, 2006 2:20 am     Reply with quote

I think sonicdeejay has posted a nice example in code library. Wink
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