C Programming Microchip

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
gianV
Posts: 1
Joined: Mon Apr 06, 2020 9:24 am
Contact:

C Programming Microchip

Post by gianV »

Hi
I would like to integrate C and assembler into flowcode.
Because the editor in flowcode is not the greatest, I want to use MPLabx as the editor.

I find I can include a c file at the beginning of the main flowcode program and this gets compiled into the code.

#include "ThyExternal.h"
in the supplementary defines and this works ok.

What I can't do is call a c routine from an interrupt routine. They have the wrong scope. I also can't place my own interrupt routine.

I also want to include an assembler file into the project. I can't get this right without using
asm (" mov W0, TBLPAG ") ; Which is very painful.

I also have a licensed copy of XC16. But if I point to that in your batch file the linker commands are all messed. It would be nice to get the latest compiler with optimisations working in flowcode.

And finally, I would like to incorporate flowcode into an MPLAB project and compile from there. Then I could debug properly. I think this relates to the above problem so if I get the correct linker then the whole project should compile in mplab. This would solve everything as I could then use assembler with no problem.

Thanks in anticipation.

User avatar
Steve
Matrix Staff
Posts: 3418
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: C Programming Microchip

Post by Steve »

Thanks for the feedback. Here are some suggestions:
gianV wrote: What I can't do is call a c routine from an interrupt routine. They have the wrong scope. I also can't place my own interrupt routine.
In the interrupt icon properties, you can select "custom" in the "interrupt on" drop-down and then select "properties..." which will allow you to customise your enable/disable and handler code.
gianV wrote: I also want to include an assembler file into the project. I can't get this right without using
asm (" mov W0, TBLPAG ") ; Which is very painful.
You might be able to add specific assembly files onto the command line for compilation and/or linking. Do this by either editing the batch file or creating a new entry in the compiler options screen.
gianV wrote: I also have a licensed copy of XC16. But if I point to that in your batch file the linker commands are all messed. It would be nice to get the latest compiler with optimisations working in flowcode.
Again, you should be able to create a new entry in the compiler options screen. This screen is not the most intuitive to use, though.
gianV wrote: And finally, I would like to incorporate flowcode into an MPLAB project and compile from there. Then I could debug properly. I think this relates to the above problem so if I get the correct linker then the whole project should compile in mplab. This would solve everything as I could then use assembler with no problem.
We looked into this a long time ago and it did not seem easy to do. Perhaps it is easier now in MPLABX? We are very busy right now with a new version of Flowcode so I can't look right now, but I will try to find the time in a few months.

Post Reply