Page 1 of 1

18F46K22 PWM

Posted: Mon May 21, 2012 9:34 pm
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

Re: 18F46K22 PWM

Posted: Mon May 21, 2012 10:37 pm
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

Re: 18F46K22 PWM

Posted: Tue May 22, 2012 10:43 am
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

Re: 18F46K22 PWM

Posted: Tue May 22, 2012 11:21 am
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

Re: 18F46K22 PWM

Posted: Tue May 22, 2012 3:26 pm
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.

Re: 18F46K22 PWM

Posted: Tue May 22, 2012 5:34 pm
by saschech@gmx.de
Hello Benj

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

Regards Wolfgang