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

"Solved" Code Compiling with Ccsc.exe in Mplab IDE

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



Joined: 21 Jul 2008
Posts: 15
Location: Shanghai, China

View user's profile Send private message

"Solved" Code Compiling with Ccsc.exe in Mplab IDE
PostPosted: Thu Dec 04, 2008 4:34 am     Reply with quote

Hello, guys,

I am trying to compile the code in Mplab IDE with calling Ccsc.exe , which is compiled successfully in CCS Rev 4.080.

And I have checked some topics on code compiling with Ccsc.exe in Mplab IDE, only the main.c is included in the source file of project and other .h and .c files are added into the other files directory according to the previous suggestion.

The files structure is shown below,

--Source files
---main.c
--Header files
---24FJ128GA106.h
---aa.h
---variables.h
--Other files
---2402.c
---bb.c
---cc.c



But I met some errors during compiling.

The 2402.C is called in my main.c file, but when I compiled it in Mplab IDE the i2c functions could not be recognized by the compiler. And the pins definitions are not recognized by the compiler too.

*** Error 100 "D:\Program Files\PICC\drivers\2402.C" Line 51(5,49): USE parameter value is out of range Not a number: PIN_C4
*** Error 12 "D:\Program Files\PICC\drivers\2402.C" Line 57(27,28): Undefined identifier PIN_C3
*** Error 12 "D:\Program Files\PICC\drivers\2402.C" Line 58(27,28): Undefined identifier PIN_C4
*** Error 12 "D:\Program Files\PICC\drivers\2402.C" Line 63(13,14): Undefined identifier -- i2c_start
*** Error 12 "D:\Program Files\PICC\drivers\2402.C" Line 64(19,20): Undefined identifier -- i2c_write
*** Error 12 "D:\Program Files\PICC\drivers\2402.C" Line 65(12,13): Undefined identifier -- i2c_stop


And the following is the code in 2402.C

#ifndef EEPROM_SDA

#define EEPROM_SDA PIN_C4
#define EEPROM_SCL PIN_C3

#endif


#use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL)

......................
BOOLEAN ext_eeprom_ready() {
int1 ack;
i2c_start(); // If the write command is acknowledged,
ack = i2c_write(0xa0); // then the device is ready.
i2c_stop();
return !ack;
}
......................

Why the compiler could not recognize the i2c functions ?

And what are the configurations I should do to compile the code in Mplab IDE with calling Ccsc.exe and then program the target chip in IDE via ICD2.

BTW, when I want to import the .hex file generated by the CCS IDE to Mplab IDE and then try to program the target chip, I met the checksum error as following,

The line checksum on line 2 of the hex file is incorrect; the hex file appears to have been corrupted.
:040000001CF2000400


Any solution on them to help me out?

Thanks in advance and appreciated.
_________________
Don Quixote


Last edited by donquixote on Wed Dec 10, 2008 4:24 am; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 04, 2008 1:41 pm     Reply with quote

Make a small test project with a main source file that #includes the
2402.c file.
For example, this program could be called Test.c and it could be in
a project called "Test". In MPLAB, only the Test.c file would be added
to the project. Then compile the project. It should compile OK.
Code:
#include <16F877A.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)

#include <2402.c>

//===========================
void main()
{
int8 c;

init_ext_eeprom();
write_ext_eeprom(0, 0x55);
c = read_ext_eeprom(0);

while(1);
}

Try this with your PIC. See if you can make it work.
donquixote



Joined: 21 Jul 2008
Posts: 15
Location: Shanghai, China

View user's profile Send private message

PostPosted: Wed Dec 10, 2008 4:23 am     Reply with quote

PCM programmer wrote:
Make a small test project with a main source file that #includes the
2402.c file.
For example, this program could be called Test.c and it could be in
a project called "Test". In MPLAB, only the Test.c file would be added
to the project. Then compile the project. It should compile OK.
Code:
#include <16F877A.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)

#include <2402.c>

//===========================
void main()
{
int8 c;

init_ext_eeprom();
write_ext_eeprom(0, 0x55);
c = read_ext_eeprom(0);

while(1);
}

Try this with your PIC. See if you can make it work.


Thanks . It works.
_________________
Don Quixote
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