X/Y display for a MCU - Page 1
Forum section: electronics / general

author: coppercone2
author_rank: Super Contributor
timestamp: March 10, 2025, 09:15:27 pm
content: While it started as a half joke I can't get it out of my head. These chips have multiple DAC's on them.Instead of messing with a LCD, it seems possible to make a port that you can hook up to a scope to have the MCU display something, like a ADC readout, on the X Y plot of a oscilloscope.Has anyone ever seen a project like this? Say a simple one like show temperature on a oscilloscope from a PIC reading a temperature sensor.https://www.mjoldfield.com/atelier/2015/08/xy-scope.html

author: tggzzz
author_rank: Super Contributor
timestamp: March 10, 2025, 09:34:23 pm
content: This kind of thing? Tektronix Logo and Wizard Demo Generator for Oscilloscope with Table Tennishttps://www.ebay.com/itm/116498624308Or use a PC's sound card, and play the appropriate music through each channel.

author: coppercone2
author_rank: Super Contributor
timestamp: March 10, 2025, 09:39:55 pm
content: I know you can do it with advanced things like sound cards, but has anyone done it with a MCU using the onboard stuff. so its a option you can pick for prototyping rather then putting on a display, like a library you can install to just make a project scope compatiblebut that is exactly what I mean the tektronix display to show temperature or date/timeperhaps it could be standardized to use a display device like a 'access tuner ' , a simple little low frequency xy scope

author: coppercone2
author_rank: Super Contributor
timestamp: March 10, 2025, 10:13:17 pm
content: Hmm he uses GPIO. But there are many MCU that have multiple often unused DAC's. At least it shows its possible. GPIO uses too much parts and board space. I wonder how low parts count you can get it with some of those feature loaded chips.I think it should be a display option in a <library>so you can poll a ADC then post reading to display library

author: ledtester
author_rank: Super Contributor
timestamp: March 10, 2025, 10:20:46 pm
content: Reminds of the AVR O-scope clock:http://www.dutchtronix.com/ScopeClockH3-1-Enhanced.htmUsed a dual 8-bit DAC - external, of course, since the old AVRs didn't have them.

author: coppercone2
author_rank: Super Contributor
timestamp: March 11, 2025, 12:09:50 am
content: 331 results found for 2 or more dacs from PIChttps://www.microchip.com/maps/microcontroller.aspxHow many bits do you think it needs minimum?

author: cunningfellow
author_rank: Regular Contributor
timestamp: March 11, 2025, 12:24:06 am
content: depends what resolution you want.Atari vector games (Asteroid Tempest etc) had 10 bit dacs for 1024x1024 addressable points.Dutchtronix used 8 bits.You choose how smooth you want it.(Atari also had analog integrators and stuff to make the edges smoother but that then gets complex)

author: coppercone2
author_rank: Super Contributor
timestamp: March 11, 2025, 12:27:16 am
content: Hmm you can probobly make modified characters for low bit legibility, with a legend

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 11, 2025, 01:02:27 am
content: Problem is it's not gonna leave much processing time for anything else, but otherwise that's fun.

author: coppercone2
author_rank: Super Contributor
timestamp: March 11, 2025, 01:13:34 am
content: Maybe they should add a special coprocessor for Xy displays!

author: Martian Tech
author_rank: Regular Contributor
timestamp: March 11, 2025, 02:28:55 am
content: Slew rate is an issue. If the slew rate of the X and Y DACs is the same and ∆X ≠ ∆Y then whichever is smaller will reach its terminal value sooner and you'll get a dogleg in your vector. If you stick to multiples of 45° angles then you won't have a problem. Also, you really need the outputs to change simultaneously so one axis doesn't get a head start over the other... But in any case, it's fun to play around with, so don't be discouraged by what I sayAs for processing time, that is more a factor of the persistence of the phosphor (assuming output to a CRT of some sort) than anything else. You can draw a vector, turn off the beam (or even lift the pen on a plotter) and just let it sit there while you're computing the next vector. As long as all the previous vectors you've drawn don't fade away you've got time for processing. If you need a LOT of processing time then a storage scope might be called for

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 11, 2025, 04:00:31 am
content: Quote from: ledtester on March 10, 2025, 10:20:46 pmThat's seriously cool.The challenge is to keep a constant linear velocity, so that the drawing is all the same brightness.On modern digital scopes, it does not look quite so neat.It's a shame there is no modern CRT replacement.More practical alternatives could be the Persistence of Vision designs, some look quite good, others not so much...They have a similar time limit on display refresh rates, but the CRT approach has no air noise.https://hackaday.com/2010/03/20/pov-clock-inside-acrylic-block/https://www.aliexpress.com/i/1005006655301386.htmlhttps://www.elektormagazine.com/labs/high-end-propeller-clock-120732Here, he makes a great point about spin rate and air-noise, so two blades are better than one.On my previous prototype, i found that the propeller had to run at more than 3000t/min to offer a sufficient refresh rate, but this made air noise. With this double refresh, I'll be able to reduce at only 1500t/min without any flickering effect. The propeller contains 2 infrared sensors at each extremity to give a mechanical position reference. This propeller is then able to display a 25*128 dot bicolor round matrix.You could also shift the LEDs to interlace them, gets finer resolution but refresh is compromised a little.A PAL TV used 50Hz frame sync and 15625 line rate, a LED POV clock could be quite similar, with 50Hz and 18000 'line' rate, for 1 degree refresh.

