Page 1 of 1

Additions to Flowcode

Posted: Tue Nov 06, 2018 10:26 am
by QMESAR
Hi Team,

I am working on a Motor Control projects and as a standard the chip manufactures STM ,TI and Microchip has all the needed FOC files and Transforms available no need to reinvent the wheel :D
In my case using a dsPIC33EP device the FOC files and Park/Clark transforms are in "S" and "inc" this just made me think is there away to include these manufacturer files in FC project :D these S and inc file is actually intended to speed up the calculation time of the FOC algorithm as it uses the MAC instructions and assembly with Q15 format. the actual user code is in plain C but the functions are then executed with in the S and inc file

Just curious to know as I am trying for some time now to use only FC but projects like this makes it hard to switch to only one tool , to maintain a few tool chains are costly specially where I am living and working :oops:
P1.jpg
P1.jpg (33.77 KiB) Viewed 2398 times
P2.jpg
P2.jpg (49.5 KiB) Viewed 2398 times

Re: Additions to Flowcode

Posted: Wed Nov 07, 2018 11:48 am
by Benj
Hello Peter,

The include files you mentioned should work fine with Flowcode as they are using the same compiler underneath.

The only thing you will need to do differently is to add the files via the compiler batch file.

The file you will likely need to edit is most likely installed here: "C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch"

I don't have the default toolchain installer so the path might be slightly different to this.

Open the file with a text editor and edit this line to include your .S and other included files.

Code: Select all

%~dp0..\bin\xc8.exe --chip=%~1  "%~3.c" --MSGDISABLE=359,1273,1388 --FLOAT=32 --DOUBLE=32
Just add the following to the end of the line and hopefully that should do it.

Code: Select all

-I"PathToFile.S"
Each include file likely has to be -I included separately.

Code: Select all

-I"PathToFile1.S" -I"PathToFile2.S" -I"PathToFile3.S"
Might be worth making an alternate batch file and then it is easier to switch between batch files using the Flowcode compiler options window.

Re: Additions to Flowcode

Posted: Wed Nov 07, 2018 1:22 pm
by QMESAR
Hi Ben.

Thanks a million for your advise :D
I will try this at some stage when the pressure is bit lower as this will make it for me really the case of 1 tool change to update regularly and not 3
I hope this will work as you can imagine to do all these support files for FOC is no joke in another tool change . :D

Great stuff i will be back some time