Page 1 of 1

Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 12:54 am
by Werner
Hi Guys, I am looking for a simple one LED PWM dimmer program to help understand PWM. I found a few things in the forum and an article but thing where much more complicated that I am looking for.

Thanks a lot for the help!! :D

Werner

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 1:48 am
by brandonb
with 3 tactiles controlling and lcd for feedback

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 1:53 am
by brandonb
simple pwm macro only

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 2:11 am
by brandonb
this is an extention of the last file but with an lcd display... incase you were wondering the copyright thing is a joke for a friend of mine, i put it on all my stuff to make him and my self laugh

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 3:49 am
by Werner
Hi Brandon, Thanks Buddy this is helpful! The last one with lcd does not have LED? Could upload the LED one.
Thanks for the help!

Werner

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 8:36 am
by medelec35
Nice Flowchart Brandon!
Thanks for sharing it.
Werner if you placed an LED on the flowchart connected to the PWM output at Port C5 ,the LED will not light.
But it will work on your hardware.
That is because the PWM is hardware controlled using internal CCP1 and timer1 registers.
Don't forget to change the pin connections so LCD will work with Eblocks.

Re: Student of Martin. It's a great honour and you made my day that you have put that on your signature buddy.
However I'm sure there are other people with far more knowledge than me who deserves that title.
Thank you anyway.


Martin

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 10:16 am
by medelec35
Since PWM is hardware and not software driven and is automaticly assigned to CCP1, you don’t need to drag an LED or port component down onto flowchart.
By looking at 16F690 chip diagram in Flowcode, you can’t tell which pin is assigned to CCP1 as this and other data is missing. Therefore I have modified 16F690.fcd file.
Best to save a copy of original file first.
If you place the attached file in C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD
(64 bit windows)
Or
C:\Program Files\Matrix Multimedia\Flowcode V4\FCD
(32 bit windows)

Then look for CCP1 you can see its connected to RC5
16F690 connections.png
(19.39 KiB) Downloaded 4874 times
Martin

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 8:15 pm
by Werner
Hey Thanks Guys Ok now it is all making sense to me! For some reason I could not get it out of my head thinking that I needed and output for this but now I understand. The chip that I am actually working with is the 16F877A and I see it will be pins 16 and 17. Brandon the code for the tactile is really cool! I will play with this and see if I can get something working.

Yes Martin, there are many great contributors to the forum and Flowcode but for “me” you are the Professor of Flowcode. Not only is it the countless hours you give in helping all of us but also the gift you have of being able to convey thoughts and solutions that so great! It’s no wonder you have more thanks than even the Matrix staff! I know I speak for many; it’s just a very small way of reminding you how much I appreciate you! :D

Werner

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Wed Nov 30, 2011 10:14 pm
by medelec35
Werner wrote: The chip that I am actually working with is the 16F877A and I see it will be pins 16 and 17.
Spot on! :)
17 is PWM ch1 and 16 is PWM ch2
Werner wrote:
Yes Martin, there are many great contributors to the forum and Flowcode but for “me” you are the Professor of Flowcode. Not only is it the countless hours you give in helping all of us but also the gift you have of being able to convey thoughts and solutions that so great! It’s no wonder you have more thanks than even the Matrix staff! I know I speak for many; it’s just a very small way of reminding you how much I appreciate you! :D

Werner
Thanks Werner.
For me it's Flowcode users like yourself that makes our replies so worth while.
You always appreciate the answers given, so helping you is a pleasure.

Regards

Martin

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Thu Dec 01, 2011 2:09 am
by brandonb
Nice Flowchart Brandon!
Thanks for sharing it.
thanks martin, i've been absorbing all that you and fotios have been showing me :wink:
Brandon the code for the tactile is really cool!
werner, this one works good, the reason why i did it this way is because #1 tactiles are awsome, and the other reason is because using the count +1 deal for a pwm yeild great lcd display results, when i used the pot(adc) the display was always fighting between 2 adc bytes, alot of times the display was updating so fast that the % number was blank, so i added a delay, but the problem then was i found it annoying that the display was lagging when i turned the pot, so i came up with the tactile version to make it the way i desired, i use this for my automotive job to drive turbos, egr valves and such,.... are you in the states(usa)?

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Thu Dec 01, 2011 5:19 am
by Werner
Brandon, that’s really cool! I like to see how you Guys code, some real clever stuff! The more I learning about Flowcode programing the more it seems that anything is possible. Yes Brandon I am just a little west of you in Socal. :D Thanks for the great examples.

Werner

Re: Anyone have a PWM Dimmer program to dim just 1 LED?

Posted: Thu Dec 01, 2011 5:39 am
by brandonb
that’s really cool! I like to see how you Guys code, some real clever stuff
im a newbie at this too, been doing timerchips and logic gate stuff for the past 3 years, i got to the point of using entirely too many chips on a board, thats what got me in to flowcode, one pic chip is worth 100,000 logic chips?
I am just a little west of you in Socal.
hey neighbor :D