DAC Test - VGA from Scratch - Part 10

  Переглядів 14,517

James Sharman

Рік тому

In the first vga video I set a goal of being able to reproduce “millions of colours” but at present my digital to analogue converters are either 3 or 2 bits per channel. I need at least 7 bits per channel to hit that goal, preferably 8. I had a plan but comments have called it into question, in this video I talk about my original plan, why it might be flawed and what the alternatives might be.
0:00 Introduction
1:04 Discussion
8:58 PCB Design
15:42 Unbox and Solder
19:37 Stand alone Test
26:54 Test Integration
29:41 Outro

КОМЕНТАРІ: 215
@weirdboyjim
@weirdboyjim Рік тому
Join us on Discord: discord.gg/jmf6M3z7XS Support the channel on Patreon: www.patreon.com/JamesSharman I did realize during editing that I got the gradient range wrong, the bars only go up to 224/255 but the test is just as valid. Should have made it 4 bars with an offset of 58 each line to cover the full range with a bigger overlap.
@KeithOlson
@KeithOlson Рік тому
Fascinating build, excellently, presented! I'm decidedly *NOT* an EE, but the first thing that came to mind regarding the 127->128 jump was to dump regular binary and use Grey code, instead, as that will *guarantee* that only a single bit changes between steps. Displaying regular images would require a simple program to convert between the two image formats, but that would be pretty trivial. Does that make sense or am I missing something important? (...which is highly likely, to be honest. :sigh: )
@ecosta
@ecosta Рік тому
I'm paranoid enough to animate the bar test (i.e. start from 0~255, then 1~, 2~, etc) and check if the values of the end of a bar and the start of the next are smooth as well.
@tux1968
@tux1968 Рік тому
Hi, sorry to be a pest, but would you please share the make and model of your microscope camera? a link to a purchase site would be even better :-)
@wouterdebie6754
@wouterdebie6754 Рік тому
I absolutely love your videos! Thanks for making them! I also really enjoy the fact that you're open to feedback, consider options and experiment.
@weirdboyjim
@weirdboyjim Рік тому
The open secret is that this channel and the viewers are saving my local friends from having to feign interest in my crazy projects ;-)
@Dave5281968
@Dave5281968 Рік тому
@@weirdboyjim That feigned interest is the boat that most of us are passengers on!
@GodmanchesterGoblin
@GodmanchesterGoblin Рік тому
I also felt the R2R approach would be fine since the spread within a single batch of resistors is often small. You just have to keep an eye on the time constants if the pixel rate is high enough. That stencil was just about the funniest thing I've seen on any of your videos, James. You had me roaring with laughter. But I was also shouting at the TV - "You need more signal grounds!" Of course, it worked out OK, but with eight data bits at pixel speeds, a pixel clock and another control signal, I was surprised that the two grounds that you had were sufficient. When you put three DACs onto a single board that won't be such an issue depending on how it's all connected together. A filtered supply to each of the DAC driver latches might help clean things up a bit too by blocking some of the general system noise on the supply. Great progress, and looking forward to the next step
@weirdboyjim
@weirdboyjim Рік тому
Yeah, I've been thinking about ways to isolate the supply a little. VGA actually gives you signal return for each color (i.e. local GND) which I could tie into an isolated supply.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
Jaguar has a resistor network on the lower edge of the Tom chip. Can’t we buy these off the shelf? I like how the cat neatly separated semiconductors and coke, soot or whatever is in a resistor. Pretty surely Jaguar was price optimized. R2R needs termination. It is straight forward to come up with a resistor network to reduce voltage. Ain’t video signals only 1 V p2p ? Now I have to look for an amplifier on the Jaguar board. It is weird that this “from scratch” build uses highly integrated circuits. Jaguar had to switch to an off the shelf audio DAC because standard equipment is just so good. PSX uses an off the shelf video DAC. So we are from scratch like a PSX?
@xombies
@xombies Рік тому
Every single time I get a notification that you've posted a new video I get all kinds of giddy. Thank you so much for these!
@weirdboyjim
@weirdboyjim Рік тому
You are so welcome! Good to hear you are finding them interesting!
@DigicoolThings
@DigicoolThings Рік тому
Hi James. Another awesome video. :) Regarding your R2R ladder and resistor values, note that resistors come in Preferred Value series. The preferred values are a percentage relationship to each other. e.g. The E96 series has each value +/-1% of it’s neighbouring value (E48 is +/-2%, E24 is +/-5% etc.). The manufacturer then just assigns an individual resistor’s marked value by dropping it in the Preferred Value bucket that it fits (hence the percentage relationship between Preferred Values in each range). This means two things: 1). The error in an individual resistor’s value doesn’t fit a bell curve. It is simply a random value within the +/-% tolerance Preferred Value range. 2). If you want specific matched values it’s common to just test & select some closely matching value resistors from your parts drawer. Obviously, choosing resistors in the E96 (or even E128) series makes finding matching resistors, within a fine tolerance, much easier. Obviously, in use, there is also individual value variance due to temperature drift etc. But for a simple R2R ladder the relative effect should be negligible. In summary, you simply need to measure and select appropriate matching value resistors to use in your R2R ladder. Hopefully this information is of some help?
@weirdboyjim
@weirdboyjim Рік тому
Interesting, With that selection logic it would create a bell curve but with a gap "cut" out of the middle.
@DigicoolThings
@DigicoolThings Рік тому
@@weirdboyjim Hi James. I’m not sure I’ve understood your reference to a bell curve but with a gap "cut" out of the middle? Although, with further thought, I do agree that there would still be a bell curve, relative to modern manufacturing tolerances. But given the design intention of the Preferred Value resistor ranges, I’d think it questionable whether manufacturers are that concerned with manufacturing for specifically accurate individual resistor values. But, I’m not really up with modern resistor manufacturing practices, I’m just recalling from my own experiences back in the day. 🤓
@WyrdieBeardie
@WyrdieBeardie Рік тому
Always a pleasure to see your videos in my feed. Thank you James!
@weirdboyjim
@weirdboyjim Рік тому
You are very welcome! Glad you are enjoying!
@monad_tcp
@monad_tcp Рік тому
I laughed hard when I saw the size of the stencil. I didn't knew you made jokes unintentionally. That's a big pan. At least that doesn't require painful debugging. Loving this series.
@weirdboyjim
@weirdboyjim Рік тому
You say the debugging wasn't painful, but I could have cut myself on the sharp edge! 😎
@brandonmack111
@brandonmack111 Рік тому
Awesome! Glad to see it worked out so well! I'm excited to see your full-color output soon
@weirdboyjim
@weirdboyjim Рік тому
So am I! Won't have all 24 bits until I have the final board though.
@TheRealBobHickman
@TheRealBobHickman Рік тому
Always great to see a well thought out test plan & execution.
@weirdboyjim
@weirdboyjim Рік тому
Thanks Bob, always good to hear from you!
@nockieboy
@nockieboy Рік тому
Watching you solder with the stencil and hotplate has spurred me on to use my hotplate for my next PCB. Up until now, I've been soldering all my SMDs by hand or hot air gun.
@weirdboyjim
@weirdboyjim Рік тому
Go for it! The hot plate is a big help, make it easy for me to video the reflow as well!
@m1geo
@m1geo Рік тому
@@weirdboyjim We told you, James! ;) You were soo attached to the hot-air gun! :)
@nockieboy
@nockieboy Рік тому
@@m1geo Me too. I was going to leave the hot plate for some upcoming BGA work, but having seen this video I see no reason to keep relying on the hot air gun anymore. 👍
@asmi06
@asmi06 Рік тому
@@weirdboyjim You might want to get some sort of desktop fan to cool a board below melting temperature before you pull it off the plate.
@asmi06
@asmi06 Рік тому
@@m1geo Reflow oven is even better, especially if you need to use double-sided placement.
@JohnScherer
@JohnScherer Рік тому
Excellent video as usual James. Your videos are always very well edited and your presentation of your work is both enjoyable and refreshing when compared to so many other channels..
@weirdboyjim
@weirdboyjim Рік тому
Thanks John, that's good to hear.
@himselfe
@himselfe Рік тому
Genuinely amazed that I had no idea your channel existed until yesterday. Your videos have a great flow and the right balance between information and demonstration.
@weirdboyjim
@weirdboyjim Рік тому
Glad you like it! Hope I live up to expectations!
@rauljvila
@rauljvila Рік тому
This knd of proof of concept demo is very helpful to understand the details, very insteresing! And I appreciate the eye candy of seeing it working on the monitor at the end :). Great content as always, and it is still getting better, thanks!
@weirdboyjim
@weirdboyjim Рік тому
Thanks! Glad you found it interesting!
@sorenthegaymer
@sorenthegaymer Рік тому
I found your videos not to long ago and I am so glad I did. I've always loved the idea of building a computer at a low level and you do a great job at being informative. Thank you for the great content.
@weirdboyjim
@weirdboyjim Рік тому
Thanks! Glad you are finding it all interesting!
@pipsqueak2009
@pipsqueak2009 Рік тому
This is fascinating. Thank you very much for sharing your progress on this.
@weirdboyjim
@weirdboyjim Рік тому
Glad you enjoyed it!
@UnexpectedMaker
@UnexpectedMaker Рік тому
Though I didn't think the R2R ladder would cause you any real world issues, I didn't expect it to be quite that good and linear. Nicely proven out!
@weirdboyjim
@weirdboyjim Рік тому
Thanks Seon! Very easy to start doubting yourself when people comment that it won’t work.
@akkudakkupl
@akkudakkupl Рік тому
Bourns makes r2r ladders. You could use colour lut with 256 indexes at 8bits per colour - this would possibly be the best option with your 8 bit per transfer limitation.
@weirdboyjim
@weirdboyjim Рік тому
That is exactly the plan!
@bzuidgeest
@bzuidgeest Рік тому
Almost every vintage computer did it that way so that seems like a plan.
@akkudakkupl
@akkudakkupl Рік тому
​@@weirdboyjim that is even better than original VGA spec ;-) Bourns 10k R-2R ladders are reasonably cheap, but you would need to buffer their outputs with either video class opamps or with transistor emitter followers with some simple tricks (using a diode at input to compensate Vbe).
@ivanscottw
@ivanscottw Рік тому
Amazing video as always ! I wish I understood electronics that well, but seeing you doing what you do is just incredibly satisfying seeing this entire setup being built just - because ! (this will probably never see any kind of real world application, so it is basically - art !)
@CeDoMain
@CeDoMain Рік тому
The real world application is to teach James and us how this works and it amazes people. 😁
@ivanscottw
@ivanscottw Рік тому
@@CeDoMain That's what I said : Art !
@weirdboyjim
@weirdboyjim Рік тому
Thanks Ivan! Those are kind words. To me a hobby project like is really showing me what I do and don't understand. It's very easy to convince yourself you know things but actually putting it into practice forces you to really know it.
@ivanscottw
@ivanscottw Рік тому
@@weirdboyjimMore than the achievement it is the thought process that you describe that I find fascinating - and why I watch your videos on end.. How you get from one step to another.. stumble, then describe how you figured what went wrong, found the clue that got you back on track - then figure out there was a better way ! It is the journey that counts - and you describing it. Describing failures and how they can be fixed is more important than showing success (although that works too - sometimes you get it right on the first try !)
@jonshouse1
@jonshouse1 Рік тому
Lovely to see that done in detail like that, thanks. Over the years i've worked with r2r and DAC ICs, I've not noticed huge issues with either but i've never tried to use r2r with more than 8 bits for the reasons you outline. I've found even 5% is fine as long as all bits pass via a single pack at a time, otherwise all bets are off as that cross over notch becomes real. I have seen issues with boards where temperature is uneven, not sure if that is all a resistor issue or if the boards I used had a buffer amplifier of some sort... That is going back many years so boards tended to be much larger, and hotter!
@weirdboyjim
@weirdboyjim Рік тому
Interesting to hear about your experience there.
@catgirlQueer
@catgirlQueer Рік тому
that stencil is amazing
@weirdboyjim
@weirdboyjim Рік тому
Indeed! Most annoying thing on this big ones is just trying to line it up with the tiny pcb!
@theoriginalrecycler
@theoriginalrecycler Рік тому
Always impressed. Carry on the good work.
@weirdboyjim
@weirdboyjim Рік тому
Thanks! Glad you are enjoying!
@AndyGoth111
@AndyGoth111 Рік тому
I feel this one video is exceptionally excellent and useful standalone. Your CPU and VGA and UART and audio work may be great, but they're all large projects. This is a worthy project on its own, yet fits within a single video and doesn't significantly depend on any of the others. It demonstrates much of the technique and knowhow underpinning a good chunk of your circuit work. I will be recommending it to friends and family.
@weirdboyjim
@weirdboyjim Рік тому
Very kind words Andy! Glad it's been useful, it was quite a nice little sub project. The nature of my main projects it's rare I get to call anything done.
@CodyNewhouse
@CodyNewhouse Рік тому
Enjoying this journey. :-)
@weirdboyjim
@weirdboyjim Рік тому
Glad to hear it!
@TrollingAround
@TrollingAround Рік тому
As always, fascinating, thank you :)
@weirdboyjim
@weirdboyjim Рік тому
Glad you enjoyed it!
@mrwidget42
@mrwidget42 Рік тому
Another consideration is that the human eye does not have a linear response to the primary color sources in its primary sensor, the retinal cone cell. Hence the gamma correction function comon to color display output controllers. So either the analog voltage of source prior to the dac or the resistor values themselves can encapsulate the gamma function for each primary colors before the output will center the response in the human color space. If I remember correctly the red curve had a .58 adjustment while the green had .39 and blue had .16. That means that the blue would need an effective amplifier gain of 1/.16 to center, or 6.25.
@weirdboyjim
@weirdboyjim Рік тому
Indeed, the non linearity is something we have to deal with in rendering all the time.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
What? Gamma factor is implemented by the electron gun in the CRT. Artists create their artwork on a similar CRT as the player. Raytracing and path tracing create intensity. Even on my 386 I used a floating point library for this. So you can invest in the correct gamma when you write the the frame buffer. We really need 220px true color.
@Quxxy
@Quxxy Рік тому
It's a good thing the old 8-bit micros aren't sentient, because if they were they would be *seething* with jealousy. Oh, look at Mr. Fancy Parts with his 8 bits *per channel*. What does he think he is, a 386 with VGA?! Eagerly looking forward to the design for the other parts of the VGA subsystem.
@weirdboyjim
@weirdboyjim Рік тому
I can't wait for you to see the demo I'm currently working on :-)
@ecosta
@ecosta Рік тому
That was inspiring. I'm not a fan of analog devices (or converting to analog), but I really enjoyed the simplicity of this design. It makes me feel like going back to electronics as a hobby... :)
@weirdboyjim
@weirdboyjim Рік тому
Thanks! Analog is something I try to avoid but needs must...
@moshly64
@moshly64 Рік тому
You are going to get some error from the driver chip output drivers not all being the same. Also I'd try 0-100-0-100% checkerboard pixel test to see if you can slew fast enough.
@weirdboyjim
@weirdboyjim Рік тому
Indeed, but I'll need the tiledata circuit in place before I can do alternating pixels at full clock rate.
@santiagoguildomenech1864
@santiagoguildomenech1864 Рік тому
I do agree. I went on a similar route once (74ACxx, though) and found that error from chip's output voltage was significantly higher than the 1% from resistor ladder. After all, they are meant as digital logic , not laser-trimmed analog ones. Specially when load varies from "bit to bit"..... But, as always, if it works, don't touch it! Great work, James!!!!
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
@@santiagoguildomenech1864with CMOS logic wouldn’t the output reach the rails with very low deviation? High resistance in the resistors, powerful drivers for the pins.
@matambale
@matambale Рік тому
With two 470 ohm resisters up from the ground rail, that's 2x the 1% error. I presume that's accounted for in your spreadsheet. I only mention it here because it's the sort of thing I'd forget, not that you would. (Edit: loved that DAC performance and layout, the enormous stencil, and once again very clean resistor array soldering)
@GodmanchesterGoblin
@GodmanchesterGoblin Рік тому
Not really. If both resistors are +1% it's still only a 1% error on 940 Ohms.
@matambale
@matambale Рік тому
@@GodmanchesterGoblin Woops. Roger that.
@weirdboyjim
@weirdboyjim Рік тому
Yeah, if they are both of by 1% "the same way" the result is 1% error. On the other hand if the errors really do follow a bell curve the clustering towards the center will be increased with the pair.
@Dave5281968
@Dave5281968 Рік тому
Absolutely excellent results. And I think this proves why IBM chose to go with the same R2R ladder design for their first VGA designs. Can't wait to see the parrot in 24-bits. Thanks for an excellent video.
@weirdboyjim
@weirdboyjim Рік тому
You are welcome! I'm very interested to get the pallet going as well, there are some interesting things you can do with it.
@richfiles
@richfiles Рік тому
That stencil! Oh dear... At least it was usable.
@weirdboyjim
@weirdboyjim Рік тому
My first stencil was a bit one like this as well. More than anything a pain to store.
@GORF_EMPIRE
@GORF_EMPIRE Рік тому
The likely hood of the error being even terribly noticeable is minimal. I think this is more than a reasonable circuit to do 24 bits with.
@weirdboyjim
@weirdboyjim Рік тому
Now all I need is to do something interesting with those 24 bits!
@GORF_EMPIRE
@GORF_EMPIRE Рік тому
@@weirdboyjim One step at a time.
@axelBr1
@axelBr1 Рік тому
It's not my field of expertise, but I'm sure I heard that actually the human eye isn't all that good at discerning shades of colour. Plus it's only going to show up if adjacent pixels are a single colour on the 127 128 transition, which is probably only applicable in artificial scenarios.
@azayles
@azayles Рік тому
Love that crisp slope coming out the DAC :D Ya love to see it! The acid test is gonna be plotting a colour gradient on the screen and seeing if there's any banding :) As for mixing the colours to get monochrome, you need to mix the RGB channels in these proportions respectfully: 29.9%, 58.7%, and 11.4% (I *think*. Don't quote me, play with the numbers and the orders :D) I think you can use opamps to weight the channels and mix them in the correct proportions. Can't wait to see more! :D Edit to add: It might be the case that the weighting and colour mixing is done inside the monitor, and you can just send the full signal to each channel. I guess make the parrot text card image monochrome in Photoshop or similar, and see if it looks the same xD
@weirdboyjim
@weirdboyjim Рік тому
The gradient I put in the screen gives me a pretty solid idea, once I have the pallete in and 3 of these I'll be able to play some more though.
@Zadster
@Zadster Рік тому
That is the colour mix for composite video. VGA is pure 3 channel RGB.
@garyliddon
@garyliddon Рік тому
Great vid James :)
@weirdboyjim
@weirdboyjim Рік тому
Thanks Gaz! Glad you are still finding it interesting.
@khatharrmalkavian3306
@khatharrmalkavian3306 Рік тому
During the early design phase I was thinking you could use a meter to rank the resistors by deviation from the average and then use the most deviant ones as LSB, but with chips and PCBs that's a bit onerous. Incidentally, doing a project like this is my dream, but I haven't got anywhere near the time or money, or privacy to do such delicate work. I shall enjoy it vicariously through you, sir!
@weirdboyjim
@weirdboyjim Рік тому
Glad you are enjoying it. I wonder how tough it would be to build a jig for mass testing resistors.
@Otakutaru
@Otakutaru Рік тому
Such cutie of a PCB
@weirdboyjim
@weirdboyjim Рік тому
I know right!
@m1geo
@m1geo Рік тому
Excited! 👌👌👌
@weirdboyjim
@weirdboyjim Рік тому
Thanks George!
@OscarSommerbo
@OscarSommerbo Рік тому
The criticisms of using r2r ladders using discrete resistors are both completely valid and way off base. The 5% (or 1%) variability, is a max value, with today's manufacturing techniques you are getting way better than the stated amount. A nice lite diversion none-the-less.
@weirdboyjim
@weirdboyjim Рік тому
Pretty much my conclusion, I don't regret taking the time to explore it though.
@OscarSommerbo
@OscarSommerbo Рік тому
@@weirdboyjim The video and examination was well worth the time.
@TheEmbeddedHobbyist
@TheEmbeddedHobbyist Рік тому
Part of tolerance range is that you can't make a resistor that doesn't fit in any value. So they don't have to be too tight on manufacturing. Ageing and temperature coefficients just add to the fun. So much fun can be had testing a D2A over temperature, many a month spent doing that.
@andymouse
@andymouse Рік тому
Marvellous and I understood it !....cheers.
@weirdboyjim
@weirdboyjim Рік тому
Thanks Andymouse!
@schrodingerscat1863
@schrodingerscat1863 Рік тому
Great analysis to get to a good enough solution. This is what engineering is all about, to be fair you could check the resistor arrays before you start to make sure there aren't any outliers. Other than that for a home made video DAC this is a pretty good design. The only thing I would add would be the ability to add some bias voltage to each channel so you can tweak colour balance.
@weirdboyjim
@weirdboyjim Рік тому
Overall bias is an interesting suggestion. I'm feeling tight on space though so I'm cautious about adding anything that will be trippled.
@schrodingerscat1863
@schrodingerscat1863 Рік тому
@@weirdboyjim Just an opamp and a trimmer pot on each channel would be enough to even out any differences between the converters. It may not be necessary though. You could always build another prototype and see what kind of variance you get between them. I think as long as you test and match the resistors you should be ok.
@bzuidgeest
@bzuidgeest Рік тому
A great video but I feel the outcome was very much to be expected. Resistor ladders are very common in video output circuity. If they really had such big problems that would have never happened, everybody would use DACs or the would have specialized resistor ladder packages.
@weirdboyjim
@weirdboyjim Рік тому
I agree, but remember that every bit doubles the accuracy requirement. I could have still produced pretty good results with 565 rather than 888 so I was mainly checking the extra effort was worth it.
@tzubin99
@tzubin99 Рік тому
I’m building a VGA output for an FPGA and this video gave me some good things to think about… thanks!
@weirdboyjim
@weirdboyjim Рік тому
Glad it was helpful!
@Zadster
@Zadster Рік тому
I'm looking forward to see if you use a RAMDAC look-up table and how it is implemented. Regarding tolerance, I'm sure your choice of resistor packs will be absolutely fine. I would be inclined to use higher value resistors to reduce current consumption, but its all just a personal choice. You might notice a slight (lack of) gamma correction issues, but it isn't as if you are doing any Photoshop work on it! Definitely add some appropriate power supply capacitors to the chip driving the R2R ladder etc, and some bulk electrolytic to any output drive amplifiers. Don't forget the output may need a 75R impedance matching resistor to stop any 'ringing' or echoes in the video cable.
@weirdboyjim
@weirdboyjim Рік тому
Yeah I'll have a pallets of 256x24bit should be able to do some fun things modifying the colours as well.
@moki123g
@moki123g Рік тому
It would be interesting to see how a regular 8 bit dac compares to your home brew. Great work
@weirdboyjim
@weirdboyjim Рік тому
I fully expect the off the shelf ones are better but I like to custom build things at least the first time!
@MartinPiper6502
@MartinPiper6502 Рік тому
Thanks for the reference to the TLC5602CDW. Although I also use a R-2R ladder for my stuff I've been looking for a more self contained packaged DAC solution.
@weirdboyjim
@weirdboyjim Рік тому
Glad it was useful. I'm likely to use an off the self chip in future builds after this project, I feel like I've "earned" it.
@MartinPiper6502
@MartinPiper6502 Рік тому
​@@weirdboyjim I exclusively use through hole, and I do really like how the R-2R ladders look. But the large size on the board plus the opportunity for EMI issues has made me strongly consider something like a "MX7224KN+". Keeping it to my through hole way of doing stuff.
@Bianchi77
@Bianchi77 Рік тому
Creative video, thanks :)
@weirdboyjim
@weirdboyjim Рік тому
Glad you found it interesting!
@JaenEngineering
@JaenEngineering Рік тому
If you're going to design and build a new board for the final output as an absolute minimum I'd recommend adding those op-amp output buffers to minimise the loading effect of the cable and monitor on the digital chips.
@weirdboyjim
@weirdboyjim Рік тому
Why do you suggest that? Even with cable there is quite a bit of headroom on the line driver outputs.
@JaenEngineering
@JaenEngineering Рік тому
@@weirdboyjim it's not just about the volts/amps that the chip can provide, but its impedance. VGA is designed to operate with a source/load (and cable) impedance of 75ohms. A mismatch can cause reflections in the cable which is a major source of ghosting. While that may not be an issue now using an LCD screen due to its ADC front end, if at some point you wanted to play around with making a "duck hunt" style gallery game using a lightgun and hitscanning you'll need a CRT monitor, and they're a lot more sensitive to impedance mismatches due to their near fully analogue design. So the TLDR is, not really necessary now with the current setup, but could save you some headaches later if things change.
@vincei4252
@vincei4252 Рік тому
Very nice. I don't know how you have the patience to wait for the PCB's. I'd be figuring out a way to manufacture those things before the sun goes down 🤣
@weirdboyjim
@weirdboyjim Рік тому
Lol, I may do some experiments at some point!
@CraftMine1000
@CraftMine1000 Рік тому
Omg that stencil size xD
@weirdboyjim
@weirdboyjim Рік тому
I know right!
@robiniddon7582
@robiniddon7582 Рік тому
Couple of questions. Is it worth using higher value resistors to minimise the current you are sourcing/sinking from/to the HCT? Then use an opamp to buffer the output and of course you can then put the series termination resistor in to impedance match the VGA cable? Note that the more current you pull from the latch, the more vcc noise you will have and that will couple through to all logic 1 bits. Given your user of 2 layer PCBs, that noise might actually trigger some ringing in the 100khz-10Mhz range. That ringing unlikely to break your logic level stuff but might well be visible on your display as waves that ripple across the page or down the page depending on the frequency. P.s. opamp slew rate might be limiting factor, but I am sure you can buffer the voltage somehow.
@weirdboyjim
@weirdboyjim Рік тому
You maybe right, but I was careful to make sure the current source/sink would stay well within range. All the vga boards are 4 layer, I wasn't fool enough to try these frequencies without power planes!
@robiniddon7582
@robiniddon7582 Рік тому
@@weirdboyjim aha ... I haven't been following carefully enough clearly. I was more thinking that no two channels of the latch will have quite the same Rds-on in their high side FETs and of course you'll be pulling different currents from different pins. The lower the current, the lower the error. You can of course make it all work on two layers, you just need to be very careful about the return paths for every signal. 4 layers easier but no guarantee ... You still need to watch those return paths 😜. Anyway I will go watch the other 9 episodes... Great channel, really enjoying it 👍
@McTroyd
@McTroyd Рік тому
I look forward to seeing how you reconcile the 24 bits of pixel data with the 8-bit processor. Perhaps something similar to what you did with the registers on the audio circuit? Alternatively, perhaps you could drive something from the 16 bit registers and still get lots of colors. I think the 16-bit RGB "standard" is 5 bits red, 6 bits green, and 5 bits blue, in that MSB-LSB order. Depending on your target screen resolution, that might be a fine... don't want too many more colors than pixels. 😁Then again, maybe that opens up palette opportunities? 🤷‍♂👍
@weirdboyjim
@weirdboyjim Рік тому
I think I've dropped enough hints on this. I'll be using a 256 entry palette lookup to translate to 24bits color. This actually gives some great opportunities for changing the colors on the fly like I did with the scroll registers in the beam racing demos.
@McTroyd
@McTroyd Рік тому
@@weirdboyjim Perfect! Looking forward to it.
@sdjhgfkshfswdfhskljh3360
@sdjhgfkshfswdfhskljh3360 Рік тому
If you want to improve smoothness of sawtooth, you can order more resistors than needed and manually select ones, which fits better together. I'm not sure how to do measurements for such tiny devices, but it is possible for sure.
@weirdboyjim
@weirdboyjim Рік тому
Not sure if the tools I have are sensitive enough to spot the difference on a loan resistor.
@robiniddon7582
@robiniddon7582 Рік тому
@@weirdboyjim build a Wheatstone bridge and plug them in one at a time, then bin them based on tolerance. Build your ladder out of whichever tolerance bin has enough parts in it. 0.1% probably possible if you buy a reel of 1% 470R 😀
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
Can a saw tooth signal be used to find the most offending resistor and replace it? Also if the circuit would sawtooth in horizontal retrace, it could update a look up table ( a palette) to reorder a 10 bit DAC .
@JanBruunAndersen
@JanBruunAndersen Рік тому
Would it be worth to bake the resistors in a oven for say 24-48 hours and then measure the resulting resistance? Then you can pick the most accurate resistors for the top 3 bits in each ladder.
@weirdboyjim
@weirdboyjim Рік тому
Very interesting idea, not sure if my measurement tools are accurate enough for this to make a difference.
@CraftMine1000
@CraftMine1000 Рік тому
Yaay!
@weirdboyjim
@weirdboyjim Рік тому
Thanks!
@crbielert
@crbielert Рік тому
Buy more than you need and measure them all out to get matching sets. That's what I used to do on audio circuits to guarantee the left and right channels are matched.
@weirdboyjim
@weirdboyjim Рік тому
Yeah, although that would work better using single resisters rather than the arrays.
@cskilbeck
@cskilbeck Рік тому
Not sure if it's true for resistors but for capacitors the error is rarely close to zero (i.e. the bell curve has a hole in the middle) because the parts with good tolerance get binned out and sold for more money... So a +/- 20% capacitor will probably have an error of between - 20 and - 10 or + 10 and + 20. If it's below +/- 10% then it will get sold as a 10% part.
@cskilbeck
@cskilbeck Рік тому
It's possible that resistors don't work the same way and they manufacture to the tolerance rather than binning them
@GodmanchesterGoblin
@GodmanchesterGoblin Рік тому
@@cskilbeck Yes - resistors like these are generally laser trimmed during the manufacturing process.
@weirdboyjim
@weirdboyjim Рік тому
Interesting. That hadn't occurred to me. From a little testing it does look like all the resistors in a package to fall very close together though, so wiring it as I did gives a low chance of issues.
@cskilbeck
@cskilbeck Рік тому
@@weirdboyjim Also, as you've demonstrated, 1% is definitely good enough and it seems very unlikely that you'll get a wild swing from 1% to - 1% within a resistor 4 pack
@orsoelectrons
@orsoelectrons Рік тому
Nice sir
@weirdboyjim
@weirdboyjim Рік тому
Thanks Orso!
@M0UAW_IO83
@M0UAW_IO83 Рік тому
Might have missed it but shouldn't the unselected bits of the '574 be tristate (which you can't do for individual pins) or you're sinking current back through the R2R DAC and skewing the output? Simple as a signal diode per output perhaps?
@GodmanchesterGoblin
@GodmanchesterGoblin Рік тому
An R2R DAC requires the inputs to be sourcing or sinking current. There are DAC architectures that are just fed by current sources where turning off the drivers might be required, but they are much harder to manage in discrete hardware for more than a very few bits
@M0UAW_IO83
@M0UAW_IO83 Рік тому
@@GodmanchesterGoblin Yeah, that did occur to me as a possibility while I was driving home and I was going to add it to my comment :)
@weirdboyjim
@weirdboyjim Рік тому
It's worth noting that the minimum resistance between two neighboring pins is 1410 Ohms. If we use ohms law at 5v that gives us 5/1410 = 3.5 mili amps. The line driver outputs of the 74ACT574 can source/sink 24ma according to the datasheet. In the worst case scenario with a line in the middle one way and all it's neighbors pulling the other-way it would source/sink more but than 3.5 but obviously much less than the max.
@CraftMine1000
@CraftMine1000 Рік тому
You can also increase precision by putting resistors in parallel, 10 4700ohm 1% resistors in parallel will act as 1 470ohm 0.1% resistor, (this naturally depends on the normal distribution of the resistors you use ofc so beware of that, Dave from EEVBlog has a nice video on it)
@weirdboyjim
@weirdboyjim Рік тому
Interesting, but it does just bias the probability, it's still possible to be 1% out.
@CraftMine1000
@CraftMine1000 Рік тому
@@weirdboyjim that's what I meant with the normal distribution, if it's centered on the desired value you're good, and that seems to be the case (at least from EEVBlogs tests (if you get good ones instead of the cheap chinesium ones that is)), but yes, if the center of the distribution is offset your final parallel pack will include that deviation, I don't remember the math involved though so I don't know to what degree it influences
@tinygriffy
@tinygriffy Рік тому
I didn't try it, but maybe with a good sturdy paper cutter it might be possible to (cleanly) cut the stencil to size and the material is quite nice for shields and such.
@weirdboyjim
@weirdboyjim Рік тому
Cutting it isn't a problem, not introducing a bend was a concern.
@R.Daneel
@R.Daneel Рік тому
An option that trades time for very low cost: get 5% (or even 10%) standard resistors, buy a box of 1000 (
@weirdboyjim
@weirdboyjim Рік тому
I really like this little 4 resistor arrays. Not sure how long it would take me to sort and then place 0402's or if I could pack them as tight on the pcb.
@twobob
@twobob Рік тому
yeah excellent. loving the preheater. very smooth result. *cough* 24 bit audio? *cough* hehehe
@twobob
@twobob Рік тому
Weep. time to go watch something I missed.... must be something...
@weirdboyjim
@weirdboyjim Рік тому
I love it! 24bit's on a channel is a very different thing than 3x 8-bit channels
@Philip8888888
@Philip8888888 Рік тому
You could also measure the resistors and hand select them.
@weirdboyjim
@weirdboyjim Рік тому
That's also something that could work. But using 4 resistor arrays you could get all kinds of complicated permutations.
@cbmeeks
@cbmeeks Рік тому
One suggested change. Make three boards. One RED, one GREEN and one BLUE!!
@weirdboyjim
@weirdboyjim Рік тому
Ha! Interesting idea but it may not be very practical. Did you notice that the breadboard version uses red, green and blue wires?
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
It would be funny if each board had a capacitor and a common mode choke on the power rails. Then the signal on the cable will become a little balanced. Ah, common mode choke on that side also. Is it twisted pair? Thing is that VGA monitors more expect coax input. With enough choking, each board will just balance how the cable likes it ( and the monitor ).
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR Рік тому
What about an interface that converts the values into a data stream that can feed a HDMI input on a modern TV together with the SPDIF audio stream for the audio meant to emanate from the speakers of the TV.
@weirdboyjim
@weirdboyjim Рік тому
HDMI would be a tricky protocol to do with discrete components, it would end up being a sizeable module on it's own. There are LCD panels that will take a vga like input but with raw digital rgb though that might be worth a look.
@mariushmedias
@mariushmedias Рік тому
re: R2R ladder - you could have used 0.1% resistors for the 2-4 most significant bits and 0.5%-1% for the rest - you can spend 10$ on 100+ 0.1% resistors and bin them with a 10k+ count multimeter and use the ones closest together. Standalone resistors aren't that expensive, Digikey has 0.1% 0603 resistors at 11 cents each if you buy 100. 0.5% resistors are 4 cents each if you buy 100.
@weirdboyjim
@weirdboyjim Рік тому
Sounds like you are talking about single resistors. That was an option but I'd rather stay the arrays for compactness. Pretty confident this will work fine now.
@MissNorington
@MissNorington Рік тому
I would say, at least 6 bits per color component is what I like, gives that retro feel for a VGA display! I am working with (non-palette) 15 bit color (5 bits per channel RGB) frame buffer, and I don't get that retro feel.
@weirdboyjim
@weirdboyjim Рік тому
I did think about doing a 16 bit (RGB 565) palette for a while but the 888 is easier to program for.
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
Atari ST and genesis are 16 bit and only have RGB 333 . We are totally over the top of 8 bits.
@bytesandbikes
@bytesandbikes Рік тому
If it was a problem, when doing one-offs, characterising the resistors and putting the worst at the least significant end should be fine. I like PWM in these cases, but that has its own problems... and some fun dithering tricks
@weirdboyjim
@weirdboyjim Рік тому
I think it will be ok to just use as is, but I will test the final channels like this
@DAVIDGREGORYKERR
@DAVIDGREGORYKERR Рік тому
Metal film resistors might have a nice tight tolerance to negate the problem.
@weirdboyjim
@weirdboyjim Рік тому
I'd be curious to know how much difference the packages make.
@TheTkiller9999
@TheTkiller9999 Рік тому
James... I hope everyone says they found this interesting... I know I certainly did
@weirdboyjim
@weirdboyjim Рік тому
That's good to hear Theodore!
@CezarySiw
@CezarySiw Рік тому
have you thought of using a proper voltage reference in your DAC?
@weirdboyjim
@weirdboyjim Рік тому
Not really, the results I'm getting are good enough for my needs. A voltage reference would help nail the overall range but the results I'm looking for are more sensitive to the relative changes.
@m1geo
@m1geo Рік тому
Regarding your slide at 8:03, that's not strictly true. While the distribution of manufactured parts is a bell curve, the higher accuracy parts are removed from the centre of the curve about the mean, leaving you with a bell curve missing the centre most part (since that's sold at the more expensive rate for the higher tolerance parts). It has a fancy statistical name (which I've forgotten). But in essence, you're very unlikely to get parts
@weirdboyjim
@weirdboyjim Рік тому
Some other people have suggested the same thing. The next tolerance band I see is 0.1% so the 1% parts have a decent chance of being reasonable.
@Otakutaru
@Otakutaru Рік тому
The tunable MSB with a micro pot could be a quick (and almost elegant) way to make sure the DAC works well for years. Reminds me of the CD reader of a Gamecube. When you thought it was finally over for the damn thing after so many years... Some beloved engineer exposed a resistor value to change the voltage to the laser.
@weirdboyjim
@weirdboyjim Рік тому
Interesting idea, I'll think on it but I'm feeling quite tight for space.
@m1geo
@m1geo Рік тому
The FET circuit at 12:33 doesn't make any sense to me! You don't need a gate resistor (it just slows the FET down since you're making an RC delay with the R and the C of the FET gate). And resistance in the source doesn't make much sense in this digital application. However; looks like it works, so it's good enough :)
@weirdboyjim
@weirdboyjim Рік тому
So that other guy who posts that I'm wrong every time I drive a fet gate without a resistor....
@m1geo
@m1geo Рік тому
@@weirdboyjim I mean, resistors as a potential divider to protect against the inputs greater than the maximum V_{GS} is useful. Anywho! It works, that's all you need!
@jensschroder8214
@jensschroder8214 Рік тому
I would now have built the 8bit DAC 3 times and then plugged it into another board.
@weirdboyjim
@weirdboyjim Рік тому
I’m tempted, I have all the parts apart from 1 mosfet
@m1geo
@m1geo Рік тому
16:17 - kitchen scissors will cut the steel sheet, no problem.
@weirdboyjim
@weirdboyjim Рік тому
It will cut it easily enough but I was worried about introducing a bend.
@dmitriyf1
@dmitriyf1 9 місяців тому
I hoped you will test 25 MHz clock
@weirdboyjim
@weirdboyjim 8 місяців тому
The dacs worked fine at 25mhz, that's mostly just about picking a part for the d-type that was fast enough and making sure it's decoupling was good.
@shanent5793
@shanent5793 Рік тому
At least you won't have to buy any stainless shim stock for a while
@weirdboyjim
@weirdboyjim Рік тому
I'm worried what will happen if I try to cut it.
@shanent5793
@shanent5793 Рік тому
@@weirdboyjim could be messy. A very sharp chisel and a freshly turned brass anvil would be the best way
@axelBr1
@axelBr1 Рік тому
The sum of the errors is always accumulative.
@weirdboyjim
@weirdboyjim Рік тому
You have to be really careful with the wording with these things, I may not always get it right.
@axelBr1
@axelBr1 Рік тому
@@weirdboyjim Not sure what you mean by your comment, but made me realise I wasn't paying attention when I posted.
@stephenwhite506
@stephenwhite506 Рік тому
The MiSter IO board uses a R2R ladder. I've built a few and I can't see any difference between 5% and 1%.
@weirdboyjim
@weirdboyjim Рік тому
Be interesting to get some really accurate test gear and test out some resistors.
@edgeeffect
@edgeeffect Рік тому
Electrically it might not make any difference but it keeps us "right way round" nazis happy. ;) I'd have bought an off-the-shelf DAC - spent more money, got the same results and not learned as much. :(
@weirdboyjim
@weirdboyjim Рік тому
How bad would it be if I got just one wrong?
@edgeeffect
@edgeeffect Рік тому
@@weirdboyjim 😀 😀 😀
@ArneChristianRosenfeldt
@ArneChristianRosenfeldt 6 місяців тому
From scratch?
@joeysartain6056
@joeysartain6056 Рік тому
OMG... what a huge stencil. Sorry 😊😁
@weirdboyjim
@weirdboyjim Рік тому
It had to be the smallest PCB I made that mistake on!
Пескоструйный АППАРАТ! #shorts
01:00
Гараж 54
Переглядів 3,2 млн
Ах Ты Ж Су... Не Провоцируй Меня! @NutshellAnimations
00:15
Глеб Рандалайнен
Переглядів 1,6 млн
iPhone - телефон для нищебродов?!
0:53
ÉЖИ АКСЁНОВ
Переглядів 3,8 млн
Лучший Смартфон До 149 Баксов!!!??? itel s24
20:25
РасПаковка ДваПаковка
Переглядів 44 тис.
Лучший Смартфон До 149 Баксов!!!??? itel s24
20:25
РасПаковка ДваПаковка
Переглядів 44 тис.
Phone charger explosion
0:43
_vector_
Переглядів 42 млн
wyłącznik
0:50
Panele Fotowoltaiczne
Переглядів 853 тис.
ИГРОВОЙ ПК от DEXP за 37 тысяч рублей из DNS
27:53
Ремонтяш
Переглядів 401 тис.