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 support@ccsinfo.com

Problems with PCM's flexdriver

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



Joined: 30 Aug 2007
Posts: 144
Location: South Africa

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

Problems with PCM's flexdriver
PostPosted: Mon Nov 12, 2007 9:35 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Nov 12, 2007 1:09 pm     Reply with quote

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

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

PostPosted: Mon Nov 12, 2007 1:17 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Nov 12, 2007 1:32 pm     Reply with quote

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

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

PostPosted: Mon Nov 12, 2007 1:37 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Nov 12, 2007 1:54 pm     Reply with quote

My advice is to reinstall the CCS compiler. Make sure it's a version
that supports your PIC.
http://www.ccsinfo.com/forum/viewtopic.php?t=31913
Gerhard



Joined: 30 Aug 2007
Posts: 144
Location: South Africa

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

PostPosted: Mon Nov 12, 2007 4:24 pm     Reply with quote

Thanks
I reinstalled ccs and it is working fine now.
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