Tipp
New Member
Hey all, first post on your forum, and I must say it looks pretty good
Alright, well, a bit about my situation. I've just started working with PIC microcontrollers and it's a ton of fun! I've written a few small programs already to blink and sequence LED's. It's pretty sweet knowing what all that jibberish assembly code means
Anyway, I've been researching how to fade LED's on one of my 16F628A's. Obviously a pin can only be a 1 or 0, so I did some poking around and came across PWM. Ok, well I know my 628A's have a PWM module somewhere, so how do I use it? Again, more info brought me to many sites, including Nigel's tutorials and suddenly it was right over my head! Whats all this about writing to specific registers? Whats this capture/compare equipment? Here's what I've figured out so far:
-PWM output is pin RB3
So, now you know what I want to do, and how much I currently know. I ask that if you provide any kind of example code, don't give me a whole program, just what I can use to play around with and learn. I want to learn this step-by-step instead of having it handed to me. What I want to know is how to go about setting up the PWM to control the brightness of a single LED. What should I write to specific registers, and what do they mean?
I read somewhere that, to make it fade in or out, I can add or subtract something from a register to control duty cycle, but that'll come later.
Thanks for your time, it's really appreciated
Edit - mis-spelled title
Alright, well, a bit about my situation. I've just started working with PIC microcontrollers and it's a ton of fun! I've written a few small programs already to blink and sequence LED's. It's pretty sweet knowing what all that jibberish assembly code means
-PWM output is pin RB3
So, now you know what I want to do, and how much I currently know. I ask that if you provide any kind of example code, don't give me a whole program, just what I can use to play around with and learn. I want to learn this step-by-step instead of having it handed to me. What I want to know is how to go about setting up the PWM to control the brightness of a single LED. What should I write to specific registers, and what do they mean?
I read somewhere that, to make it fade in or out, I can add or subtract something from a register to control duty cycle, but that'll come later.
Thanks for your time, it's really appreciated
Edit - mis-spelled title