|
|
View previous topic :: View next topic |
Author |
Message |
rhein
Joined: 03 Mar 2006 Posts: 4
|
LCD code with PIC16F628 |
Posted: Fri Mar 03, 2006 8:01 am |
|
|
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
|
|
Posted: Fri Mar 03, 2006 1:08 pm |
|
|
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
|
|
Posted: Fri Mar 03, 2006 1:31 pm |
|
|
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.
|
|
|
Guest
|
|
Posted: Mon Mar 06, 2006 2:20 am |
|
|
I think sonicdeejay has posted a nice example in code library. |
|
|
|
|
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
|