Recently acquired my first oscilloscope (Siglent SDS804x HD with license key “hack” applied) and I’ve been playing around viewing various waveforms with it. I have a simple microcrontroller circuit generating a 900Hz rectified sine wave, and it passes through a capacitor to remove DC bias.

I’m confused about what I’m looking at when I plug it into my scope. It seems like my audio signal is somehow being represented in the “negative space” of these traces. As I change my code (different freq, different wave, etc) the negative space changes to match. What I expected to see was something akin to this image: A series of square-ish pulses of different width.

What I would eventually like to figure a way to demodulate the audio wave and display it on my scope as its own trace, then play around by analyzing it independently of the PWM. I’m sure that somewhere in all the math functions on this scope, there’s a way to achieve that, but I haven’t found it yet.

  • puffball@slrpnk.net
    link
    fedilink
    English
    arrow-up
    8
    ·
    edit-2
    1 day ago

    Would you share your schematic and microcontroller firmware?

    If you are properly implementing a PWM DAC, you will not see the PWM period change in accordance with the frequency of the signal you are generating. The PWM period is set per sample to relate to the amplitude of the sample, and then a series of low-pass filters is used to cut off the upper harmonics and the PWM frequency.

    Given the set up you describe, it sounds like you’ve got the microcontroller side right, but don’t have any filtering on the output, other than parasitics of the scope probe. Have you tried a sample-and-hold and zooming in? I bet you’ll see the PWM period you are expecting between the edges.

    edit: yeah, I’m noticing now you’ve got the time base on the scope set way too coarse for what you are trying to observe. consider the reciprocal of whatever you’ve got your PWM frequency set to, and that’ll guide you as to how stretched your x-axis should be.