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

MPLAB-X CCS and PIC10F320

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



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

MPLAB-X CCS and PIC10F320
PostPosted: Wed May 08, 2013 5:48 pm     Reply with quote

MPLAB-X tested: ver. 1.7 and ver. 1.8
CCS C Compiler ver. 4.140

Here is not a question about the programming of PIC. It is a question about configuration of the MPLAB-X with CCS compiler when is invoked or maybe a bug in MPLAB-X.

I tried with 3 PICs: PIC10F200, PIC10F320 and PIC16F88.
I need to work with all of them, one PIC on different project.

For test purpose the program to be built is simple:
For PIC16F88:
Code:

#include <16F88.h>
int main() {
    return (0);
}

It is similar for PIC10F320:
Code:

#include <10F320.h>
int main() {
    return (0);
}

And the same for PIC10F200:
Code:

#include <10F200.h>
int main() {
    return (0);
}

There are 3 different projects, each with its own C file, tested at different moments.

The project with PIC10F200 and the one with PIC10F88 are compiled without errors.

The project with PIC10F320 gives one error.

On PIC16F88 we have next good output:


make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `D:/PIC PROJECTS/MPLAB/PIC16F88_MPLABX-CS_1.X'
make -f nbproject/Makefile-default.mk dist/default/production/PIC16F88_MPLABX-CS_1.X.production.hex
make[2]: Entering directory `D:/PIC PROJECTS/MPLAB/PIC16F88_MPLABX-CS_1.X'
gnumkdir -p build/default/production
gnumkdir -p dist/default/production
"C:\Program Files\PICC\CCSCON.exe" out="build/default/production" File2.c +FM +DF +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__16F88=TRUE
Memory usage: ROM=0% RAM=1% - 1%
0 Errors, 0 Warnings.
Build Successful.
gnumkdir -p dist/default/production
make[2]: Leaving directory `D:/PIC PROJECTS/MPLAB/PIC16F88_MPLABX-CS_1.X'
make[1]: Leaving directory `D:/PIC PROJECTS/MPLAB/PIC16F88_MPLABX-CS_1.X'

BUILD SUCCESSFUL (total time: 1s)
Loading code from D:/PIC PROJECTS/MPLAB/PIC16F88_MPLABX-CS_1.X/dist/default/production/PIC16F88_MPLABX-CS_1.X.production.hex...
Loading symbols from D:/PIC PROJECTS/MPLAB/PIC16F88_MPLABX-CS_1.X/dist/default/production/PIC16F88_MPLABX-CS_1.X.production.cof...
Loading completed



On PIC10F200 we have next good output:


