STM32 Draws On Scope

Drawing on an oscilloscope’s XY mode isn’t a new idea. However, if you’ve ever wanted to give it a go, you’d be hard-pressed to find more information than the nearly hour-and-a-half video about the topic from [Low Byte Productions]. You can check out the video below.

If you prefer to jump straight into the code, there’s a GitHub page. While the code is specific to the STM32, you can apply the ideas to anything.

The theory, of course, is simple. Generate voltages for the scope’s X and Y inputs. How hard can it be? The devil, of course, is in the details. You need a reliable way to generate voltages in sync with each other, and depending on how you do that, you may need additional filtering to get good results.

The filtering is particularly important in this case because [Low Byte Productions] uses PWM outputs. While these are very simple to create, they do tend to have high-frequency noise on their outputs.

Once you have the idea, there are plenty of things you can do with a scope output. These projects work great with old analog scopes, and we see clocks made like this fairly often. We also see a number of video games. Heck, even a badge.

7 thoughts on “STM32 Draws On Scope

  1. I made a similar widget using a RP2040 and a MAX532BEPE+ to give me to 12-bit outputs with a swing of -10v to +10v to feed *either* a scope in X/Y mode *or* one of those cheap X/Y galvanometer laser show kits (whose control amps want that -10 to +10 swing).
    . Because it’s originally intended as a four-quadrant analog multiplier it also makes it easy to reverse the picture for rear vs forward projection, bouncing off a mirror, etc.

    The mDAC lets you clock in a new value for both channels and then latch them both at once so it was practically made for this use case even if that’s not at all what the designers had in mind. It can clock out new vector positions a hell of a lot faster than the galvanometers can whip the mirrors around anyway.

    I’d highly recommend that [Low Byte Productions] consider this as an upgrade from the PWM + low-pass-filter approach since it’s inexpensive, flexible, and the datasheet is quite good. Since it just needs an SPI port to drive it, it’s quite easy to hook up to whatever decently fast MCU you have on hand.

      1. Probably depends on scene complexity… I imagine battlezone would be OK but asteroids might get choppy with too many fragments. And I’m sure nicer units could even if the super cheap ones were too slow.

      1. Bah, stupid WordPress. That was supposed to be a reply to drenehtsral .

        Giant laser Battlezone would be great, or even just a big vector art show, if speeds don’t allow for gaming.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.