linear1 forums
[part of the
linear1 network
]
+ [
linear1 case mods
]
+ [
LED Center
]
+ [
privacy policy
]
Welcome,
Guest
. Please
login
or
register
.
March 20, 2010, 05:55:12 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
linear1 forums
|
LED discussion
|
Microcontroller madness
| Topic:
How to build a PWM
« previous
next »
Pages:
1
[
2
]
Author
Topic: How to build a PWM (Read 15717 times)
Uzaree
Strong like bull
Offline
Posts: 10
Re: How to build a PWM
«
Reply #15 on:
December 13, 2005, 02:55:22 PM »
Can you program PIC in that? Forgive me but I couldn't find more information on it.
Logged
justDIY
Microcontroller Madman
Administrator
Smart like tractor
Offline
Posts: 1652
UFOric
Re: How to build a PWM
«
Reply #16 on:
December 13, 2005, 03:06:54 PM »
you mean PWM? yes, you should be able to do pwm with it.
PIC is a brand of microcontroller, sold by Microchip. The basic stamp is 'powered' by a PIC microcontroller
Logged
Want to contact me directly? gmail gordonthree
My Project Blog -
http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Uzaree
Strong like bull
Offline
Posts: 10
Re: How to build a PWM
«
Reply #17 on:
December 13, 2005, 03:20:42 PM »
Oh, haha I feel silly now hehe. Thanks for your help JustDIY I'm going to pick one of them up in the next day or so.
Logged
SurJector
Smart like tractor
Offline
Posts: 107
Re: How to build a PWM
«
Reply #18 on:
December 14, 2005, 03:53:11 AM »
I've done a PWM with a NE556 with reasonable success. I used one of the 555 in 50% duty cycle mode (out-resistor-capacitor-ground). In that way I get a roughly triangular signal at the poles of the capacitor. The idea is to use the second 555 as a voltage comparator (speek of overkill). I tied its control pin to ground through a diode (but you can as well use a 1K resistor), then I used a (variable) voltage divider from capacitor to ground to feed the "voltage comparator". You can go smoothly from 0% to 100% if you adjust the resistors in the divider.
Logged
chopper
custom tail light builder
Smart like tractor
Offline
Posts: 145
Re: How to build a PWM
«
Reply #19 on:
December 20, 2005, 05:20:51 PM »
Started breadboarding the pwm suggested by cpemma and have a question about cap's.
I can't seem to find what a 100n cap is in other ratings but if I have this figured correctly (doubt it lol) it would be equal to a .01mfd.? How was my guess?
Oh, btw, my breadboard is to small for this but a little improvising has it going ok. Guess it is time for a larger board.?
Logged
cpemma
Global Moderator
Smart like tractor
Offline
Posts: 122
Re: How to build a PWM
«
Reply #20 on:
December 20, 2005, 06:30:18 PM »
Quote from: chopper on December 20, 2005, 05:20:51 PM
...have a question about cap's.
I can't seem to find what a 100n cap is in other ratings but if I have this figured correctly (doubt it lol) it would be equal to a .01mfd.? How was my guess?
1,000,000 pico = 1,000 nano = 1 micro, so 100nF = 0.1uF, not 0.01
Logged
cpemma
Global Moderator
Smart like tractor
Offline
Posts: 122
Re: How to build a PWM
«
Reply #21 on:
December 20, 2005, 06:53:02 PM »
Quote from: SurJector on December 14, 2005, 03:53:11 AM
I've done a PWM with a NE556 with reasonable success...
There's a kit
here
using one, the documentation download available gives the circuit, component values, and some useful tips on parts substitution.
Logged
justDIY
Microcontroller Madman
Administrator
Smart like tractor
Offline
Posts: 1652
UFOric
Re: How to build a PWM
«
Reply #22 on:
December 20, 2005, 07:59:26 PM »
or just use one line of code on a microcontroller
HPWM Port, Duty, Freq
so HPWM 1, 128, 1000 would give me a 50% duty cycle at 1khz on hardware pwm output 1
Logged
Want to contact me directly? gmail gordonthree
My Project Blog -
http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
SurJector
Smart like tractor
Offline
Posts: 107
Re: How to build a PWM
«
Reply #23 on:
December 21, 2005, 04:16:36 AM »
Quote from: cpemma on December 20, 2005, 06:53:02 PM
Quote from: SurJector on December 14, 2005, 03:53:11 AM
I've done a PWM with a NE556 with reasonable success...
There's a kit
here
using one, the documentation download available gives the circuit, component values, and some useful tips on parts substitution.
Their solution is undoubtely more professional than mine, but I think they cannot do true 100% and 0% duty cycle.
Quote from: justDIY on December 20, 2005, 07:59:26 PM
or just use one line of code on a microcontroller
HPWM Port, Duty, Freq
so HPWM 1, 128, 1000 would give me a 50% duty cycle at 1khz on hardware pwm output 1
Sure, but it's not very smooth in the lower part of the spectrum.
Logged
justDIY
Microcontroller Madman
Administrator
Smart like tractor
Offline
Posts: 1652
UFOric
Re: How to build a PWM
«
Reply #24 on:
December 21, 2005, 08:58:44 AM »
Quote from: SurJector on December 21, 2005, 04:16:36 AM
Quote from: justDIY on December 20, 2005, 07:59:26 PM
HPWM Port, Duty, Freq
so HPWM 1, 128, 1000 would give me a 50% duty cycle at 1khz on hardware pwm output 1
Sure, but it's not very smooth in the lower part of the spectrum.
please elaborate.
Logged
Want to contact me directly? gmail gordonthree
My Project Blog -
http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
SurJector
Smart like tractor
Offline
Posts: 107
Re: How to build a PWM
«
Reply #25 on:
December 21, 2005, 12:43:23 PM »
Quote from: justDIY on December 21, 2005, 08:58:44 AM
Quote from: SurJector on December 21, 2005, 04:16:36 AM
Quote from: justDIY on December 20, 2005, 07:59:26 PM
HPWM Port, Duty, Freq
so HPWM 1, 128, 1000 would give me a 50% duty cycle at 1khz on hardware pwm output 1
Sure, but it's not very smooth in the lower part of the spectrum.
please elaborate.
When you go from HPWM 1, 1, 1000 to HPWM 1, 2, 1000 you double the duty cycle, when you go from HPWM 1, 2, 1000 to 1, 3, 1000 you multiply it by 1.5; that's what I intended. It's usually sufficient for all purposes, if that's what you wanted to hear !
Logged
justDIY
Microcontroller Madman
Administrator
Smart like tractor
Offline
Posts: 1652
UFOric
Re: How to build a PWM
«
Reply #26 on:
December 21, 2005, 01:58:12 PM »
ok, yes, I agree - there is some amount of granularity involved, since its a digital system not analog.
the pic hardware pwm is capable of 10 bit resolution up to about 40kHz pwm freq assuming a 40mHz cpu clock, so you have 1023 steps ... 0 being 0% duty cycle, 1 being less than 0.1%, 11 being close to 1%, 102 being close to 10%
doing a pwm routine in software, you could get a finer resolution, with the trade off of having limited cpu time to do other tasks. a cheap 8 pin pic still costs more than a 555 based solution would cost, so its not the most cost effective means for a commerical end-user product.
Logged
Want to contact me directly? gmail gordonthree
My Project Blog -
http://projects.dimension-x.net
Favorite numbers:
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
Pages:
1
[
2
]
linear1 forums
|
LED discussion
|
Microcontroller madness
| Topic:
How to build a PWM
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Important
-----------------------------
=> Please read our rules
-----------------------------
Case mod questions
-----------------------------
=> Case modding
-----------------------------
LED discussion
-----------------------------
=> Special Offers
=> Article discussion
=> LED questions and discussion
=> Electronics discussion
=> Microcontroller madness
=> LED project showcase
-----------------------------
Other Stuff
-----------------------------
=> La Bodega
=> Garden
=> Woodwork