Author Topic: VGA display switching with debouncer/multiplexer/buffer circuitry?  (Read 9605 times)

0 Members and 1 Guest are viewing this topic.

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7483
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #75 on: December 13, 2024, 01:58:20 pm »
It's just that every time I've finally understood something we seem to start all over again with yet an improved redesign, which means I have to relearn everything again instead of just completing it.
Do not learn details, learn the reasoning behind the choices!

For example, there are many possibilities on how to control the sync signals.  If we look at the schematic in reply #73, I realized that if we have active-low signals for 1) Atari output, 2) VGA color or mono output, and 3) VGA color output, we only need two analog switches (TS5V330), and a single 74HCS125 suffices for the sync signals.  74HCS125 is a quadruple tri-state buffer with Schmitt trigger inputs at TTL logic levels, meaning it is just about perfect for buffering and enabling/disabling 5V TTL level signals like the sync signals are.

What would change if we replaced the 74HCS125 with say four SN74LVC1G125's?  Nothing much; the latter do not have Schmitt trigger inputs, which means that if the input voltages are not clearly TTL level (low if below 0.8V, high if above 2.0V; so between 0.8V and 2.0V) extra current may be drawn in the '1G125s.

What would change if we replaced the 74HCS125 with four Diodes, Inc. 74AHCT1G125W5-7's?  Nothing at all.  The Diodes, Inc. variant of AHCT1G125 has Schmitt trigger inputs with TTL input levels.  Aside from details like maximum current draw per output pin and such, these are interchangeable.

This is the exact reason I vary my suggestions.  Getting fixated with specific components is not a good idea; you want to learn the rule behind the component selection!  Here, for the sync signals, we need active low enable signal (which means it will have three-state outputs, the third state being "disabled" or "high-Z"), TTL logic levels, and preferably Schmitt trigger inputs for most robust control of the sync signals.  The difference is the same as between memorizing and understanding a text book on something.  The former gets you past the tests, but doesn't enable you to create anything new.  And I only help, because I want others to create something new better than before.

(We could also use active high enable for the VGA sync outputs, because /ATARI is HIGH in both VGA output modes.  So, two AHCT1G125 plus two AHCT1G126 –– the two only differ by the polarity of the enable signal –– from Diodes, Inc. would also work.)

How the analog video signals are routed/switched is a completely separate decision, and does not affect how you deal with the sync signals.
I much prefer the amplifier-as-a-switch approach, because it allows simultaneous output on all connectors, and just seems more robust to me.  This is because video amplifiers passes input to output, amplifying the output, but nothing in the output passes back to input.  Analog video switches and muxes, on the other hand, only connect the input to output, as if it they were connected by wires, so everything on the output side will affect the input side also.  The reason analog video switches and muxes do work well in this particular case is that the video signals generated on the Atari need to be attenuated a bit to get down to VGA levels.

Can I connect the +5V directly from the power supply to this board, or do I need some current limiting resistors or something first?
I think a polyfuse, or Polymeric Positive Temperature Coefficient (PPTC) device on the input, would be a good idea.  Something like a 50mA/150mA one, perhaps a Yageo SMD1206B005TF.  Element14 has a pretty good guide to resettable fuses that explain how they work.

Basically, they are a resistive devices that pass currents up to the holding current (50mA for the Yageo) like a low-value resistor (3.6Ω and 50Ω for the Yageo, depending on the ambient temperature and current it is passing, and how long since it tripped last).  When the current is exceeded for long enough, it trips, its resistance becoming very high, and thus dropping the current.  When the circuit is turned off, the PPTC recovers by itself, essentially resetting itself.  These are basically used for short circuit protection, but they're not instant.  If one triggers many times, you may wish to replace it, as the trip currents and so on will be affected.

Another option is to have a say +7V supply that you linearly regulate to +5V wherever +5V is needed; with just input and output capacitors and a linear regulator (low-noise, low drop or LDO type).  Linear regulators have a property called common mode rejection ratio, often expressed in decibels, which refers to how much ripple and noise is passed from input to the output.  60dB CMRR means that if the peak amplitude of such is 1V on the input, it is seen in the output with peak amplitude of at most 1mV.  (This is because 60dB corresponds to 1000:1 ratio in amplitudes.)
Since the regulators drop only about 2V, at say 100mA of current only 2V×0.1A = 0.2W of waste heat is generated.
This way, noise in one 5V circuit is not passed to other 5V circuits (because each regulates their own one from the common +7V supply), but not too much power is turned into waste heat.

