Shop OBEX P1 Docs P2 Docs Learn Events
tip for multi-PWM analog — Parallax Forums

tip for multi-PWM analog

ArchiverArchiver Posts: 46,084
edited 2003-08-20 01:15 in General Discussion
I just had a project that required 5 channels of analog output
derived from PWM. Pins P5 to P9 were each feeding a 100k resistor,
1uf capacitor, and rail to rail op-amp. This is pretty much the
circuit straight out of the data book.

100k |\
stamp pin ---o----/\/\--o----|+\
| | | >--o--- analog out 0-5 volts dc
===== | |-/ |
100pf | | |/ |
| o
'
| |
| ===== 1uF
| |
| |
Vss
o
o

Hovwever, the 100pf capacitor on the stamp pin side is the additional tip.

Without the 100pf capacitor, the neighboring channels interfere with
one another, due to the parasitic capacitance that exists between the
stamp pins. Pulses of current passing through the parasitic
capacitance are rectified by the Stamp's protection diodes, and the
pin you expect to leave solidly at zero volts will drift up to one
volt instead, when the neighboring pin executes its PWM. Not good.

The 100pf shunts the pulses and prevents them from reaching the
level where they can be rectified by the protection diodes. The
stamp can still drive that 100pf as a square wave when it needs to
update the PWM on this channel.

