3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Convert C code into hex?

 I need some to convet this code into hex,The microchip is PIC16F688 and for more information i want to built this project.

3 answers
Feb 20, 2010. 4:53 PMgmoon says:
There are probably a dozen different PIC compilers. Ask the project creator which "C" compiler he used. Too bad that info is not noted in the source file (as it should be.)

Steve pointed out the only one (I believe) which is free (open source), but that doesn't indicate if the code was written for it...

Much of that C code might be usable in other compilers, but it's likely that the function names in the libraries, etc., differ from one compiler to another. I'm talking about functions in the source such as:

setup_timer_0( )
setup_timer_1( )
setup_comparator( )
output_c( )
...etc...

These are functions written specifically for the PIC microprocessor (not part of standard C language or standard C libraries), and will vary compiler-to-compiler.

And the constants (INT_RTCC,GLOBAL) that are used as arguments in these functions might be standard PIC definitions, or they might not be:

enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);

Even the variable declarations are somewhat different than typical "C" declarations...
Feb 20, 2010. 6:01 AMsteveastrouk says:
Post that in your original question !
Feb 20, 2010. 7:39 AMsteveastrouk says:
Answered in your original question.

Steve

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!