Velociraster! And Other Oscilloscope Nonsense

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is an old analog scope that I picked up on eBay for I think it was 15 pounds this is um an oscilloscope that has a CRT which is this thing here so it's a cathode ray tube and it works by having an electron beam that's that's steered around and normally you'll have it sweeping across like this and you'll plug a voltage in and then it will go the point will go up and down so you can see the the waveform of what you're trying to measure and for measuring things but they also have these old Scopes always have it's a bit knackered they have um an X Y mode where you can plug in two channels and the voltage in One controls the X and the voltage on the other channel controls the way so it's like a nature sketch just move the pointer around now obviously moving it with my my hands here I can't move it very quickly um let's see if I move it really fast you can see it leaves it it leaves a trail behind you can see a line and a squeak but if we have something controlling these voltages much much faster then we can draw shakes on the screen and that's the idea behind behind uh Vector games like asteroids and Star Wars in the arcade that was a whole there was a Home console Vector machine as well called the vectrex that's the principle that these things use and they're really special they have um they have a some amazing characteristics to the display that makes them quite unique so I've always wanted to to make my own well I said made my own I have an oscilloscope like this and then make something to drive the scope so I can play games on it okay this bit's going to be quite long and boring so um so feel free to skip it if you're not interested in the in the boring technical details uh this is what I'm planning to use to uh to drive the oscilloscope um this is a Raspberry Pi Pico and then we've got a couple of analog to digital converters to drive the X and Y voltages there's another Pico down here that looks like it's dead just ignore that one that's um that's just used for debugging and then here I've got um a wonderful custom game controller these are the two outputs by the way for the two dacs so before I just before I describe how this is going to work in software let's talk a little bit about how vector arcade games work how the how the vector graphics work in those kind of things well normally they would use something called an analog integrator for drawing the lines so the the digital parts of the machine the CPU would set up where it wants the line to be the X and Y position where it wants to the start of the line and it would set up um it typically set up the the Deltas like the change in X and the change in y that it wants and it would feed those to something called an analog integrator and then kick it off and the integrator will then sweep the voltages in a straight line so you get you get the nice line on the vector well and also they have a they have a third input as well as the X and the Y they've got a third input for the brightness of the vector because I think typically the the analog integrators would operate at one speed so they would always draw a lines at a constant speed now there's a couple of problems with that for me first of all my scope doesn't have an input for the brightness all I've got is X and Y I can only change the position of the beam and secondly I'm not very good with analog Electronics so I don't know how to build an integrator so what I'm planning to do is because I've got these two these two dacs that I've got are very very high speed so in theory I can drive them at maybe one megahertz which is which is pretty fast and my idea my plan is to use is to um use the CPU on here to do the integration digitally so instead of having analog components to sweep the beam along a straight line we'll use digital control to step the beam along a straight line but in very fine increments so that it looks essentially the same now the picot the Raspberry Pi picot I think is the perfect microcontroller for this job it's got two CPU cores and it has a dma engine and it has something called Pio which stands for Forum programmable i o So the plan is to use the first CPU car just to run the the high level code of a of a game say and that code is going to decide where he wants to draw the lines so he's going to say you know I want to align here and draw it up to there and then there and there and there so it's going to draw it's going to just decide the coordinates of the lines and also how bright it wants them to be and then what I want uh the second CPU card to do is take those lines and break them up into very very small steps and put them in a buffer put those steps in a in a buffer it's going to be a fifo um buffer with lots and lots of coordinates in now then the we can use the dma and the Pio to then uh squirt the data out of the buffer to the tax the Pio can read um a single 32-bit value from a buffer and I might have two 12-bit values within there and what it can do the Pia can like read one value take the first 12 bits send it to the first DAC and then trigger the chip select for that deck then it can take the next 12 bits send it to the the same pins and the same i o pins and then trigger the second deck to read those and it can do that with very careful timing and at very high speed it's also worth mentioning that we can vary the brightness of any line by varying uh how quickly we we scan the beam across it so if we want to have a very bright line then we scan the beam very very slowly give the phosphor time to light up but if we if we only want a very dim line then we just move it quickly and we can do this with the the digital integration by by just varying how many steps we divide a line up into so because each step is being sent out in the same amount of time if we go with big steps then we'll move the beam quickly if we go with small steps then we move the beam slowly so that's the idea right so let's turn it on and see what we've got here's a little test pattern it's just drawing lots of squares in a spiral shape you can see how we're changing the intensity quite well we've got the the squares on the outside quite bright and then they get dimmer towards the center it's not perfect there are some little Jiggles that I'm not quite sure where they're coming from and some of the edges are not quite straight uh but it's working quite well I'm quite pleased there are also these little Speckles here where I think the uh the the fifo for the Pio units has been it's been drained his the CPU is not able to fill the fill the buffers up quickly enough in some situations where we've got lots of short dim lines and one thing that's interesting is normally on on this kind of vector display like this you'll get a little a little bright spot at all the vertices that's that's quite characteristic and this is missing here in most of them because the CPU because it called one is just filling up a list of points to move the vector to move the beam to and it doesn't stop so the Pio when it's sending them out to the Dax it doesn't it doesn't need to stop at the end of the lines normally on um with an analog integrator there'll be a little bit of setup time when you are you're setting it up for the start of each new Vector so during that setup time even though it's very very short the beam is staying in in one spot and that's what gives you that kind of characteristic little bright spot between the vectors normally so what else can we do well as well as lines we can do points and again we're just altering the brightness by adjusting how long we hold the beam in anyone spot so here it just moves the moves the beam to where I want to draw a points and it holds it there for as long as I want for the for the brightness and if we can do the lines and we can do points then we could do games like this one where you have to defend yourself from uh from space rocks in space completely original game just recent it now the cool thing about Vector displays this that I really love that's really hard to get across in a video like this is just how bright the little points are for the bullets it's it's really um kind of HDR and I don't think even if I could make a HDR video I don't think that would um that would sell it either I don't know how bright the points are but I kind of personally bright they're really they're really cool and I love that about these displays so what about raster these are vector graphics what about raster what if we have a one bit display where we want to do a pixel some pixel graphics and those pixels are on or off can we trace the beam across and make it move across where we have pixels and then skip bits where we don't have pixels can we do that fast enough so that we can build up a raster image well let's give it a go here we have another original game this one is more like a raster game it's not quite exactly like a raster it does scan down the screen but anywhere that's black we basically just skip so the beam only draws the little spans where the pixels are on this is this is a one bit display so the pixels are either on or off so here we just need to make the beam Trace across where the pixels are on and then where the pixels are off it skips so it's not quite the same as a um a traditional raster display where it will sweep across every line and Vary the brightness as it's going if we want to do grayscale raster then we need to vary the speed of the beam as it's sweeping across so here we go I've slowed down this raster beam so we can see it building up frames I'll slow it down some more so we can see it's sweeping across and then slow down even more so we can see it really kind of speeding up and slowing down as it's even across each line so then if I let it speed up back to its full speed we can see what it should be so this is a 320 by 200 raster image a grayscale image and the text is Vector so we can mix vector and raster on the same display which is pretty nice and of course if we can do still images then we can do video as well and I'm sorry oh sorry thank you for watching
Info
Channel: Oli's Random Retro Shed
Views: 19,911
Rating: undefined out of 5
Keywords: Raspberry Pi, Pico, Oscilloscope, XY, Vector, DAC, Game, Asteroids, Invaders
Id: BEgRV6VHzgg
Channel Id: undefined
Length: 14min 23sec (863 seconds)
Published: Wed Mar 29 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.