Display PWM DutyCycle on a LCD

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

Moderators: Benj, Mods

Post Reply
User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Display PWM DutyCycle on a LCD

Post by Jordy101091 »

Hi everyone,

Hi i'm a kind of stuck here,
I'm trying to figure out how a can get the dutycycle in % on my LCD, so that i have an indication on witch intensitie my LEDs are burning.

I have treid everything but i cant get it to work. I have treid i flowcode file from a topic (duty cycle.fcf) the concept is there but i cant figure it out how im going to implement this in to my project.

I hope you guys can help me out.

O one more thing, How can i use the output signal of de PWM do i need to select a port or is this a standard one on the PIC (16F877A).

Regards Jordy Kleian
the will to learn, should not be stopped by any price

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: Display PWM DutyCycle on a LCD

Post by Jordy101091 »

Found the solution:

Load value of LDR into (LDR)

Calculation: (a = (LDR/2.55))

PWM Set DutyCycle = LDR

Display Number on LCD = a(%)

but the question now is how can i use the pwm signal for an output???

Can you help me please.

Regards Jordy
the will to learn, should not be stopped by any price

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: Display PWM DutyCycle on a LCD

Post by medelec35 »

Jordy101091 wrote:
but the question now is how can i use the PWM signal for an output???
Not sure what you mean?
If your asking what pins PWM o/p appear on, then answer is PWM1 o/p appears on pin 17 (CCP1).
PWM2 o/p appears on pin 16 (CCP2).

If you want further assistance, e.g how to set up flowchart so correct PWM appears on the o/p, depending on light LDR receives etc. Then I would recommend you post in correct topic area.
For Flowcode V4 in Flowcode V4 topic area. You need to register for that section first.
See here:
http://www.matrixmultimedia.com/support ... f=29&t=602

Or for Flowcode V3 in the Flowcode V3 topic. area etc.

What version of Flowcode have you got?
Martin

User avatar
Jordy101091
Posts: 519
Joined: Sat Jan 08, 2011 4:02 pm
Location: The Netherlands
Has thanked: 25 times
Been thanked: 188 times
Contact:

Re: Display PWM DutyCycle on a LCD

Post by Jordy101091 »

I have Flowcode v4 Student/Home version.

And thank you for answering my question.
I have taking a look in the PIC16F877A datasheet and there it is, my answer.

Thank you,

Regards Jordy Kleian
the will to learn, should not be stopped by any price

Post Reply