Hi.
I have c code to pic18f458. Usually i "write" in basic, so i've PICbasic PRO compiler. I don't want to buy a C compiler such as CCS, only because just one C code.
Do you know any good free c compiler to pic18f458?
Hi,
Yes, some things may port easily from CCS to C18, but some of the built in functions could be quite difficult to port. CCS is protecting their interests, and hides what it does in these built-ins. Which code is giving you a hard time? Perhaps if you posted your code, you could get some help with it.
Regards,
Robert
Hi,
Yes, some things may port easily from CCS to C18, but some of the built in functions could be quite difficult to port. CCS is protecting their interests, and hides what it does in these built-ins. Which code is giving you a hard time? Perhaps if you posted your code, you could get some help with it.
Regards,
Robert
CCS's reliance on "built-in" functions means you're not writing C really.
C18 (aka MCC18) has libraries, they're not "built-in" per se. Many C programmers recommend against using such libraries or built-ins. As you noted, they aren't portable between compilers. Now you can't really even use a lib function for say setting up an ADC or PWM unless you read the PIC manual and understand how the ADC or PWM module works. If you didn't, you'd just be making guesses at what the lib function's fields were for.
Once you've read the manual, it's not hard at all to just put in register writes to use the module. So, why use such function at all?
AFAIK MCC18 libs are uncompiled C code, so you can snoop into them and see what they're doing. That will either allow you to understand what it does so you can use it appropriately, or make your own code that does what you need.