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

Problem with PCM Programmers 20x4 flex driver

 
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

Problem with PCM Programmers 20x4 flex driver
PostPosted: Wed Apr 09, 2008 1:30 pm     Reply with quote

I cant seem to get a succesfull build of the program. It gives the following message:
Quote:
*** Error 128 "C:\Documents and Settings\Gertjie\My Documents\Puk files\Finale Jaar\Finale jaars projek\Flex_LCD420.c" Line 62(1,43): A #DEVICE required before this line
1 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Wed Apr 09 21:19:27 2008


I basically copied and pasted the program just as is and changed the pin configuration.
I am using a PIC16F886. Has anyone found the same proplem

The line 62(1,43) as in the error is indicated above the int8 lcd_line of the source file.

Code:
#define LCD_LINE_1_ADDRESS 0x00
#define LCD_LINE_2_ADDRESS 0x20
#define LCD_LINE_3_ADDRESS 0x40
#define LCD_LINE_4_ADDRESS 0x60
*/


//========================================

#define lcd_type 2   // 0=5x7, 1=5x10, 2=2 lines(or more)

int8 lcd_line;

int8 const LCD_INIT_STRING[4] =
{
 0x20 | (lcd_type << 2),  // Set mode: 4-bit, 2+ lines, 5x8 dots
 0xc,                     // Display on
 1,                       // Clear display
 6                        // Increment cursor
 };
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

PostPosted: Wed Apr 09, 2008 1:55 pm     Reply with quote

put #include "Flex_LCD.c"
after #device and #use delay
example:
Code:

#include <18F2420.h>
#fuses //some unimportant fuses

#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,stream=RS232,errors)

#include "Flex_LCD.c"

void main()...etc
Gerhard



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

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

PostPosted: Wed Apr 09, 2008 2:00 pm     Reply with quote

I have done that already. The problem doesnt lie in the test program but in the driver program itself. I dont get an error from the test prog. The error lies in the driver prog

Code:
#include <16F886.h>
#fuses intrc, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
//int speed=0;
#include <Flex_LCD420.c>
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 09, 2008 2:34 pm     Reply with quote

Post your compiler version.
Gerhard



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

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

PostPosted: Wed Apr 09, 2008 2:38 pm     Reply with quote

ccs 4.33
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 09, 2008 2:48 pm     Reply with quote

That's not a version number that's been released. Here is a link
to some recent versions:
http://www.ccsinfo.com/devices.php?page=versioninfo
Gerhard



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

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

PostPosted: Wed Apr 09, 2008 2:52 pm     Reply with quote

It is ccs 4.033.
Gerhard



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

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

PostPosted: Wed Apr 09, 2008 4:06 pm     Reply with quote

I have reinstalled both the compiler and the mplab 8. Is the compiler i am using to old or what else could be the problem?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Apr 09, 2008 4:07 pm     Reply with quote

I installed that version of the compiler, and copied and pasted the code
into an MPLAB project, and it worked.

My advice is to re-install the compiler.
Gerhard



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

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

PostPosted: Thu Apr 10, 2008 7:03 am     Reply with quote

I reinstalled the compiler and mplab but i have a strange problem.
If i keep the driver and the test program in the same .c file and i do not add the driver to the source files but directly above the main in the test program the setup works and i dont get an #device error anymore. Why would the compiler only allow one source file in my workspace? If someone has encountered this before please let me know.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 10, 2008 8:26 am     Reply with quote

Are you adding both .c files to the list of source files in the MPLAB project ?
That's the problem. You can't do that with CCS. Only the main
file should be in the "Source Files" section in the MPLAB project window.

If you to put the other .c files in the Project Window, then add them
to the "Other Files" section. That's optional. It's only so you can
conveniently access them in the editor.
Gerhard



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

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

PostPosted: Thu Apr 10, 2008 8:30 am     Reply with quote

Thanks. Silly schoolboy error but i guess thats how we learn.
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