Go Down

Topic: PWM and how it affects time sensitive functions (Read 595 times) previous topic - next topic

eddiea6987

while running some tests i find that if im PWMing while trying to get time sensitive inputs i get different values then if i was not PWMing: example
i was trying to get some IR codes from a remote with an IR detector and i ogt the codes i needed and once i started to modulate something while still listening for a specific code i would get a different reading from the same button being pressed on the remote.. so im assuming since a "processor" can only do one thing at a time the second i start to pwm it throws my Ir reading slightly off..
not posting any code since i think this maybe whats going on and i closed it al up anyways it was just a little test i was doing but am i correct in my reasoning?
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"

Grumpy_Mike

PWM uses the built in hardware in the processor and so does not 'consume' any processing power. I would not expect to see any reduction in the speed of your program when you have it going. That is if it is the normal built in PWM and not any software library.

eddiea6987

i see, then perhaps it must be that something was adding noise, because what i was PWMing had some very long leads about 3 feet of wire so it must just picked up all sorts of things but still the eratic reading where on the IR side not the pwm side..either way ill have to recreate the circuit to give a proper discription..and i was reading your tutorials today mr grumpy and it was all very insightful perhaps you should it would e nice to read some more

The decoupling article i found was a very much needed read for me
I could print the Arduino logo on a box of cereal and sell it as "Arduin-O's"

Grumpy_Mike

Quote
but still the eratic reading where on the IR side not the pwm side

It is possible that the thing you were PWMing was generating interference but as you don't say what it is it is hard to tell. You also haven't given a schematic as to how you have wired up the IR sensor to the arduino so again it is imposable you say if that is susceptible to interference.

Go Up