Continue to Site

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
68
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Activity points
1,799
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?
 

can not change device type this far into the code

Did you change your device in the MPLAB
 

ccs c include header file

I'm not using MPLAB, only CCS!
 

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
 

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
**broken link removed**
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top