View previous topic :: View next topic |
Author |
Message |
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
Problems with PCM's flexdriver |
Posted: Mon Nov 12, 2007 9:35 am |
|
|
Hi.
I downloaded the driver PCM designed for the 2*16 lcd display.
I changed the following in the code as it is stated.
Code: | #define LCD_DB4 PIN_B0
#define LCD_DB5 PIN_B1
#define LCD_DB6 PIN_B2
#define LCD_DB7 PIN_B3
#define LCD_E PIN_A1
#define LCD_RS PIN_A3
#define LCD_RW PIN_A2 |
I get the following error and i didn't get the same error after I used it for the first time.
Code: | Executing: "C:\Program Files\PICC\Ccsc.exe" "flex_lcd.c" +FM +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 128 "C:\LCD\flex_lcd.c" Line 28(1,43): A #DEVICE required before this line
1 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Mon Nov 12 20:11:40 2007 |
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 12, 2007 1:09 pm |
|
|
Try a simple program like the one below. The .H file for your PIC
contains the #device statement for the PIC. Don't edit the .H file.
Don't add another #device statement to the flex_lcd.c file. The first
three lines of your program should look like this: #include file, #fuses,
and #use delay() statements. If you do it like that, you won't have any
problems.
Code: |
#include <16F877.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#include "flex_lcd.c"
//==========================
void main()
{
lcd_init(); // Always call this first.
lcd_putc("\fHello World\n");
lcd_putc("Line Number 2");
while(1);
} |
|
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Mon Nov 12, 2007 1:17 pm |
|
|
I did it exactly as on top.
I pasted your code that you just placed in the window and it still gives me the same error. It did work fine earlier today but as i changed the project to a new project, it started giving errors. I then went back to the original program and it also gives the same error message now. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 12, 2007 1:32 pm |
|
|
This is probably the answer:
Somewhere you have got a .H file for your PIC in which the #device
statement has been commented out or deleted. Look in the local
project directory and also look in the c:\Program Files\PICC\Devices
directory. Carefully check the .H file. |
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Mon Nov 12, 2007 1:37 pm |
|
|
Here is the part of the header file and the .h file has got the #device statement correclty in.
Code: | //////// Standard Header file for the PIC16F886 device ////////////////
#device PIC16F886
#nolist
//////// Program memory: 8192x14 Data RAM: 367 Stack: 8
//////// I/O: 25 Analog Pins: 14
//////// Data EEPROM: 256
///// |
Could it possibly be the MPlab that needs to be reinstalled or the ccs compiler? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Mon Nov 12, 2007 4:24 pm |
|
|
Thanks
I reinstalled ccs and it is working fine now. |
|
|
|