Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help using CCS C compiler

Status
Not open for further replies.

impakt

Member level 4
Joined
Dec 19, 2005
Messages
71
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,816
ccs c compiler

While I tried to compile a C code using CCS compiler, I was given an error:
Can not change device type this far into the code Can anyone tell me how to solve it?
 

alexz

Full Member level 5
Joined
Nov 19, 2004
Messages
283
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,298
Location
UK
Activity points
2,246
can not change device type this far into the code

Did you change your device in the MPLAB
 

impakt

Member level 4
Joined
Dec 19, 2005
Messages
71
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,816
ccs c include header file

I'm not using MPLAB, only CCS!
 

BeeBop

Full Member level 3
Joined
Feb 19, 2006
Messages
158
Helped
15
Reputation
30
Reaction score
1
Trophy points
1,298
Activity points
3,696
comvdd.zip

Hi Impakt,
Sounds like you are #including another C file? If that is the case, that other file probably #includes a device, so just remove your #include <device> from your C file. Hope this makes sense!
Regards,
Robert
 

VSMVDD

Banned
Joined
Jun 12, 2005
Messages
646
Helped
92
Reputation
184
Reaction score
34
Trophy points
1,308
Location
scotland uk
Activity points
0
math.h code composer studio

if your using a .h file
the device type needs to be in the header


and not in the .c files

here is an example

comvdd.h file
=========
#include <16F877.H> << include header file

#fuses HS, NOPROTECT, PUT, NOWDT, BROWNOUT, NOLVP, NOCPD

#device *=16 //use 16 bit
#device ADC=10 // use 10 bit adc convertions

/// for a boot loader
#ORG 0x1F00,0x1FFF //for the 8k 16F876/7
void loader() { }

// mcu clock
#use delay(clock=20000000)

type defines.....



comvdd.c file
=========

#include "COMVDD.H"
// STANDARD LIBRARYS INCLUDED
#include <STDLIB.H>
#include <stdio.h>
#include <ctype.h>
#include <math.h>
#include "COMVDD_PORTS.C" << include other .c files
#include "COMVDDLCD.C" << include other .c files

... main routines

i attached the full code if you want to build it
youll need to divy up a blank project and add the files back in



if you look in comvdd folder
there is also an example of an inline version
some code may be usefull to you
check this direct link
https://uk.geocities.com/vsmvdd/COMVDD_EBOX_DESIGN.zip
 

salma ali bakr

Advanced Member level 3
Joined
Jan 27, 2006
Messages
971
Helped
104
Reputation
206
Reaction score
21
Trophy points
1,298
Activity points
7,491
ccs c ctype

doesn't the ccs c compiler output a hex file so that i can use it by icprog to program the pic ???
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top