Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] PWM not working with MikroC Pro for PIC

Status
Not open for further replies.

jsbhalla88

Member level 1
Member level 1
Joined
Mar 3, 2015
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
314
Hello guys
I am using PIC18F45K22, coding using MikroC Pro for PIC, and trying to use PWM library functions.
if I use PWM1 functions, I am able to get PWM working on pin RC2...
but I am not able to get RC1 PWM working. I have tried PWM1/2/3/4/5 all functions....

What could be the problem??

ALSO,
I am able to enter a variable duty cycle, but not variable frequency in these PWM functions.
How to do this?? it gives an error that it should be a constant...is it possible or not.?
 

I'm not recomend you to use such libraries at all. Open datasheet, find correcponding topic and write correct values to register according manual. This libraries is a "black boxes" with unexpected results. Never know, what to expect from them.
 

Not sure, but the PIC18F45K22 could be one of those devices where you have to set in the config bits whether a ccp pin (in your case, RC1) should be assigned to ccp (pwm operation). Maybe you can check the project options? And yes, I remember seeing in the help/documentation of MikroC's PWM libraries that you can't use variables (only constant values) for defining the frequency using their functions.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top