author: Analog Kid
author_rank: Super Contributor
timestamp: March 11, 2025, 04:08:04 am
content: Quote from: PCB.Wiz on March 11, 2025, 04:00:31 amVery interesting project.But boo, hiss: they want me to register in order to look at any of the pictures?I hate that. Just make them available to anyone, like on here.

author: peter-h
author_rank: Super Contributor
timestamp: March 11, 2025, 08:40:09 am
content: This has been done since the 1970s in oscilloscopes. Lots of TTL logic for the character generation.Probably best done by using DMA to feed a timer-triggered DAC to feed the values at the correct rate. Then when you do a "printf" to some text buffer, that calls a function which generates a table of DAC values. With two DACs you can write anythingThe reality however is that you can drive an LCD via SPI and the displays are dirt cheap - a few $https://www.eevblog.com/forum/projects/graphics-on-an-embedded-system-tft-display-need-help-with-some-pointers/

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 11, 2025, 12:52:58 pm
content: Quote from: coppercone2 on March 11, 2025, 01:13:34 amFor the RP2040 and 2350, that could be "accelerated" using the PIO and one of the two cores.Not sure it's very useful these days, but it's fun.There are kits to turn a CRT monitor into a vector display:https://www.retrorgb.com/vector-monitor-xy-kit.htmlYou can find old vector monitors otherwise. Or analog scopes.The XY mode in most digital scopes usually sucks for this kind of purpose.

author: David Hess
author_rank: Super Contributor
timestamp: March 11, 2025, 04:11:04 pm
content: Quote from: Martian Tech on March 11, 2025, 02:28:55 amTektronix used an integrator within the feedback loop of the vector generator to make the slew rate proportional to length.Quote from: peter-h on March 11, 2025, 08:40:09 amThere was plenty of TTL logic state machines, but for Tektronix readouts, the character generation was initially analog with literal analog ROMs. Later these were replaced with a couple of different digital methods of character generation.

author: ledtester
author_rank: Super Contributor
timestamp: March 11, 2025, 04:16:06 pm
content: Another approach is to use "circle graphics" to produce very smooth curves.This is probably the original design:http://www.cathodecorner.com/sc200c.htmland this page describes the theory of operation:http://www.cathodecorner.com/sc200theory.htmlOther implementations:https://www.sgitheach.org.uk/scope2.htmlandhttps://oscilloclock.com/

author: tggzzz
author_rank: Super Contributor
timestamp: March 11, 2025, 05:47:46 pm
content: Quote from: David Hess on March 11, 2025, 04:11:04 pmYes, and that's a wonderfully imaginative solution from Barrie Gilbert. He invented a few other seminal devices tooHis patenthttps://patents.google.com/patent/US3651510ADescriptionhttps://vintagetek.org/wp-content/uploads/2022/08/Simplifying-CRT-Character-Generation-Electronics-12-22-1969.pdf

author: Siwastaja
author_rank: Super Contributor
timestamp: March 11, 2025, 07:55:18 pm
content: Why not?For example nearly every cheap STM32 chip has two DAC channels capable of 1MSPS IIRC. And that can be driven with DMA to reduce CPU overhead.Depends on what you exactly want to draw, but 1MSPS is already more BW than what you get out of sound cards; as tggzzz pointed out, people have done some fancy stuff even with those.

author: mark03
author_rank: Frequent Contributor
timestamp: March 12, 2025, 02:29:16 am
content: Quote from: ledtester on March 11, 2025, 04:16:06 pmI was curious what was going on here, so I skimmed the linked theory of operation. It's an awfully convoluted way of achieving what you could do with basic X/Y DACs, except he uses a bunch of analog hardware insteadI don't see the point. You just need to define characters with nice curves in a vector format, then, well, just do it.I guess storing the screen elements in terms of lines and constant-radius circles makes for a very compact font definition, but nowadays, it seems like a lot of effort for little benefit.

author: ledtester
author_rank: Super Contributor
timestamp: March 12, 2025, 04:16:18 am
content: Quote from: mark03 on March 12, 2025, 02:29:16 amWell, the project was published in 2008 and used a Motorola HC908 microprocessor.Also, thehttps://www.sgitheach.org.uk/scope2.htmlpage has this to say:Quote

author: David Hess
author_rank: Super Contributor
timestamp: March 12, 2025, 09:21:57 am
content: Quote from: tggzzz on March 11, 2025, 05:47:46 pmI know of three methods Tektronix used for their readout on vector CRTs.The first was Barrie Gilbert's function fitting with analog ROMs; a series of strokes are made by applying ramps to a series of translinear functions. The last was to generate a raster with character matrix. There was a third method, which I think looks better than a raster, where a digital ROM stored a series of linear strokes, producing something like a raster but without gaps between pixels. I think this method made it into their early portable DSOs like the 2230/2232, but later portable DSOs use the raster method.

author: tggzzz
author_rank: Super Contributor
timestamp: March 12, 2025, 11:48:22 am
content: Quote from: David Hess on March 12, 2025, 09:21:57 amI wonder what was in the Tek 405x series of terminals. I used one briefly c1977/8, and was amazed at the clarity of the display - but I can't remember what the characters looked like, i.e. dot matrix or stroked.All I can find is 6800 with 32k ROM and 8k RAM, with all ASCII characters, and individually addressable 1024x768 points. The latter just might be ambiguous in this context.

author: mark03
author_rank: Frequent Contributor
timestamp: March 12, 2025, 05:22:54 pm
content: Quote from: ledtester on March 12, 2025, 04:16:18 amBut this just shows a lack of basic signals&systems understanding. The stair steps at the output of a DAC are caused by spectral images at multiples of the sampling frequency (somewhat attenuated due to the zero-order hold), and are easily eliminated by oversampling followed with an RC low-pass filter. Then the DAC + reconstruction filter provides a [near-] perfect translation of a bandlimited analog signal from its samples back to the analog domain. You could just as easily use direct digital synthesis to get your sine and cosine signals before the DAC, although that is an unnecessary crutch. Just figure out your desired smooth trajectory in X/Y space, and well, do it. No magic necessary. And all totally tractable in a 2008-era MCU, although perhaps not that one.

author: peter-h
author_rank: Super Contributor
timestamp: March 12, 2025, 08:10:19 pm
content: Yes. I think in modern times one would generate a table of x,y DAC samples, all of equal step size, so e.g. a 8x6 font would use 8 vertical steps and 6 horizontal steps, and you feed that to the DAC as I described above: timer -> DAC (DMA-fed). Very low CPU duty cycle. I've done arbitrary waveform generation on the 32F417 on which the CPU load was basically zero.One would lowpass filter the DAC output so it is nice and smooth. The filter would be tweaked so that the spot "velocity" is just right so the spot does not dwell in the same place.There is an additional dimension: blanking. Between characters you need to turn off the beam. So you need 2 x DAC plus a GPIO. The DMA probably cannot feed a GPIO pin as well as feeding the 2 x DAC. So you might use DMA to draw each character and then trigger an ISR on DMA complete to flip the blanking pin.

author: mark03
author_rank: Frequent Contributor
timestamp: March 12, 2025, 10:15:25 pm
content: In the spirit of the curvy "circle drawing" technique, I would eschew the digital-style characters and look for something nice and flow-y, maybe even like cursive. But I don't know where to find fonts in that style. Modern font formats like TrueType are vector in nature, but they define an outline, not a center stroke path, if I understand correctly. The advantage of the circles & lines approach (looks nixie-ish to me) is that you could throw together the digits, at least, from scratch quite easily.

author: tggzzz
author_rank: Super Contributor
timestamp: March 12, 2025, 10:32:48 pm
content: Quote from: mark03 on March 12, 2025, 10:15:25 pmGorton font is a classic font for routershttps://aresluna.org/the-hardest-working-font-in-manhattan/https://hackaday.com/2025/02/15/you-know-this-font-but-you-dont-really-know-it/

author: harerod
author_rank: Frequent Contributor
timestamp: March 18, 2025, 06:07:11 pm
content: Quote from: Siwastaja on March 11, 2025, 07:55:18 pmThe analog bandwidth of those DAC's is much lower. The STM32F407 datasheet claims 3..6µs to within 4LSB for a 10bit jump, i.e 8bit transition. Especially with analog peripherals there is a large difference between the marketing section of the datasheet (first pages) and the actual electrical performance. The ADC's on that chip are abysmal as well. A common problem across many chip families, when trying to combine a CPU with analog stuff.

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 18, 2025, 08:16:49 pm
content: I have a fondness for vector displays and have built several over the years. My first was based on a 16MHz AVR uc driving a dual output DAC through opamps as a type of 10 bit (1024 x 1024) bitmapped display. The AVR had sufficient speed to draw things like analog clock faces with hands and numerals without any flickering. I used Bresenham algorithms to calculate lines and circles on the fly and predefined 8 x 8 font. The scope I was using did not have a Z input, but in reality that didn't seem to cause any problems because if the dots were far enough apart (as when moving from one object to another) the scope wasn't fast enough to have much visibility for those stray lines. Likewise, the time it took for the AVR to process each step was sufficient to illuminate the location of the beam - so I didn't need to worry about screen persistence at all.Those very basic displays were actually quite easy to build and only needed a DAC and opamp for bufferring - but they were very 'blocky' looking. My later projects were based on faster processors capable of generating much smoother looking displays and used the Z axis for beam intensity.You can find many examples of these projects on the web - here are just a few from my bookmarks. My favorite is the Arduino Due and Teensy projects that have dual DACS built into the ucontroller - that makes life a lot easier. I’ve hooked a scope directly to the Due’s DAC pins and it works fine.http://www.cathodecorner.com/https://www.jmargolin.com/vgens/vgens.htm-Greatreading by an Atari vector designer. He has more vector articles on his website.https://www.sgitheach.org.uk/crt.htmlhttps://oscilloscopeclocknixiecrt.com/https://web.jfet.org/vclk/https://www.nutsvolts.com/magazine/article/the-arduino-graphics-interface-part-1https://www.nutsvolts.com/magazine/article/tgi-the-teensy-graphics-interface- the basis of my last vector project. Sadly Teensy 3.6 boards are now impossible to find.Edit - too bad the old Vectrex vector game consoles are now so highly sought after... I kick myself for not grabbing one when they were affordable... A great vector experimentation platform!

author: David Hess
author_rank: Super Contributor
timestamp: March 18, 2025, 09:53:21 pm
content: The Tektronix digital vector displays were usually 10 bits along both axis, even when they only used 9 bits. Of course 9 bit converters have never been common and 8 bits was always going to be too few.

author: westfw
author_rank: Super Contributor
timestamp: March 19, 2025, 09:42:49 am
content: How well (if at all) do the low-end digital scopes (sigilent, hantec, etc) do X/Y mode stuff?There have been a bunch of neat looking z/y hacks over the years, but real x/y crts are hard to find, out of my reach to build, and I’m not at all interested in acquiring an old clunky analog scope just for experiments.(Although I do have a vectrex!)

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 19, 2025, 10:09:46 am
content: Quote from: westfw on March 19, 2025, 09:42:49 amDigital scopes can provide diagnostic information with XY modes, but they'll never be a substitute for a vector display. Not to mention that simply being digital kind of negates the whole idea to begin with - you might as well just use any digital screen with bitmapped images. And if you don't want a scope, why bother with X/Y displays at allIf you live in more urban areas, keep an eye out on ham swap fests - they're basically a flea market for electronic gear. I've also picked up one or two small analog scopes for dirt cheap on eBay that I've reworked into display units for my projects. A small one with a 2"-3" screen doesn't take up too much room. The old Tek wave monitors can also occasionally be found for a few bucks, but they are rather large.I can't locate it now, but I know that there's a few sites dedicated to hacking the Vectrex, including the ability to use it as your own display. I'm very envious lolI remember when that console came out and nobody really understood it at the time... the tiny screen and lack of color didn't help when compared to Atari 2600's or ColecoVision. The funny thing is that I've been a Tempest fanatic all my life, so I should have appreciated it more at the time.

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 19, 2025, 03:56:31 pm
content: The XY mode on a scope is more commonly used for some measurement purposes and not for animation. You'll more often use persistence in XY rather than need to have a smoothly animated view (which rarely serves any practical purpose apart from using it as a vector display, which is not what a scope is designed for). It was usually "better" in that regard on analog scopes as a byproduct of how they were implemented rather than as a feature.Some modern digital scopes have a nice update rate in XY, but most low-end ones definitely don't.You can find kits to turn a CRT monitor into a vector scope (as I mentioned earlier), otherwise you can find old vector monitors for reasonable prices.Example:https://www.ebay.com/itm/285492214126

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 19, 2025, 04:30:01 pm
content: Quote from: SiliconWizard on March 19, 2025, 03:56:31 pmI've got a Tek 760A on my eBay watchlistOne day someone will list one at a reasonable price..Nevermind that - youdefinitelydo not want one of these. If you come across one let me know immediately so I can dispose of it for youAs for digital scope X/Y... as mentioned, you'd might as well just use an lcd screen for anything other than measurement, because it's all pixels anyway.

author: ledtester
author_rank: Super Contributor
timestamp: March 23, 2025, 11:18:49 am
content: Quote from: TomKatt on March 18, 2025, 08:16:49 pmA recent blog post about the Vectrex:https://www.amigalove.com/viewtopic.php?t=2887and the Hacker News comments:https://news.ycombinator.com/item?id=43449326mention this Steve Ciarcia design which was published in Byte, November 1976:https://drive.google.com/file/d/1y6SfEN8idhdZ7Y_rNh0zD9uzHECBRDpe/view?usp=sharing

author: TomKatt
author_rank: Frequent Contributor
timestamp: March 23, 2025, 02:52:09 pm
content: Quote from: ledtester on March 23, 2025, 11:18:49 amLOL - you may not believe this, but I am aHUGEfan of Steve's articles (I used to subscribe to BYTE - the cover art was equally good) and I not only recall that exact article, but I built a project based upon it on my 6502 C64 in asm code with DACS connected to the expansion bus. It worked on my analog scope.He also wrote an article about POV displays before anyone knew what a Propeller Clock wasAs I said - I love vectors displays

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 23, 2025, 04:02:46 pm
content: Quote from: TomKatt on March 19, 2025, 04:30:01 pmWhat's wrong with those?

author: ColinB
author_rank: Contributor
timestamp: March 24, 2025, 03:40:41 pm
content: Quote from: SiliconWizard on March 23, 2025, 04:02:46 pmTerrible things will happen to you if you possess one. Therefore since I am so generous, I'll be willing to take it off your hands and protect you from its curse.Got it?

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 24, 2025, 03:43:50 pm
content: Quote from: ColinB on March 24, 2025, 03:40:41 pmCome on, they're not this rare. Are they?

author: LaserSteve
author_rank: Super Contributor
timestamp: March 24, 2025, 03:50:01 pm
content: One of the requirements, with Vector on CRT or Galvo/Laser is an accurate and simultaneous update of all DACS. We usually use "Double Buffering" to achieve this. Some of the better quality Dual or Quad Dac chips feature this update mode.Here is a good read:https://www.jmargolin.com/vgens/vgens.htmhttps://arcarc.xmission.com/Web%20Archives/Jed%20Margolin%27s%20Web%20Site%20(Aug-17-2003)/uvmath/uvmenu.htmhttps://www.jmargolin.com/xy/xymon.htmIf its Atari, and if if had a XY display, it has Jed Margolin in it.Steve

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 24, 2025, 04:15:58 pm
content: Yes, something to keep in mind if you want to use internal DACs of some MCUs, which may or may not allow simultaneous update. The ones on the STM32s which have dual DACs normally do, you can update them at the same time if properly configured.For external DACs, many SPI DACs have that feature too if you use a dual DAC in one chip, but make sure you configure it properly for that (synchronous vs asynchronous update mode). If two separate DACs, then there's usually a dedicated sync or load pin, use it to sycnhronize updates.