Page 1 of 1

DSPIC30f2010 compilation fails?

Posted: Wed Apr 26, 2017 11:13 am
by EtsDriver
Might be connected to V6 problem


To see if that linked problem exists in V7, I tried to make 4ch PWM on with PIC16 pack license (DSPIC), but seems the XC compiler doesnt like it...

Code: Select all

Target folder: J:\TEST\
Source name:   J:\TEST\dspic30f2010.fcfx
Title:         
Description:   
Device:        PIC16.30F.30F2010
Generated by:  Flowcode v7.2.1.4
Date:          Wednesday, April 26, 2017 12:50:47
Users:         1
Registered to: sensored
Licence key:   sensored
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 7\compilers\pic16\batchfiles\pic16_C30_comp.bat  "dspic30f2010" "J:\TEST\" "30F2010"
Launching compiler...

J:\TEST>xc16-gcc -c -mcpu="30F2010" -omf=coff -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\FLOWCO~2\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\FLOWCO~2\COMPIL~1\pic16\BATCHF~1\" -std=gnu99 "dspic30f2010".c -o "dspic30f2010".o 
Options have been disabled due to restricted license
Visit http://www.microchip.com/ to purchase a new key.
In file included from C:\Program Files (x86)\Flowcode 7\CAL\includes.c:449:0,
                 from dspic30f2010.c:395:
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_3':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:173:3: error: 'OC3RS' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:173:3: note: each undeclared identifier is reported only once for each function it appears in
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:174:3: error: 'OC3R' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:199:11: error: 'OC3CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_3':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:764:3: error: 'OC3CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty8Bit_3':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:835:3: error: 'OC3RS' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty10Bit_3':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:1010:3: error: 'OC3RS' undeclared (first use in this function)
In file included from C:\Program Files (x86)\Flowcode 7\CAL\includes.c:470:0,
                 from dspic30f2010.c:395:
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_4':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:214:3: error: 'OC4RS' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:215:3: error: 'OC4R' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:240:11: error: 'OC4CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_4':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:768:3: error: 'OC4CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty8Bit_4':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:839:3: error: 'OC4RS' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty10Bit_4':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:1014:3: error: 'OC4RS' undeclared (first use in this function)

Error returned from [xc16-gcc.exe]
Completed compilation, return = 1

C:\Program Files (x86)\Flowcode 7\compilers\pic16\batchfiles\pic16_C30_comp.bat reported error code 1



FINISHED
Flowcode allows using all channels, but is it the free compiler that prevents us from using more than 2?
dspic30f2010.fcfx
(11.4 KiB) Downloaded 355 times

Re: DSPIC30f2010 compilation fails?

Posted: Wed Apr 26, 2017 11:26 am
by QMESAR
Flowcode allows using all channels, but is it the free compiler that prevents us from using more than 2?
The microchip free compilers does not limit any pin numbers or any peripheral use, it only does not use some very high level optimizations .

Re: DSPIC30f2010 compilation fails?

Posted: Wed Apr 26, 2017 11:28 am
by Benj
Thanks for letting us know.

I have altered the definition file slightly. It seems we currently only support the 2 x CCP type PWM on the dsPIC devices.
30F2010.fcdx
(18.1 KiB) Downloaded 329 times
The other 3/6 PWM are advanced motor control PWM channels which may require a separate component to be created. With the 8-bit PICs I managed to include the advanced PWM using the standard PWM component but with the 30F2010 it looks like it will be tricky to do this.

Re: DSPIC30f2010 compilation fails?

Posted: Thu Apr 27, 2017 10:34 am
by anugani12
Iam getting same complaint. when i have try to add more then 2 pwm compiler error please give me solution and sample with 4 pwm with successful compile
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode 6\compilers\pic16\batchfiles\pic16_C30_comp.bat "dspic30f2010" "F:\firefly\office\ganesh\projects\SOLAR\FINAL solar 05.05.2014\flowcode 6 trail\30F2010\" "30F2010"
Launching compiler...

F:\firefly\office\ganesh\projects\SOLAR\FINAL solar 05.05.2014\flowcode 6 trail\30F2010>pic30-gcc -c -mcpu="30F2010" -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\FLOWCO~2\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\FLOWCO~2\COMPIL~1\pic16\BATCHF~1\..\MX_support" -Wall -std=gnu99 "dspic30f2010".c -o "dspic30f2010".o
In file included from C:\Program Files (x86)\Flowcode 6\CAL\includes.c:258,
from dspic30f2010.c:704:
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_3':
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:173: error: 'OC3RS' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:173: error: (Each undeclared identifier is reported only once
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:173: error: for each function it appears in.)
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:174: error: 'OC3R' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:199: error: 'OC3CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_3':
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:764: error: 'OC3CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty8Bit_3':
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:835: error: 'OC3RS' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty10Bit_3':
C:\Program Files (x86)\Flowcode 6\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:1010: error: 'OC3RS' undeclared (first use in this function)
dspic30f2010.c: In function 'FCD_0ba74_PWM_Digital__ReadASCIILUT':
dspic30f2010.c:778: warning: unused variable 'FCL_POSITION'
dspic30f2010.c: In function 'FCD_0ba73_PWM_Digital__ReadASCIILUT':
dspic30f2010.c:972: warning: unused variable 'FCL_POSITION'
dspic30f2010.c: In function 'FCD_0ba72_PWM_Digital__ReadASCIILUT':
dspic30f2010.c:1166: warning: unused variable 'FCL_POSITION'
dspic30f2010.c: In function 'FCD_0ba71_PWM_Digital__ReadASCIILUT':
dspic30f2010.c:1360: warning: unused variable 'FCL_POSITION'

Error returned from [pic30-gcc.exe]
Completed compilation, return = 1

C:\Program Files (x86)\Flowcode 6\compilers\pic16\batchfiles\pic16_C30_comp.bat reported error code 1


FINISHED

Re: DSPIC30f2010 compilation fails?

Posted: Thu Apr 27, 2017 10:37 am
by anugani12
I have required 4 pwm for Hbridge inverter please give me solution or example file Hbridge.

Re: DSPIC30f2010 compilation fails?

Posted: Thu Apr 27, 2017 4:32 pm
by QMESAR
anugani12 wrote:I have required 4 pwm for Hbridge inverter please give me solution or example file Hbridge.
As you have see here ,there is no direct Flowcode support for the advanced PWM functions of the dsPIC30/33 devices as it is a very complex module with many different configurations
The other 3/6 PWM are advanced motor control PWM channels which may require a separate component to be created. With the 8-bit PICs I managed to include the advanced PWM using the standard PWM component but with the 30F2010 it looks like it will be tricky to do this.
You have to take the datasheet and use a C component and configure the PWM module to your application needs yourself :D

Re: DSPIC30f2010 compilation fails?

Posted: Fri Apr 28, 2017 2:41 pm
by anugani12
Thank you for reply.
Can you help with sample code for c component please add for 1pwm. And is it shown in simulation ?