I know others (jepSTone.net) have used Mean Well RPD-60A for Atari STe supply.
I personally might consider using a RPS-30-15 linearly regulated to 12V, and a RPS-45-7.5 linearly regulated to 5V, although I do admit it is overkill; and some kind of aluminium heatsink would definitely be needed for the regulators.  I just like the idea of very low noise, very stable power rails...

[Do bypass capacitors] minimize induction, as the wire traces of the PCB can act as induction coils and cause power "noise" and other problems?
No, they literally behave as local charge storage.  You see, we're using transistor-based circuits here, where current draw changes whenever the signals change state.  This means the current draw from the +5V supply varies based on the signal.  Without local bypass capacitors, the current draw fluctuations affect the voltage on the supply rail, affecting the +5V VCC of other chips.  With bypass capacitors, the peak current draw is topped up from the capacitor, "smoothing out" the noise otherwise generated on the supply rail.

This is also why the capacitors need to be very close to the ICs, preferably within a couple of millimeters.  They also don't need to have huge capacitances; 0.1µF = 100nF is extremely common.  Sometimes you see larger ones, for example 1µF to 10µF, with for example microcontrollers, since they do a lot of digital switching.  (There are entire threads on bypass capacitor selection here at EEVblog forums, including why some use a large and a small capacitor for bypassing; and misconceptions related to that.)

I can't make 4-layer PCBs with Eagle. But 2-layers should do fine?
Yeah.  I do recommend using M2.5 or M3 nylon standoffs; you can get kits from e.g. AliExpress.  The through-hole is then 2.5mm or 3.0mm in diameter.

You could consider not mounting the connectors on the PCB, and instead solder the cables directly to the board, and have the connectors on some kind of panel.  The downside is that the solder joints do tend to break off, if the cable moves too much/often (due to metal fatigue, and the solder wicking up the signal wire making it stiffer, forming a weak point immediately after the stiff part because that tends to flex most when the cable moves).

Or you could do separate connector PCBs, that connect to the main switching PCB via a ribbon cable or male-female headers, or even directly soldered.

Note that for the schematics in this thread, I've used the free online EasyEda editor.
 
The following users thanked this post: analogix

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7483
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #76 on: December 14, 2024, 07:55:44 am »
I've been told here that the way I've drawn these schematics is too ugly to publish, so I will not be doing anything further on this.

I hope those members will help you further on this, as the way I've done is apparently too horrible to show in public.  I wouldn't hold my breath, though.
 

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #77 on: December 17, 2024, 07:38:04 pm »
The difference is the same as between memorizing and understanding a text book on something.  The former gets you past the tests, but doesn't enable you to create anything new.  And I only help, because I want others to create something new better than before.

Well said, and I agree  :-+
I've definitely learnt a lot of new things from this thread; many things which I think I can apply to my next project (output selector boards for the Atari STe cartridge port, serial port and ACSI port -the knowledge about multiplexers and the ability to enable/disable them is key here).

I keep re-reading your posts because many of these concepts are new to me, and all that information is overwhelming, but taking it slow and repeating helps. The good thing is that I'm starting to understand several things now which were totally incomprehensible a few weeks back  :)
You've been very good at explaining things, but a lot of concepts still take time to "get", then again that's just the way it is.
So now I'm left with a multitude of choices....

