analogWrite() waveform.


the analogwrite() function's waveform has weird behaviour on arduino uno. checked oscilloscope. (the pulses checked between respective pin , arduino's gnd)

at close 0 duty cycle input function (the second parameter of function, range: 0-255), between 0 , 5v (as expected), however, higher duty cycle value went, pulses started going negatives, till @ close 255 (almost 100% duty cycle), pulses between -5v , 0v.

furthermore using rfduino (i know different hardware), analogwrite() function generates pulses between -1.7v , 1.7v, rather 0v , 3v.

the attached code 1 used on uno. supposed control of motor speeds varying duty cycles (using mosfet switching). now, interested in waveform of analogwrite() function.

so, know problem is? how analogwrite() function of arduino works?

thanks in advance.

and scope probe ac coupled?
try flicking dc


Arduino Forum > Using Arduino > Motors, Mechanics, and Power (Moderator: fabioc84) > analogWrite() waveform.


arduino

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code