18F46K22 PWM

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

18F46K22 PWM

Post by saschech@gmx.de »

Hello

The Chip-Picture show 2PWM
Datasheet show 5PWM

zyclus-time on my scope show RD1 pin20 250µsec

PWM4 no output on RD2 pin21

Can you help please?

Regards Wolfgang
Attachments
PWM.gif
(108.65 KiB) Downloaded 850 times

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

Re: 18F46K22 PWM

Post by medelec35 »

Hi Wolfgang,
I believe currently Flowcode PWM components only work with CCP PWM and not ECCP PWM

18F46K22 only has two CCP PWM's, hence you should only get 2 that work.

Martin
Martin

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: 18F46K22 PWM

Post by saschech@gmx.de »

Hello

I can work with PWM3 on RB5 pin 38, so I am a little confused with the answer.

Regards Wolfgang

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

Re: 18F46K22 PWM

Post by medelec35 »

Sorry, although datasheet shows 2CCP/PWM at the start,
it does show that there is 5 CCP channels so I did get it wrong.

Sorry about the confusion, I was also confused by the data sheet.

Martin
Martin

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: 18F46K22 PWM

Post by Benj »

Hi Wolfgang,

The FCD file has PWM channel 4 specified as pin RD1 as does the pin section of the datasheet. Is this incorrect for the device?

If so then you could try changing this line of the FCD file to see if this fixes the problem.

Code: Select all

Define87=#define MX_PWM_4_PIN 1
to

Code: Select all

Define87=#define MX_PWM_4_PIN 2
Let me know how you get on and if this solves the problem then I will change the FCD here to match.

The chip diagram is done here by hand and is probably just a bit of a legacy issue from v4 only supporting 2 channels. I will see if I can get this resolved.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: 18F46K22 PWM

Post by saschech@gmx.de »

Hello Benj

Never bevore I show the error for ch4 and ch5......

Regards Wolfgang
Attachments
PWM fail.gif
(23.01 KiB) Downloaded 807 times

Post Reply