Initially I decided to go for the 4x TS5V330 solution (as in my schematic in post #72) because it's based on a tried and working design (Ubeswitch), it's clear and understandable even by me, and it should do what it's supposed to. It's even got 3 unused MUX switches which I will put to good use as LED indicators which also aid in troubleshooting in case it won't work as intended.

But..... I'm open for changes, if it's for the better, and in post #57 you wrote (red colouring of text is by me):

Quote
For your switched model, having different enable states would be simplest.  For example, two SN74AHCT1G126DBVR and two SN74AHCT1G125DBVR would suffice for the sync signals for the VGA and DIN connectors, using only the Atari output active-low enable signal from the slide switch.  The '1G126 outputs would go to the DIN connector, and the '1G125 to the VGA connector. These are in SOT23, and thus small but not too small to hand-solder.  (There are also AHCT2G125 and AHCT2G126 chips, having two inputs and two outputs each so you'd only need one chip of each, but see next paragraph.)

Because of the routing, having a tiny SOT23/SC-74/SOT753 chip (or two) per sync signal per connector makes routing much easier compared to using a single larger chip where you need to bring both sync signals to.  This is particularly true on the 13-pin DIN connector, where the sync signals are basically on different sides, bracketing the analog video signals, making routing them as a pair a bit difficult.  (Because Vsync is very low frequency signal, you can route that one through almost any convoluted path you like ending up near hsync, without any ill effects, so it isn't a real issue, though.)

Would it make any user-visible difference?  No, I don't think so.

Apart from easier routing I think I also read somewhere (in one of the multiplexer datasheets?) that it's critical to place the sync signal traces correctly on the PCB. I may not have understood it correctly, but was under the impression that routing the sync signals (or one of them) should be done in a specific way as to not cause intereference or signal loss. If using separate chips for sync means less chance of problems I'm all for that.

UPDATE: I found the source (or one of them at least). It's from the TMUX1104 multiplexer datasheet, where on page 25 talks about design guidelines (see attachement below). Are these applicable for my use when working with video signals?


I also finally understood that your suggestions include an "all in one" solution for the buffering the sync signals and simultaneously be able to switch them (i.e. a buffer chip with an enable pin).
I see that in my latest schematic (post #72) I've added two 74AHCT1G126 chips, but following your comments there are better solutions which include Schmitt triggering, so I should replace those anyway.
But I have a question: in my schematic those '1G126 buffers are attached after the TS5V330 multiplexer which means I will already have a MUX-switch resistance before buffering. Will this degrade the signal, or doesn't it matter since the buffer chip "regenerates" the signal again anyway?
On the other hand, if I go for one of the buffers you suggested which have a Schmitt trigger AND an enable pin, that means bypassing the resistance of the multiplexer, and still being able to control the sync signal passing through it. I didn't find any information in their datasheets about the Ron value (multiplexer switch resistance), so does it mean they act differently from a multiplexer and don't incur any added resistance?
 
Quote
Can I connect the +5V directly from the power supply to this board, or do I need some current limiting resistors or something first?
I think a polyfuse, or Polymeric Positive Temperature Coefficient (PPTC) device on the input, would be a good idea.  Something like a 50mA/150mA one, perhaps a Yageo SMD1206B005TF.

Good idea!
So in case there's an electrical problem with my circuit (i.e. short circuit) the PPTC fuse will blow, giving me a chance to troubleshoot before it damages everything on the vidoe output board (and possibly also causing the power supply's own fuse to blow)?
I suppose it's important to first measure the current draw of the board when fully assembled, in order to choose the PPTC fuse's suitable tripping current?

Quote
I know others (jepSTone.net) have used Mean Well RPD-60A for Atari STe supply.
I personally might consider using a RPS-30-15 linearly regulated to 12V, and a RPS-45-7.5 linearly regulated to 5V, although I do admit it is overkill; and some kind of aluminium heatsink would definitely be needed for the regulators.  I just like the idea of very low noise, very stable power rails...

Thanks for the link. Hadn't seen that one yet.
I see that there are several power supply replacement options available, and fortunately I'm not limited by its physical size as most other Atari ST owners are since I won't be fitting it inside the original Atari STe enclosure, but a 19" rack.
This Atari I'm working on will not only have this video output board added to it, but also several other hardware add-ons, so I suppose in the end I need to figure out how much current everything draws and then choose a replacement power supply based on that.
« Last Edit: December 19, 2024, 11:09:03 pm by analogix »
 

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #78 on: January 10, 2025, 05:40:07 pm »
NOTE: I'm the OP and had a related question to this project which I posted here: Computer/online tool for simulating logic signals?
Since I received a reply directly pointing back to the subject discussed here I've decided to post the reply below:



But one thing still puzzles me regarding the logic control signals.
I've read about the basics of logic gates, and while the 74AHC86 (U7) is an XOR gate, couldn't I just use a NOT gate instead (to invert the "enable" signals between the Atari and VGA multiplexers)?

Yes.

Thanks for confirming. I found the SN74LVC1G14DBVR (single inverter with Schmitt trigger) to be suitable for this.
I've added it to my schematic (see attachement below) with the appropriate changes (replacing the 74AHCT126 buffers with 74AHCT125 with new connections for enabling them with the opposite logic level as before).

I've also added the Mono_Detect line to the slide switch (which I've also replaced in the schematic with the actual DP3T switch I'm thinking about ordering) in order to set the computer to the correct display output mode (monochrome or colour) with it forced to LOW (GND) for VGA-mono output and passed it along to the new DIN13 connector for Atari output (where the Atari colour or Atari monochrome monitor attached handles connecting Mono_Detect to GND (Atari mono monitor) or leaving it unattached (Atari colour monitor) internally inside those monitors).

Finally I've also added 3 LEDs (one for each switch setting) by using the HIGH and LOW signals unique to each display setting and attaching each LED's polarity appropriately to that, through a current limiting resistor. I hope I got it right.

Oh, I've also added pullup resistors for the multiplexer and buffer chips as suggested in their datasheets, and 0.1uF bypass capacitors for all ICs. I'm at loss for the values of the pullup resistors though -the datasheets don't give an exact value for this. Suggestions anyone?

2480791-0

2480795-1

Pulldown resistors have also been added to the unused U1 and U2 multiplexer (TS5V330C) output pins through 50 Ohm resistors as suggested here (Texas Instruments multiplexer forum: [FAQ] What to do with Unused Pins & Exposed Thermal Pads?).

2482145-2

2482149-3



Quote
Quote
In the current schematic, the VGA side uses 74AHCT126 buffers (which are the same as the Atari side's 74AHCT125 buffers, except they get enabled with the opposite logic signal).
So with a NOT gate, why not just use 74AHCT125 buffers there as well, having its "enable" pins connected to the VGA multiplexer's (U1) enable pin? Or is there something I've missed, and there's a specific reason the XOR gate is chosen as an inverter?

Yes, you could have U5, U6, U3 and U4 all be the same type of buffer (either '125s or '126s) and drive them with the appropriate logic signal. This could simplify your bill of materials.

Yes, I was looking for simplifying and lowering the cost of my BOM.
Plus, as a beginner, challenging myself to properly understanding the design (which I've received a lot of help in this thread for) and making new decisions based on that info  :)




Quote
There are other "bus transceiver" chips which also might work for U3 - U6, such as the '244:

https://www.ti.com/product/SN74HCT244

Or even possibly use additional TS5V330PWR's in place of the '125s and '126s.

Thanks for the suggestion on the 'HCT244. So these essentially improve the signals passing through, similar to buffer chips?

If I remember correctly I had initially decided on adding another TS5V330 to each of the two outputs, but was (in post #57) suggested that I use one of those smaller chips for more flexibility in terms of placement/routing. And with an additional TS5V330 I'd need to add extra ICs after the switching for buffering, wouldn't I? As far as I can see the TS5V330 doesn't have built-in buffering (the TS5V522C however, which I also considered, has 5 SPDT switches (unlike the 4 of the TS5V330) and two of them have built-in buffering for HSYNC and VSYNC signals).
As for the 74AHCT125 I also thought it was pretty cool that they included an "enable" feature, so it would work both as a buffer and a multiplexer.


Quote
Note that the schematic uses single gate versions of the '125 and '126, but you can get four of these buffers on a single chip which might work for this application:

https://www.ti.com/lit/ds/symlink/sn74hct125.pdf

It's all a matter of balancing cost, availability, board space, routing, etc.

The two-buffer version (74AHCT2G125) had been suggested to me earlier (post #51), and later suggested that I go with the single-buffer version (post #57) because that would make routing easier, particularly around the DIN13 Atari output connector.
That SN74HCT125 (4-buffer) chip you mention is pretty cool. I wasn't aware of it, but will keep it in mind for similar projects! Thanks for letting me know about it.

Later (post #70) it was suggested that I got for a version of those chips having Schmitt triggering which is why I've now used four pcs. 74LVC1G125DCKR (actually Nominal Animal suggested 74LVC1G125DBVR, but I think I landed upon the "DCKR" because of pricing, or I just didn't search well enough -I'll look into that before ordering the components).

Update: I've now used 4x Texas Instruments SN74LVC1G125DBVR in my schematic (U20, U22, U10, U11) as suggested earlier by Nominal Animal. I think that version is a little physically bigger and less challenging to hand-solder.
Update 2: I'm a little confused about that particular chip (from Texas Instruments) because the datasheet mentions nothing about it having Schmitt triggering, and shouldn't there also be TTL compatibility? I might just use the Nexperia 74LVC1G125GV (also suggested by Nominal Animal, as another alternative) instead, because, according to its datasheet, has both TTL compatibility and Schmitt triggering. 

« Last Edit: January 13, 2025, 06:58:38 pm by analogix »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf