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.

Converting from CCS to XC8

Status
Not open for further replies.

denny9167

Member level 1
Member level 1
Joined
Apr 23, 2022
Messages
35
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
170
Does anyone have a list of macros used in CCS that has their function equivalent in XC8? Some examples are listed below.

Ex:

input
SET_TIMER1()
GET_TIMER1()
bit-set
bit-clear

Just to name a few.

[moderator action: removed quote tags]
 
Last edited by a moderator:

You will hardly find a recipe for this mapping. This is why it is often preferrable to make use of raw C intructions to set and get registers values instead of built-in compiler's specific obscure API's. In such cases I search for online wizard setup tools ( e.g MCC ) in order to take the microcontroller register source code parameters implementation, as well as related functions, with the extra bonus of added inline comments.
 
Ive been working with MCC some, Im still trying to get a handle on the features and setup, Thanks

I used CCS a few years ago to do a few projects, The performance of the chip suffers, I would just as soon as do something in ASM, than work with CCS code!
 

Depending on the chosen device or code complexity and development speed, I could even consider the Arduino-like style of the CCS, in fact not for projects involving an increasing number of interactions between tasks and hardware peripherals, particularly when using the PIC16 family or above ( you didn't mention which ones you are using ), therefore, migrating from one to another should be done carefully.
 
Depending on the chosen device or code complexity and development speed, I could even consider the Arduino-like style of the CCS, in fact not for projects involving an increasing number of interactions between tasks and hardware peripherals, particularly when using the PIC16 family or above ( you didn't mention which ones you are using ), therefore, migrating from one to another should be done carefully.

Apologies, I mostly work the PIC12 family, and some PIC16 for some of my products. I have some include files that have alot of #defines for my ASM firmware that makes migrating back and forth really easy, Ive worked with a gentleman in the UK that helped me out.
 

Just Googled the CCS User manual and there are functions such as 'set_timer1(value)' and 'value=get_timer1()' (note the manual has these in lower case) listed (page 99 of the document I looked at - https://www.ccsinfo.com/downloads/ccs_c_manual.pdf).
'input(pin)' is listed on page 324 but as you have given no context to the use of these "macros" (as you call them) then I have no idea if this is relevant.
Also there are 'bit_set' and 'bit_clear' functions but I note that use have typed 'bit-set' - with a hyphen rather than an underscore; the hyphen would be interpreted by the compiler as the 'subtract' operator so I assume this is a typo on your part).
Susan
 

Just Googled the CCS User manual and there are functions such as 'set_timer1(value)' and 'value=get_timer1()' (note the manual has these in lower case) listed (page 99 of the document I looked at - https://www.ccsinfo.com/downloads/ccs_c_manual.pdf).
'input(pin)' is listed on page 324 but as you have given no context to the use of these "macros" (as you call them) then I have no idea if this is relevant.
Also there are 'bit_set' and 'bit_clear' functions but I note that use have typed 'bit-set' - with a hyphen rather than an underscore; the hyphen would be interpreted by the compiler as the 'subtract' operator so I assume this is a typo on your part).
Susan
Yes excuse my typos.
 

Does anyone have a list of macros used in CCS that has their function equivalent in XC8? Some examples are listed below.
I agree that this document or even a wrapper library would be useful for people porting CCS code to XC8. But who do you expect to write or having written it?

Some specific CCS built-in functions can be replaced by simple macros, others
would be translated into inline or regular library functions.

I don't understand how the question is related to writing assembler code. You can use assembler instructions in CCS as well.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top