Page 1 of 1

PWM macro compilation error (PIC24FJ256GA110)(SOLVED)

Posted: Fri Apr 28, 2017 11:51 am
by Lagoda
Dear Support,
When I want to compile this PWM example program, I get the next error message.
I use PIC24FJ256GA110 chip.


http://www.matrixtsl.com
Fordító indítása...
C:\Program Files (x86)\Flowcode 7\compilers\pic16\batchfiles\pic16_C30_comp.bat "pwm_fader" "H:\Flowcode\BUG\" "24FJ256GA110"
Launching compiler...

H:\Flowcode\BUG>xc16-gcc -c -mcpu="24FJ256GA110" -omf=coff -funsigned-char -fno-short-double -Os -I"C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic16\BATCHF~1\..\support\h" -I"C:\PROGRA~2\FLOWCO~1\COMPIL~1\pic16\BATCHF~1\" -std=gnu99 "pwm_fader".c -o "pwm_fader".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:407:0,
from pwm_fader.c:147:
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_1':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:117:11: error: 'OC1CON' undeclared (first use in this function)
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:117:11: 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: In function 'FC_CAL_PWM_Disable_1':
C:\Program Files (x86)\Flowcode 7\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:756:3: error: 'OC1CON' 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

Could anyone help me?

Best Regards,

Lagoda

Re: PWM macro compilation error (PIC24FJ256GA110)

Posted: Fri Apr 28, 2017 3:34 pm
by Benj
Hi Lagoda,

Thanks for letting us know. Hopefully the attached modified CAL should fix the problem for you.

Simply copy the file into your "Flowcode 7\CAL\PIC16BIT" folder and then hopefully this should solve the problem for you.
PIC16BIT_CAL_PWM.c
(25.4 KiB) Downloaded 265 times
Let me know how you get on.

Re: PWM macro compilation error (PIC24FJ256GA110)

Posted: Fri Apr 28, 2017 5:14 pm
by Lagoda
Hi Ben,

Thanks for the quick response.
Now the program's compilation is okay.
Unfortunately, in the target circuit it does not work, the PWM output is constantly low.
If I testing it in the simulator, when the Duty indicator=100% on the Dashboard Panel then the Duty variable is only 64.

Lagoda

Re: PWM macro compilation error (PIC24FJ256GA110)

Posted: Sat Apr 29, 2017 8:52 pm
by Lagoda
Hi Ben,

I tested the program in the target circuit and I've experienced the following.
I used PICKIT3 (PGED1, PGEC1) to programming, and I used Flowkit2 (PGED2, PGEC2) for debugging.
If I set the delay to 100us then the order of execution is 2, 3, 4, 6, 3, 5, (7, 4. 6, 3, 5). The sequence in parentheses repeats in the cycle.
If I set the delay to 1ms, the order of execution is as follows: 2, 3, 4, 6, 3, 5 and the next F8 key is interrupted the debugging. Ghost mode remains active (green toolbar) but tracing is canceled.
In simulation mode, the position marker follows the order sequence on the icons of flowchart. In debugging mode, the position marker will jump over the some icons, but it looks like the jumped command has been executed.
(Would PWM macro has been enabled?) :roll:
Another little thing. If the debugging speed is set to normal, Code Profiling markers will disappear. Is it okay?

Thanks in advance for your help
Best Regards,

Lagoda

Re: PWM macro compilation error (PIC24FJ256GA110)(SOLVED)

Posted: Tue May 02, 2017 7:37 pm
by Lagoda
The PWM error was fixed by the upgrade. :D
(Flowcode_7_Latest_020517.zip)

Thank you very much.

Lagoda