-- Tracy

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-08-20 00:37
    Hi Tracy,

    I would guess this is because the PWM actually stops and the Stamp turns
    the pin to a high impedance input while it services other pins. So you
    have a hi-z antenna.

    Our PAK-V, by the way, does 8 channels all at the same time. Not only
    does this avoid that problem, but it prevents capacitor "droop" because
    the pulses come all the time and never stop.

    I wonder if this problem exhibited itself on a PCB or just on a
    breadboard? I know our 50MHz clocks go all over the breadboards and
    anything not tied up or down will "see" some vestige of the clock.

    Al Williams
    AWC
    * NEW: PAK-VIa - Read PS/2 keyboards or mice -- double the buffer, lower
    current consumption.
    http://www.al-williams.com/awce/pak6.htm




    >
    Original Message
    > From: Tracy Allen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=RnVAyK6vvpwQlovkawCOe0sbpORnV-mNxzjgro7jdQOas3ilDWEW2K915yr_80gQpWwwDVfI7FqUOwq5]tracy@e...[/url
    > Sent: Tuesday, August 19, 2003 6:24 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] tip for multi-PWM analog
    >
    >
    > I just had a project that required 5 channels of analog output
    > derived from PWM. Pins P5 to P9 were each feeding a 100k resistor,
    > 1uf capacitor, and rail to rail op-amp. This is pretty much the
    > circuit straight out of the data book.
    >
    > 100k |\
    > stamp pin ---o----/\/\--o----|+\
    > | | | >--o--- analog out 0-5 volts dc
    > ===== | |-/ |
    > 100pf | | |/ |
    > | o
    '
    > | |
    > | ===== 1uF
    > | |
    > | |
    > Vss
    o
    o
    >
    > Hovwever, the 100pf capacitor on the stamp pin side is the
    > additional tip.
    >
    > Without the 100pf capacitor, the neighboring channels interfere with
    > one another, due to the parasitic capacitance that exists between the
    > stamp pins. Pulses of current passing through the parasitic
    > capacitance are rectified by the Stamp's protection diodes, and the
    > pin you expect to leave solidly at zero volts will drift up to one
    > volt instead, when the neighboring pin executes its PWM. Not good.
    >
    > The 100pf shunts the pulses and prevents them from reaching the
    > level where they can be rectified by the protection diodes. The
    > stamp can still drive that 100pf as a square wave when it needs to
    > update the PWM on this channel.
    >
    > -- Tracy
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-20 01:15
    Yes, this would not be a problem if the PWM were running on all
    channels all the time, as in the PAK-V.

    But yes, the way the Stamp works, those pins are left as inputs at
    the end of each PWM command, so they are subject to "crosstalk",
    "charge injection" or "clock feed-thru", different terms for the same
    thing. It can be seen very well by hooking a 'scope up to the pin.
    Although the 30pf input capacitance of the 'scope probe input already
    has quite a large smoothing effect in relation to the ~10 pf of
    inter-pin capacitance.

    If there is no activity on the neighboring pin then the level is
    stable as you would expect. But when the neighboring pin does
    PWM npin,128,255,
    which generates 32768 successive pulses in about 1/4 second, there a
    lot of charge transfer. The effect is smaller when the two pins are
    farther apart and if the intervening pins are configured as outputs.
    The effect is largest when the input pin is at a levels of 0 volts or
    5 volts, but in contrast there is hardly any effect at mid scale, 2.5
    volts, because of the rectification and symmetry effect.

    The 100pf to ground effectively eliminates the problem within 1 LSB.

    This was on a circuit board, and probably a large proportion of the
    capacitance came from the wiring layout. I imagine the effect might
    be huge on one of those white breadboards with careless layout,
    because the capacitance between adjacent nodes on those is about
    100pf.

    -- Tracy




    >Hi Tracy,
    >
    >I would guess this is because the PWM actually stops and the Stamp turns
    >the pin to a high impedance input while it services other pins. So you
    >have a hi-z antenna.
    >
    >Our PAK-V, by the way, does 8 channels all at the same time. Not only
    >does this avoid that problem, but it prevents capacitor "droop" because
    >the pulses come all the time and never stop.
    >
    >I wonder if this problem exhibited itself on a PCB or just on a
    >breadboard? I know our 50MHz clocks go all over the breadboards and
    >anything not tied up or down will "see" some vestige of the clock.
    >
    >Al Williams
    >AWC
    >* NEW: PAK-VIa - Read PS/2 keyboards or mice -- double the buffer, lower
    >current consumption.
    >http://www.al-williams.com/awce/pak6.htm
    >
    >
    >
    >
    >
    >>
    Original Message
    >> From: Tracy Allen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=IHQxk4E-u8CXCXm162gCPg9SQr1YeNJdEyVLwegarR4gvo1ZqiNc8Wyuaz9AuEFpus6GCFyrSRF5-PnErg]tracy@e...[/url
    >> Sent: Tuesday, August 19, 2003 6:24 PM
    >> To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] tip for multi-PWM analog
    >>
    >>
    >> I just had a project that required 5 channels of analog output
    >> derived from PWM. Pins P5 to P9 were each feeding a 100k resistor,
    >> 1uf capacitor, and rail to rail op-amp. This is pretty much the
    >> circuit straight out of the data book.
    >>
    >> 100k |\
    >> stamp pin ---o----/\/\--o----|+\
    >> | | | >--o--- analog out 0-5 volts dc
    >> ===== | |-/ |
    >> 100pf | | |/ |
    >> | o
    '
    >> | |
    >> | ===== 1uF
    >> | |
    >> | |
    >> Vss
    o
    o
    >>
    >> Hovwever, the 100pf capacitor on the stamp pin side is the
    >> additional tip.
    >>
    >> Without the 100pf capacitor, the neighboring channels interfere with
    >> one another, due to the parasitic capacitance that exists between the
    >> stamp pins. Pulses of current passing through the parasitic
    >> capacitance are rectified by the Stamp's protection diodes, and the
    > > pin you expect to leave solidly at zero volts will drift up to one
    > > volt instead, when the neighboring pin executes its PWM. Not good.
    > >
    > > The 100pf shunts the pulses and prevents them from reaching the
    >> level where they can be rectified by the protection diodes. The
    >> stamp can still drive that 100pf as a square wave when it needs to
    >> update the PWM on this channel.
    >>
    >> -- Tracy
    >>
    >> To UNSUBSCRIBE, just send mail to:
    >> basicstamps-unsubscribe@yahoogroups.com
    >> from the same email address that you subscribed. Text in the
    > > Subject and Body of the message will be ignored.
    >>
    >>
    >> Your use of Yahoo! Groups is subject to
    >> http://docs.yahoo.com/info/terms/
    >>
    >>
    >>
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the
    >Subject and Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.