Page 1 of 1

c code to mplabx

Posted: Thu Jan 05, 2017 4:16 pm
by scollins22
Hello I have a file that I have copied and pasted the c code into mplab x. When I compile there are so many problems that I am a bit confused to which way to correct and why. I am very new to c. Can any one help please.

Re: c code to mplabx

Posted: Thu Jan 05, 2017 4:49 pm
by EtsDriver
Why would you want to copy Flowcode program to mplab? Why not program from flowcode, or use the generated .hex file?
Generally flowcode uses its own libraries, and that might cause problems.

Re: c code to mplabx

Posted: Thu Jan 05, 2017 4:58 pm
by Benj
Hello,
When I compile there are so many problems that I am a bit confused to which way to correct and why.
What problems are you getting?

Re: c code to mplabx

Posted: Thu Jan 05, 2017 6:09 pm
by QMESAR
scollins22 wrote:Hello I have a file that I have copied and pasted the c code into mplab x. When I compile there are so many problems that I am a bit confused to which way to correct and why. I am very new to c. Can any one help please.
I am also interested to know why would you want to compile FC generated C code in MPLABx as FC use the exact same compiler as MPLABx :shock:

Re: c code to mplabx

Posted: Fri Jan 06, 2017 11:41 am
by scollins22
Hello

I am a technician at college.I have been asked by a lecturer at my college to do this. It is because the college has been asked to do c as a mandatory subject with microcontrollers and the teachers are not sure about c code. They work well with flow code but they are trying to get the students to analyse the c code after making a flowchart and spotting the difference in the code that compiles in mplabx but is created in flowcode. I think it is their way of generating the c code that runs in a circuit without knowing the code well. sorry if it is a problem.

Re: c code to mplabx

Posted: Fri Jan 06, 2017 12:21 pm
by Benj
Hello,

It should work ok as long as Flowcode is installed on the computer. The C code refers to the Flowcode CAL libraries but the reference should be ok as long as Flowcode is installed and in the correct position on the drive.

Please can you attach your MPLABX project in a zip file and also attach the errors you are receiving and we will try and help to get this setup so it works correctly.