DSPIC30f2010 compilation fails?

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

DSPIC30f2010 compilation fails?

Post 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 299 times
Ill just keep the good work up!

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: DSPIC30f2010 compilation fails?

Post 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 .

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DSPIC30f2010 compilation fails?

Post 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 274 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.

anugani12
Posts: 17
Joined: Wed Apr 26, 2017 8:36 am
Been thanked: 3 times
Contact:

Re: DSPIC30f2010 compilation fails?

Post 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

anugani12
Posts: 17
Joined: Wed Apr 26, 2017 8:36 am
Been thanked: 3 times
Contact:

Re: DSPIC30f2010 compilation fails?

Post by anugani12 »

I have required 4 pwm for Hbridge inverter please give me solution or example file Hbridge.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times
Contact:

Re: DSPIC30f2010 compilation fails?

Post 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

anugani12
Posts: 17
Joined: Wed Apr 26, 2017 8:36 am
Been thanked: 3 times
Contact:

Re: DSPIC30f2010 compilation fails?

Post 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 ?

Post Reply