CLEAN SUCCESSFUL (total time: 100ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `D:/PIC PROJECTS/MPLAB/PIC10F200_MPLABX_CS_1.X'
make -f nbproject/Makefile-default.mk dist/default/production/PIC10F200_MPLABX_CS_1.X.production.hex
make[2]: Entering directory `D:/PIC PROJECTS/MPLAB/PIC10F200_MPLABX_CS_1.X'
gnumkdir -p build/default/production
gnumkdir -p dist/default/production
"C:\Program Files\PICC\CCSCON.exe" out="build/default/production" File1.c +FB +DF +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__10F200=TRUE
Memory usage: ROM=2% RAM=12% - 12%
0 Errors, 0 Warnings.
Build Successful.
gnumkdir -p dist/default/production
make[2]: Leaving directory `D:/PIC PROJECTS/MPLAB/PIC10F200_MPLABX_CS_1.X'
make[1]: Leaving directory `D:/PIC PROJECTS/MPLAB/PIC10F200_MPLABX_CS_1.X'

BUILD SUCCESSFUL (total time: 1s)
Loading code from D:/PIC PROJECTS/MPLAB/PIC10F200_MPLABX_CS_1.X/dist/default/production/PIC10F200_MPLABX_CS_1.X.production.hex...
Loading symbols from D:/PIC PROJECTS/MPLAB/PIC10F200_MPLABX_CS_1.X/dist/default/production/PIC10F200_MPLABX_CS_1.X.production.cof...
Loading completed


On PIC10F320 we have next error output:


CLEAN SUCCESSFUL (total time: 110ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `D:/PIC PROJECTS/MPLAB/PIC10F320_MPLABX_CS_1.X'
make -f nbproject/Makefile-default.mk dist/default/production/PIC10F320_MPLABX_CS_1.X.production.hex
make[2]: Entering directory `D:/PIC PROJECTS/MPLAB/PIC10F320_MPLABX_CS_1.X'
gnumkdir -p build/default/production
gnumkdir -p dist/default/production
"C:\PROGRA~1\PICC\CCSCON.exe" out="build/default/production" File2.c +FB +DF +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__10F320=TRUE
C:\Program Files\PICC\devices\10F320.h:2:9: Error#24 Unknown device type -- Try PCM
1 Errors, 0 Warnings.
Build Failed.
mv: cannot stat `build/default/production/File2.cof': No such file or directory
make[2]: *** [build/default/production/File2.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `D:/PIC PROJECTS/MPLAB/PIC10F320_MPLABX_CS_1.X'
make[1]: Leaving directory `D:/PIC PROJECTS/MPLAB/PIC10F320_MPLABX_CS_1.X'

BUILD FAILED (exit value 2, total time: 1s)





The error consists in the fact that PIC10F320 is treated with PCB instead of PCM version of CCS compiler.

The differences are on the next line:

"C:\Program Files\PICC\CCSCON.exe" out="build/default/production" File1.c +FB +DF +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__10F200=TRUE

Where +FB is mentioned then refers to Base Line PICs as PIC10F200
Where +FM is mentioned then refers to Mid Range PICs as PIC16F88

Now, the error comes from the fact that CCS complier for PIC10F320 is invoked with +FB instead of +FM.

The question is: how do I make MPLAB-X to invoke PCM instead of PCB for PIC10F320? Where are the settings for +FM instead of +FB?


Important to mention:
- When I make a project in CCS IDE with PIC10F320 then there is no problem to compile. There are no errors.
- If I use MPLAB 8.89 with the same CCS 4.140 and I make a project with PIC10F320, again there are no problems at all.

Is it a problem with MPLAB-X and CCS when using PIC10F320?
Is it any chance to modify the invoking of the CCS complier in MPLAB-X?
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Fri May 10, 2013 12:01 pm     Reply with quote

I found a workaround.

Instead of choosing PIC10F320 in the beginning, I choose any Mid Range PIC (as PIC1688 for instance) which requires PCM version compiler of CCS C Compiler. As result, MPLAB-X is set to invoke the CCS C Compiler with +FM.

Then in C source file I just write #include <10F320.h> in the beginning and the compiler gives no more errors when I build the project.
But I never tried to burn the compilation into the PIC to see if I get a mismatch between PIC10F320 and the other Mid range chosen in the beginning, in case some other hidden settings are automatically done by MPLAB-X. That has to be tested.

As conclusion, at least for now, I consider that there is a bug in MPLAB-X. The person who designed the MPLAB-X regarding the integration of CCS C Compiler was probably thinking that every PIC10F is treated by CCS Compiler in the same way forgetting that PIC10F200…PIC10F206 is 12 bit instruction and is treated by PCB version of CCS C Compiler and PIC10F320/322 is 14 bit instruction treated by PCM version of CCS C Compiler.

I also have written to Microchip, I have now a waiting ticket for the present problem.
When I receive an official answer I will post it here also for others.
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Mon May 13, 2013 12:55 am     Reply with quote

I posted the same question on Microchip website forum:
http://www.microchip.com/forums/tm.aspx?tree=true&high=&m=723672&mpage=1#723672

And from I somebody received next answer:

"
It looks like the output added to the generated command line is driven by the device you select when creating the project.
When selecting Mid-Range 8-bit MCUs and PIC10F320, it automatically generates a command line with the +FB output flag, instead of the +FM you believe it should have.

You can add output flags by going to the File > Project Properties > CCS Compiler > Compiler Options.
But, it doesn't look like you can edit the generated command line.

Out of curiosity, see if it builds with the +FM output flag:

1. From your output window, copy the failing generated command line and replace +FB with +FM: "
"C:\PROGRA~1\PICC\CCSCON.exe" out="build/default/production" File2.c +FM +DF +Y=9 +EA +DF +LN +T +A +M +J +EA +Z -P #__10F320=TRUE

2. Launch a command shell, change to your project source code directory, copy and paste the above command line and run it.

If it builds successfully, at least you know that you were right about the +FM flag. It may be a bug you can report to Microchip. Unfortunately, I don't know of any workaround for this issue.
"


Out of curiosity I tested the recommend command prompt approach proposed above and works without giving any error.
viki2000



Joined: 08 May 2013
Posts: 233

View user's profile Send private message

PostPosted: Thu May 16, 2013 3:17 pm     Reply with quote

After submitting the problem to Microchip using a ticket, they changed the CCS plugin in MPLAB-X, by making a new version which solved the problem.

"
Problem Resolution:

Please note that a new version of CCS C Compiler plug-in is available. Please try downloading it and the issue should be resolved.

In order to update the plug-in please go to MPLAB X -> Tools -> Plugins -> Updates -> Reload Catalog and a CCS update should appear in the window...
"
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