Page 1 of 2

Not compiling into new micro controller

Posted: Thu Dec 06, 2018 4:51 pm
by Lord Grezington
Hello

I have receindtly redesigned a PCB and needed ti change the micro on it to one of the slightly newer ones PIC16F15323 from a PIC16F1503. I need 3 PWM's on the program which worked fine with the 1503 but for some reason when I transition over to the 15323 I get the compiling errors below.

I have started a new programn to identify where the issues are. and it seems no matter what PWM channel I use, everytime I put 3 PWM icons onto the 2D panel and try compile I get the errors (I get differnet CCP*CON's for favious channels).

the 15323 has 6 PWM channels, anyone know why its now working? I need an answer ASAP please. I have also attached a small example

Registered to: Lord Grezington
License key: 6BDBE3
http://www.matrixtsl.com
Launching the compiler...
C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat 16F15323 "C:\Users\pc\Desktop\" "TEst 1"

C:\Users\pc\Desktop>C:\PROGRA~2\Flowcode\Common\COMPIL~1\pic\batch\..\bin\xc8.exe --chip=16F15323 "TEst 1.c" --MSGDISABLE=359,1273,1388 --FLOAT=32 --DOUBLE=32
Microchip MPLAB XC8 C Compiler (Free Mode) V1.45
Build date: Nov 15 2017
Part Support Version: 1.45
Copyright (C) 2017 Microchip Technology Inc.
License type: Node Configuration

C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_Enable_3()
154: CCP3CON = 0x9F;
^ (192) undefined identifier "CCP3CON"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_Disable_3()
368: CCP3CON = 0x00;
^ (192) undefined identifier "CCP3CON"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_SetDuty8Bit_3()
489: CCPR3H = duty;
^ (192) undefined identifier "CCPR3H"
490: CCPR3L = 0;
^ (192) undefined identifier "CCPR3L"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_PWM.c: FC_CAL_PWM_SetDuty10Bit_3()
1116: CCPR3H = duty >> 2;
^ (192) undefined identifier "CCPR3H"
1117: CCPR3L = duty << 6;
^ (192) undefined identifier "CCPR3L"
(908) exit status = 1
(908) exit status = 1

Error returned from [xc8.exe]

C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat reported error code 1



FINISHED

Re: Not compiling into new micro controller

Posted: Thu Dec 06, 2018 5:53 pm
by medelec35
Hi Looking at the datasheet, there are only 2CCP registers which Flowcode uses.
There for if you delete the 3rd pwm, then flowchart should compile for you.

Re: Not compiling into new micro controller

Posted: Thu Dec 06, 2018 7:35 pm
by Lord Grezington
Hello Martin

Yes I have noticed this, but I need 3 to work on this project.

How can I get access to the other PWM's? Can they not work with flowcode at all? (and why is there a drop down menu for the option to choose 6 channels?)

I dont need to do anything too complex with the PWM and only need 8bits, bit I think the project is too complex to try and bit bang them.

Thanks
Graham

Re: Not compiling into new micro controller

Posted: Fri Dec 07, 2018 9:33 am
by George Ludd
Hi,

I am working on the same issue and we have still not been able to find a resolution. Is it possible that there is a quick fix or workaround on Flowcode to activate the 4 other PWM channels on the PIC16F15323? It seems that that there must be a solution given that it worked fine with PIC16F1503. The 1503 doesn't have any CCP modules. Is it possible that we could disable these on the PIC16F15323 in order to access the standard PWMs?

Any ideas/help greatly appreciated.

Thanks

George

Re: Not compiling into new micro controller

Posted: Fri Dec 07, 2018 11:51 am
by Benj
Hello George,

I've pushed a new update to the PIC16F15323 definition file as well as the rest of the family.

Please have a go and let us know how you get on.

Re: Not compiling into new micro controller

Posted: Fri Dec 07, 2018 12:15 pm
by Lord Grezington
Hi Ben

I have refreshed the updates, but there is still nothing there. Do they take a long time to come through?

Thanks

Re: Not compiling into new micro controller

Posted: Fri Dec 07, 2018 12:26 pm
by Benj
Hello,

It should be instantaneous.

Are you using Flowcode 8.1? If not then you will need to update from version 8.0

Re: Not compiling into new micro controller

Posted: Fri Dec 07, 2018 12:51 pm
by Lord Grezington
Thanks Ben

Downloaded the 8.1 patch, did the updates and ran a test program. It all seems to be working OK so far.

Thanks

Re: Not compiling into new micro controller

Posted: Thu Dec 20, 2018 3:03 pm
by Lord Grezington
Hello Ben

I have the same problem again, but now with a dsPIC30F3011. I am getthing the following compiling errors. I only get the error when I have the Channel 6 PWM component on the dashboard.

C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Enable_2':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:301:3: error: 'OC6RS' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:301:3: note: each undeclared identifier is reported only once for each function it appears in
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:302:3: error: 'OC6R' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:327:11: error: 'OC6CON' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_Disable_2':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:781:3: error: 'OC6CON' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty8Bit_2':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:852:3: error: 'OC6RS' undeclared (first use in this function)
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c: In function 'FC_CAL_PWM_SetDuty10Bit_2':
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\/PIC16BIT\PIC16BIT_CAL_PWM.c:1027:3: error: 'OC6RS' undeclared (first use in this function)

Thanks

Re: Not compiling into new micro controller

Posted: Wed Jan 02, 2019 1:20 pm
by Lord Grezington
Hi Ben

I need answer to this please, I think it may need another update.

Thanks

Re: Not compiling into new micro controller

Posted: Wed Jan 02, 2019 1:55 pm
by LeighM
Hi Graham,
The dsPIC30F3011 has 4 standard (output compare) PWM channels, see datasheet pages 4 and 89.
Looks like we will need to reduce the channel list accordingly.
We do not yet support the "motor control" mode.
Leigh

Re: Not compiling into new micro controller

Posted: Wed Jan 02, 2019 4:33 pm
by Lord Grezington
Hi Leigh

Thanks for the reply.

I only need 3 standard PWM channels, but everytime I add the third one I get the error code listed on the previous post. This happened a little while back with a different micro and Ben managed to doing an update on V8.1 to get it working.

(I am using Channels 2, 4 & 6)

Thanks

Re: Not compiling into new micro controller

Posted: Wed Jan 02, 2019 4:37 pm
by LeighM
You will need to choose 3 from Channels 1,2,3,4 only

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 1:38 pm
by Lord Grezington
Hi Leigh

OK, so when I change from channel 6 down to channel 3 I can now compile.

But I think I am missing something. In simulations the PWM works OK but I get nothing on the hardware when I just enable the PWM and set a duty cycle.

I have tried fiddling with the configuration settings, but still no luck getting something going. Are there some other registers I need to set with c code?

The program is attached

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 1:58 pm
by Lord Grezington
Hmmmm, I have just taken the scope to all the pins around the micro. It seems I am getting a PWM output at the correct duty cycle but on the wrong pin. I did not know there were re-mappable or alternative pins for the PWM's...

However, the PWM is coming out on EMUD2/OC2/IC2/INT2/RD1 which seems a littel confusing. Perhaps something to do with the capture input? On the FC8.1 it shows the options for all 6 PWM channels and the allocated pins for the PWM's on the software match the pwm pins on the datasheet.

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 2:07 pm
by LeighM
Hi,
I think the definition file for this device has other errors too.
Could you see if you are getting PWM output on port D (OCx pins) rather than port E (as indicated by the component)
Thanks
Leigh

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 2:09 pm
by Lord Grezington
Hi Leigh

I think you may have missed the last post.

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 2:11 pm
by LeighM
Ah right thanks, our messages crossed in the ether :)
That confirms what I thought, I will send a new FCD with the corrections.

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 2:14 pm
by Lord Grezington
Thanks

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 2:15 pm
by LeighM
Please drop attached file into ..
C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC16

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 3:09 pm
by Lord Grezington
Hi Leigh

