Not compiling into new micro controller

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Not compiling into new micro controller

Post 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
Attachments
TEst 1.fcfx
(9.89 KiB) Downloaded 232 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Not compiling into new micro controller

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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

George Ludd
Posts: 1
Joined: Fri Dec 07, 2018 9:22 am
Contact:

Re: Not compiling into new micro controller

Post 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

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: Not compiling into new micro controller

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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

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: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post by Lord Grezington »

Hi Ben

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

Thanks

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

Post by LeighM »

You will need to choose 3 from Channels 1,2,3,4 only

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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
Attachments
POC test 0.1.fcfx
(23.46 KiB) Downloaded 138 times

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post by Lord Grezington »

Hi Leigh

I think you may have missed the last post.

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post by Lord Grezington »

Thanks

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

Post by LeighM »

Please drop attached file into ..
C:\ProgramData\MatrixTSL\FlowcodeV8\FCD\PIC16
Attachments
30F3011.fcdx
(24.88 KiB) Downloaded 133 times

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Not compiling into new micro controller

Post 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

Lord Grezington
Flowcode V4 User
Posts: 288
Joined: Wed Nov 02, 2011 11:15 pm
Has thanked: 29 times
Been thanked: 30 times
Contact:

Re: Not compiling into new micro controller

Post 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

Post Reply