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

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

Display PWM DutyCycle on a LCD

Postby Jordy101091 » Mon Feb 14, 2011 1:47 pm

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: 27 times
Been thanked: 190 times
Contact:

Re: Display PWM DutyCycle on a LCD

Postby Jordy101091 » Mon Feb 14, 2011 3:04 pm

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

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3451 times
Contact:

Re: Display PWM DutyCycle on a LCD

Postby medelec35 » Wed Feb 16, 2011 7:10 am

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

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

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

Re: Display PWM DutyCycle on a LCD

Postby Jordy101091 » Wed Feb 16, 2011 3:33 pm

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