I have had to put it into a differnet place C:\Program Files (x86)\Flowcode v8\DefaultData\FlowcodeV8\FCD\PIC16 but it does not seem to be working. IS it in the wrong location?

I have re-started FC8 as well, but the PWM is still going out of PortD

Thanks

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 3:28 pm
by LeighM
Yes, it's wrong, that's the directory where Flowcode keeps the default installation files.

You need to drop the new file into
C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC16

nb. C:\ProgramData is usually hidden by Windows

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 3:44 pm
by Lord Grezington
Hello Leigh

It just does not seem to be my day today...

I copied and pasted teh location and relpaced the file.
I then re-started FC8, saw the update, downloaded update and re-started again.
Compiled the program again, and tested it on hardware.

The PWM is still coming out of PortD

Re: Not compiling into new micro controller

Posted: Thu Jan 03, 2019 4:18 pm
by LeighM
Hi
Sorry, I should have said, once you have copied the file, I attached, into your working directory, DO NOT let the auto-update system change this file.
It will copy the old one back. This is because the fixed file I have made is not yet loaded in the auto-update system.
(Staff that do this not back in office yet!)
Leigh

ps. Port D is the correct port for the standard PWM outputs. We don't yet support the advanced motor PWM outputs on port E
See datasheet pages 4 and 89

Re: Not compiling into new micro controller

Posted: Tue Jan 08, 2019 10:47 am
by Lord Grezington
Hi Leigh

Please can you let me know when I can perform the update without needing to add the file again?

Thanks