Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Using PWM on a 18F13K22

Status
Not open for further replies.
I would be interested in seeing the code 3v0 came up with.
As for seeing the led "blinking", yes one can see a definite flashing or in this case a flicker.
I should do a video with the camera farther away then I shouldn't get any bright flash of light as the videos show.
WHY I can see a definite flash or blinking ?? but it adds "flavor" to the effect.
 
....WHY I can see a definite flash or blinking ?? but it adds "flavor" to the effect....

Excuse me while I pound my head against the wall and knock myself senseless.

Let me assure you you can't see any difference at the 5 kHz PWM frequency. That's 200 times faster than your eye can perceive. In phase, out of phase...makes no difference other than the ratio of on time of yellow LED and red LED.

What you ARE SEEING is the difference in duty cycle as your code progresses. Remember that?

Duty = x

Inc (duty)

Etc, etc, etc.

This is why the LEDs vary in brightness.

Geez oh grief. #headsmack #headsmack #headsmack
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top