PIC18F45K80 PWM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

PIC18F45K80 PWM

Post by msahin1976 »

I need to use two PWM output in PIC18F45K80 at the same time. In the datasheet it seems that I can use Timer 2 or Timer4 as PWM timer. So I can make it. But Flowcode only allows Timer 2. I can’t use the second pwm output. Is this normal or can I fix it?

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: PIC18F45K80 PWM

Post by Benj »

Hello,

Please can you try this updated definition file and see how you get on.

Simply copy to your "Flowcode 6/FCD/PIC" folder and then restart Flowcode.
18F45K80.fcdx
(32.83 KiB) Downloaded 234 times

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PIC18F45K80 PWM

Post by msahin1976 »

Dear Benj,
Thank you for your fast answer. Now it is allowing to select the other timers to use for PWM. But now when I try to compile, it is showing an error as "Illegal redefinition of symbol: MX_PWM_PERIOD". It doesn't allow me to use it.

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PIC18F45K80 PWM

Post by msahin1976 »

msahin1976 wrote:Dear Benj,
Thank you for your fast answer. Now it is allowing to select the other timers to use for PWM. But now when I try to compile, it is showing an error as "Illegal redefinition of symbol: MX_PWM_PERIOD". It doesn't allow me to use it.
Hello Benj, how are you? I'm waiting for this issue. Would you please tell me if you see this message or not?

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: PIC18F45K80 PWM

Post by LeighM »

Hi,
Could you post your Flowcode project file (*.fcfx)
And just confirm that you are using Flowcode v6?
Thanks

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PIC18F45K80 PWM

Post by msahin1976 »

LeighM wrote:Hi,
Could you post your Flowcode project file (*.fcfx)
And just confirm that you are using Flowcode v6?
Thanks
Yes, we are using Flowcode v6. I attached the project file. There are two PWM output in this project.
Attachments
LCD controller.fcfx
(278.71 KiB) Downloaded 231 times

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: PIC18F45K80 PWM

Post by LeighM »

Thanks for the file.
It compiles OK for me.
Attached is latest PWM component, perhaps you have an older one, just drop this into your Flowcode 6 installation components directory,
and re-start Flowcode.
Attachments
PWM.fcpx
(7.82 KiB) Downloaded 218 times

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PIC18F45K80 PWM

Post by msahin1976 »

Nothing changed. Flowcode v6 is giving the same error. Also, I checked Flowcode 6 version.

"Your current version is: 6.1.4
Your version of Flowcode6 is up to date."

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: PIC18F45K80 PWM

Post by LeighM »

Did you replace the component? Or move the old one to another directory?
If you just rename the old one it could still be used by Flowcode.

Could you send your LCD Controller.c file?

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PIC18F45K80 PWM

Post by msahin1976 »

After your message I totally removed the file and it is doing the same thing.
Attachments
LCD controller.c
(233.36 KiB) Downloaded 202 times

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: PIC18F45K80 PWM

Post by LeighM »

Ah, thanks, now I see the issue, please replace attached component ...
Attachments
cal_pwm.fcpx
(8.22 KiB) Downloaded 215 times

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PIC18F45K80 PWM

Post by msahin1976 »

Hi Benj. It is working. Thank you for your help. :D

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: PIC18F45K80 PWM

Post by Benj »

I assume you meant to be thanking Leigh :wink:

Thanks though I'm happy to take the credit :mrgreen:

Post Reply