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

0 Members and 1 Guest are viewing this topic.

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #50 on: October 18, 2024, 10:28:48 pm »
I tried to find out more and came across this thread where several people warn against using it.
And if I understand correctly, someone also pointed out that pins 12 and 15 (data and clock) are needed for Plug 'n play, which I suspect is part of this.
With a current limiting 100ohm series resistor, it is safe even if you accidentally short the pin to GND on the other side.  (A short would draw 50ma)

So nothing to worry about, and every reason to keep it attached (through a 100 Ohm resistor)?
(unlike the poster in that forum who wrote "There's no known benefit for the presence of pin 9". He blew up several GND traces in his expensive computer due to +5V coming from pin 9 in the monitor and pin 9 in the computer connected to GND, and there was no current limiting resistor for some reason.

By the way, here's an update to my schematic.
It now contains 75 Ohm resistors for the R,G, B lines as well as trimmers for the monochrome R, G and B lines so that a colour tint can be adjusted (the normal Atari ST high resolution monochrome output is a paper-white background, but here it can adjusted to old-school green or whatever). I'm unsure of the trimmer values because like with the colour signals I assume the levels should be lowered here as well.
I've also added a power connector and jumper for choosing the +12V power pin from the video output connector to power up the 78L05 regulator, or +5V directly from the computer's power supply. There's also a jumper for disconnecting the +12V line to the regulator so it doesn't draw any power at all.
Finally there's a power connector for outputting audio and composite video.
Any obvious mistakes so far?
« Last Edit: October 18, 2024, 10:38:46 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #51 on: October 19, 2024, 11:15:57 am »
Will the TS5V522 behave differently on this than the TS5V330?
Looking at the Uberswitch schematics, all signals except H-sync and V-sync pass through the TS5V330 switches, and from what I've read in various Atari forums people seem very happy with the Uberswitch VGA adapter
No, you're right, and my worry misplaced: it will work.  I forgot about the Ubeswitch!

Quote
Why do you believe using a single IC for switching the entire set of signals is better than two or more ICs?
Stuck in old thinking I guess, and looking into all possibilities, but also considering the physical size as Eagle (free version) has board size limitations.
Then again I'm probably making a bigger issue of this than needed since these parts are quite small already, and there aren't really that many components in all.
That's why I asked.  If you make a four-layer board so that you can do signal-GND-signal-GND stack for the analog video signals, with track width and spacing calculated to give about 75Ω impedance for R, G, B and about 27Ω for monochrome –– track width and spacing then being the same on the two signal layers ––, the needed crossings won't be a problem, and I think I'd target the 100mm × 80mm PCB size, although a much smaller one should definitely suffice.  With separate SMD muxes/switches/amplifiers, the layer pair opposite the switch can be used to "jump" the signal order nicely, which makes it so much easier to route these signals with separate switches than single large switches.  Try it, and you'll see what I mean.  (If the track width and spacing to surrounding GND is suitable, then having the track "extra long" is not an issue at all.  At 140 MHz, the wavelength in copper is about 1.4 meters, so a few centimeters difference in track lengths will not affect the video signals at all.

(KiCad calculator says: If you use 0.203mm or 10mil wide traces, with 0.708mm or about 28mil distance to a ground guard trace on the same plane, with ground plane under both on the next plane –– on planes 1,2 or 3,4, but on planes 2 and 3 because the core is in between and is thicker), you get a coplanar wave guide with pretty much exactly 75Ω impedance.  For the monochrome video signal, 0.914mm or about 36mil wide trace with 0.6mm or about 24mil distance to ground guard trace will give you pretty much exactly 27Ω impedance.  While these do depend on the stackup, and you should check these values against the PCB stackup you do, they are a good starting point.)

I particularly like Hammond cast-aluminium enclosures, and would target 1590BB for this.  The maximum inner volume is 110mm × 84mm × 34mm, but with 5mm × 5mm cut-outs at each of the four corners.  (Basically, 100mm × 84mm × 34mm maximum inner volume.)  I like the plain cast aluminium ones, and sanding the surface with 400 grit for a very nice brushed effect, but these are also available in various colors.  The connectors I would put on one long edge, first drilling round holes, and then filing them to right shape by hand.  For cast aluminium, you can use woodworking files, but metal files give you a better finish.  Needle files are good for finishing touches, but not for shaping the holes; it'd take too long.  A rotary hand tool like Dremel with burr bits do short work of the hole shaping, but do wear eye protection.  For me, the preferred shape would have the switch (a lever one) on the opposite long edge, with the indicator LEDs poking through.  That way I could stack it.

I believe I would connect the enclosure to the ground, but would verify with other members here first.  My thinking is that since the ground is common to all connectors, and we do not have any external power sources, it is the best option wrt. shielding and ESD.  I suspect sprinkling ESD diodes for the signal lines for all four connectors might be a good idea, too, but it is not something I'm at all familiar with.

Aha! This was something I was wondering about (but afraid to ask)...
So R,G,B and monochrome are analog while the two sync lines are digital?
How about mono-detect?
Right!  :-+

R, G, B and monochrome are analog, with signal voltage varying between 0V and 1V (1 Vpp, or one volt peak-to-peak).  The impedance to ground of these signals is 75Ω for R, G, B, and 27Ω for monochrome.

Hsync and Vsync are 5V TTL digital signals, maximum frequency only about 36 kHz (Hsync at mono).  When the voltage is between 0V and 0.8V, it is logic low; anything above 2V is logic high.  Sync polarity does not refer to voltage polarity, but to whether the signal idles low and pulses high (positive polarity), or idles high and pulses low (negative polarity).  Basically, any TTL logic ICs can handle these.

Mono detect, or Select, is an open collector input, pulled to 5V using a 4.7k resistor (R472) within the Atari STe.  It controls the 74S257N digital selector (U405), with 5V TTL logic.  It is basically DC, as any edge on it causes the STe to reset.  You only need to connect it to the Atari STe output, let it flap in the wind for VGA color, and connect it to ground (directly) for VGA mono.  Again, any 5V TTL logic mux/switch/buffer will work for this.  If you use an analog or digital switch for this, something like 60Ω to 100Ω on-state resistance is not a problem, because it will simply be in series with the 4.7k pull-up resistor.

I selected the components for my schematic by looking at Mouser catalog, sorting options cheapest first, and then rejecting any that I wouldn't want to hand-solder.  (I avoid QFN and don't do BGA yet, myself, even though I have a tiny hot plate and hot air; need to do some practice boards first.)

Quote
I wish I could explain this better... or that some of the more experienced members would step in and explain it better than I can!
Nothing wrong with your explanations. In fact they're very detailed and well worded!
No, all this stuff could be explained much more concisely by other members here.  I read and write fast, but spend quite a lot of effort in trying to find a good wording, so it often appears I'm more knowledgeable than I am.  Plus, I'm overly verbose: my posts are too long for many to read.

But I have to plea ignorance on a lot of these concepts, struggling to follow and trying to learn as we go along. I admit not having a fundemental understanding of how your schematic works -if it's similar to mine, or does things a totally different way.
Even though it makes this post yet another wall of text, let me walk you through.  Here is the schematic in scalable vector form, so you can open it in another browser window, and zoom in without it becoming blurry:

(Click to embiggen; CC0-1.0 / Public Domain)

Note: Blue indicates analog video signals (0V - 1V); green digital 5V TTL signals; and cyan analog/digital signals connected directly between the two 13-pin DIN connectors (and composite video female RCA connector).

On the left, CN1 is the input Atari 13-pin DIN connector.  Because this uses amplifiers with high input impedance, we need to terminate the input signals with resistors to ground.  The exact reasons for this go into transmission line model, but as hobbyists, all we need to know is that this way any signal distortion and such is minimised.  In general terms, this schematic is a retransmitter between two different transmission lines.

If we used only multiplexers and switches, our circuit would be part of a single transmission line, and minimizing its impedance would minimize the effect on the transmitted signals.  In the displays, there are 75Ω resistors to ground (for R, G, B; 27Ω to ground for the monochrome video signal), and any added resistance on the analog video signals acts like a voltage divider, reducing the voltage amplitude at the display end.  For example, a 3Ω switch will cause a gain of 75Ω/(75Ω+3Ω) ≃ 0.96, or voltage swing reduction by 4%.  It might slightly reduce the default brightness, but should still be well within normal adjustment range.

Similarly, the resistors R5-R8, R9-R11, R12-R14 are the transmitter series resistors that need to match the expected transmission line impedance.  I'm not exactly sure about monochrome video (R8, ATARI_MONO); I think it should be 27Ω, since that is what Atari STe video output circuit has too.

U1, U2, U3 are the video amplifiers.  They have high input impedance, and low output impedance, like most amplifiers.  Essentially, whatever happens downstream from the amplifier (to the right of the amplifier), will not affect upstream (to the left of the amplifier).  The BYPASS pins are connected to the 5V supply voltage to use the full 150 MHz signal bandwidth, and the 100nF supply bypass capacitor makes sure the amplifier has local "charge reservoir".  As Dave showed in one EEVblog video, these supply bypass capacitors may not be always needed, but having them there ensures ICs work better; even the pros tend to experiment and measure in practice to see what they can get away with, so for us hobbyists, it makes sense to just use them even if not strictly necessary.

Considering the input terminator resistors and the transmitter series resistors, each video amplifier works like an analog switch, except with minimal load or effect on the input signal.  When enabled, the amplifier looks like a 800kΩ resistor to ground to the source for its inputs, as if it was in parallel with the input terminator resistors –– thus affecting that termination by 0.008Ω or so.  When disabled, the amplifier looks like a 20kΩ resistor to ground to the source of its inputs, thus affecting the 75Ω input termination by about 0.28Ω or so.  Note that this is on the "ground leg" of the effective voltage divisor, and so increases rather than decreases the voltage swing.

(Amplifiers aren't perfect, and they add noise and have limited bandwidth.  In this case, we know we need less than 140 MHz of bandwidth.  THS7374 with bypass enabled have 150 MHz, and less noise and better supply noise rejection than can be resolved using 8 bits, according to the datasheet.  Without testing them with the actual video source, to me those numbers are sufficient –– if one trusts them! –– to assume it should work well, because I know I've been very happy with 8-bit analog VGA signals using 17" multisync monitor at 1024×768 85Hz using #9 GXE and Matrox G200 video cards, doing actual paid Adobe Photoshop work just before the turn of the millenium.  Mac would have been more suitable, but I was mostly running Linux (with the G200), and only used Windows for paid Photoshop and Macromedia Director work.)

U6 and U7, TS5A3159 analog switches, were just a cheap option to connect the Mono detect AKA Select line to the DIN-13 output, ground, or not connect it to anywhere at all.  (Again, this is an open collector output, pulled to +5V through a 4.7kΩ resistor.)  I picked these only because Mouser sells them for 0.33€ apiece in lots of ten, and as SPDT switch in SOT23-6, they are easy to use here.  There are literally hundreds of options here, and I just picked a cheap and easy way!  Well, I was also swayed because I think those switches could come in handy for other circuits as well.

U4 and U5 are the buffer/selector/mux chips for the sync signals.  Note that because we only have two connectors, two pairs of sync signals, we only need two of these.  In fact, we only need a single DPDT (two signals) switch, if we use /ATARI as the selector.  That way, the sync signals are connected to the output DIN-13 when Atari output is selected, and to the VGA connector in the other two modes.

Why 74LVC2G241?  I admit, I was lazy. :-[  A 74AHCT2G125 and a 74AHCT2G126 would be a better choice here (74AHCT2G125DP,125 and 74AHCT2G126DC,125 from Mouser): a TTL-level dual SPST switch with active-low/active-high enable.  As these are digital buffers/drivers, they act like amplifiers in that the input is not affected by whatever happens on the outputs; just for digital signals.  Could we use say TS5A3159 instead?  Yes, we could.

The slide switch connects one of /ATARI, /VGACOLOR, and /VGAMONO to ground.  (The / at the beginning, the overline over the name, and a hash mark at the end, are all different ways to note the same thing: that this signal is active-low.)  The 10k resistors R15, R16, R17 pull them to +5V when not selected.  (When selected, there will be about 5V/10000Ω = 0.0005A = 0.5mA "wasted" in the resistor, turning 2.5mW or 1/400th of a watt into waste heat.)

The indicator LED current will flow through the current-limiting resistor, and the switch, to ground.  I wondered whether to use the other side of the two-pole three-throw switch, but this way, if the active-low enable line loses connection to ground, the LED won't light either; and 3-4mA at 5V should not be a problem even for a lightweight or small switch.  The ICs only draw a small fraction of a milliamp each.

The extra 100nF capacitor before the 100Ω resistor between 5V and pin 9 of the VGA connector just stabilizes the pin 9 voltage a bit; it forms a basic 16 kHz low-pass RC filter here, and would make sure the voltage the display sees on that pin is stable.  It is utterly "gilding the lily", as Dave would say; feel free to omit it.  As BrianHG explained, even if pin 9 is connected to ground in the cable or display, it will only draw 5V/100Ω = 50mA, and generate 0.25W = 250mW = 1/4 watt of waste heat.  So, I would suggest making this a through-hole resistor.  And crap, I actually put the capacitor on the wrong side of the resistor, too; it needs to be after the resistor...  I better just delete the capacitor, to be honest.

So, to recap:

The incoming red, green, and blue analog video signals are terminated to ground through 75Ω resistors R1-R3, as close as possible to the incoming 13-pin DIN connector.  The monochrome video is terminated similarly using a 27Ω resistor R4.  This is because the input is an end of a transmission line, unlike if we used just analog switches (which would then form part of the transmission line).

Analog video signals go to the inputs of the three video amplifiers U1, U2, U3.  As they start a new transmission line, there are 75Ω resistors R5-R7 and R9-R11 in series with the red, green, and blue signals; and a 27Ω resistor R8 (shown as 75Ω in the schematic) on the monochrome video signal.

Amplifier U2 and U3 outputs are commoned to the VGA connector, so only one of them should be "on" at the same time.  I added the resistors before the commoning, so that in the case both amplifiers get enabled at the same time, they'll fight through 75Ω+75Ω = 150Ω series resistance –– think of one trying to drive the output low while the other drives it high) –– which should allow them both to survive without damage.  If I used only one set of resistors, only the amplifiers internal circuits would limit the current; I don't think they'd survive that.  So, I am using extra three resistors to deal with the case where both /VGAMONO and /VGACOLOR manage to be low at the same time.  Shouldn't happen, but hey, it's just three extra resistors.

Note how amplifier U2 takes the monochrome video signal for each of the three inputs, and amplifies them separately into VGA red, green, and blue.  This way, the monochrome video input is not at all affected by the "copying" into red, green, and blue.  Indeed, if your Atari and VGA displays share a common ground (so there is no voltage difference between their grounds, and they can be connected at the same time to this circuit), there is no reason why you couldn't enable both Atari and VGA outputs at the same time.  There is no signal degradation, due to the amplifiers used.

For the sync signals, U4 and U5 buffer them, and output (only) to the currently selected connector, using /ATARI to decide.  When /ATARI is low, the DIN-13 output is used, otherwise the VGA output is used.

If I missed anything, just say so, and I'll try to explain better.  (I write these posts in the hopes that they help others learn –– not just you, but anyone who discovers this thread say via a web search.  I'm not interested in giving answers on a platter, which is why my suggested schematics typically require modifications to suit the use case.  Plus, I err/fail often.)

(Technically, we could use a 12V isolated DC-DC converter to supply 7-12V regulated down to 5V to the isolated VGA side, a TI ISO7720 for the sync signals and a 74HCT2G125 for output buffer/driver, three NJM2505A isolated video amplifiers and a THS7373/7374 video amplifier, to provide a completely isolated VGA output.  The added BOM cost is less than 10€ from Mouser in singles.  It would allow connecting both VGA and DIN-13 outputs at the same time, safely, even if the two do not have a common ground or their GND potentials differ by a couple of hundred volts.  They could also be enabled at the same time without affecting each other –– except for the Select on the DIN-13, of course.  Note that other members here have "berated" me for over-use of isolators, though.  It's just that I often encounter ground loops, in the form of GND/0V on different devices having different potentials, because they use non-grounded power supplies; often cheap wall warts.)
« Last Edit: October 19, 2024, 11:50:23 am by Nominal Animal »
 
The following users thanked this post: analogix

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #52 on: October 19, 2024, 11:36:00 am »
It now contains 75 Ohm resistors for the R,G, B lines
You don't use resistors when you use analog switches; they are only used to terminate one transmission line (input to ground via resistors), and in series with the signal after an amplifier to start a new transmission line.

With analog switches, your switching circuit is part of the transmission line, and should not have any resistors in series nor to ground.

I've also added a power connector and jumper for choosing the +12V power pin from the video output connector to power up the 78L05 regulator, or +5V directly from the computer's power supply.
If you use a diode (with anode to the +12V supply, and cathode to the regulator input) for each +12V supply, it will automatically draw current from whichever supply has the highest voltage.

There are also "ideal diode" circuits like LM66100 (single), LM66200 (dual), MAX40200 (single), that are limited to 5.5V maximum, but have very small voltage drop (something like less than 0.09V drop at 5V even at 100mA currents), that you can use with the 5V similar to ordinary diodes.
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #53 on: October 19, 2024, 01:34:54 pm »
Will the TS5V522 behave differently on this than the TS5V330?
Looking at the Uberswitch schematics, all signals except H-sync and V-sync pass through the TS5V330 switches, and from what I've read in various Atari forums people seem very happy with the Uberswitch VGA adapter
No, you're right, and my worry misplaced: it will work.  I forgot about the Ubeswitch!

That's great news!


Quote
I particularly like Hammond cast-aluminium enclosures, and would target 1590BB for this.

That's a good suggestion, and certainly something I can keep in mind for other projects.
But here I'm placing the entire Atari STe inside a 19" metal rack enclosure. The VGA output board will be one of many hardware enhancements to this computer.

I'm envision the VGA output PCB placed on the rear panel with holes drilled for the two output connectors (HD-15 and DIN-13) as well as the 3-way slide switch. The HD-15 connector already has two screws for mounting through such an opening, but something like a few small 90 degree metal brackets for fastening the PCB to the rear panel will help make it stable and handle whenever a DIN-13 plug is inserted and the switch used.

On the opposite end of the PCB will be internal connectors: for attaching to the Atari video output, power connector option, composite/audio output etc.


Quote
Quote
I wish I could explain this better... or that some of the more experienced members would step in and explain it better than I can!
Nothing wrong with your explanations. In fact they're very detailed and well worded!
No, all this stuff could be explained much more concisely by other members here.  I read and write fast, but spend quite a lot of effort in trying to find a good wording, so it often appears I'm more knowledgeable than I am.  Plus, I'm overly verbose: my posts are too long for many to read.

Hehe..... I can only say the same for myself, though I try to get to the point with fewer words  ;D
Don't sell yourself short -I can see that you are very knowledgable, and I've learnt a lot from you've posted  :)


Quote
Even though it makes this post yet another wall of text, let me walk you through.

Super! I appreciate this. And having a scaleable image of the schematic is a great idea I wouldn't have thought of.
Give me a little time and I'll get back here with hopefully a better understanding of it.
« Last Edit: October 19, 2024, 03:31:45 pm by analogix »
 

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #54 on: October 29, 2024, 09:17:27 pm »
OK, I'm back  ;)
I've studied your schematic and comments as well as looked more into the details of my existing schematic and Ubeswitch.
There's a lot of new things to take in, and a lot is over my head, so I'd like to keep it simple if I can.
Ubeswitch already works for other Atari users, isn't too complicated, so I want to see if I can get my existing schematic to do the job.

So.... in theory at least it looks like my schematic will work. I'm trying to catch up on the 75 Ohm impedance thing, which is kind of confusing as different sources say different things. Like, in the Ubeswitch there aren't any resistors at all to balance out the impedance, likewise in this Building a KVM article, which is based upon two TS5V330 chips (like in the Ubeswitch), while other sources say it's something that can be done to improve the signal, but in many cases it doesn't make any practical difference.

On another note: I'd like to work out how to generate the needed high/low signals so I can get away with using a simple 3-way slide switch (not needing one with many poles). Is this what the 74LVC2G241 (U4 and U5) in your circuit does?
Here are the signals I need for each of the 3 modes:


Note: for the U1 and U11 "SEL" (select) signals, these will be permanently connected to GND (logic LOW), so these two pins will just be hard-wired to GND.
« Last Edit: October 29, 2024, 09:20:54 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #55 on: October 30, 2024, 05:03:32 pm »
Oo boy, another wall of text incoming.  Sincire apologies to everyone annoyed by this!

Ubeswitch already works for other Atari users, isn't too complicated, so I want to see if I can get my existing schematic to do the job.
Right; I fully trust you regarding your needs, definitely over my own suggestions!  ;D

So.... in theory at least it looks like my schematic will work.
If you omitted the series resistors R1, R2, R3, and possibly the tint pots R4, R5, R6, I definitely agree it should work.

I'm trying to catch up on the 75 Ohm impedance thing, which is kind of confusing as different sources say different things.
The key is that when you use switches, you only convey the signal like a plain cable would, so no series or terminating resistors are used; and you want to keep the switch/multiplexer on-state resistances as low as possible.

When you use amplifiers, you terminate the incoming signal with suitable resistors to ground, so that the signal input to the amplifiers will have no artefacts like signal reflections.  The video amplifiers I showed have a fixed gain of 2, so they need series resistance equivalent to the terminating resistance (at the display device), to get the correct voltage amplitude.

You can even see this in the Atari STe schematic: it itself uses 2N3904 transistors (Q400, Q401, Q402, Q403) with series resistors as video amplifiers!

Mathematically, as the simplest possible approximation, the signal input in the display device after an amplifier is G·V·Rt/(Rs+Rc+Rt), where G=2 is the gain in the amplifier, V is the instantaneous voltage on the amplifier inputs, Rt=75Ω is the termination resistance in the display device, Rs is the series resistance immediately after the amplifier, and Rc are the losses in the cable (including any switches).  Because of G=2 with these video amplifiers (with most video amplifiers you can find!), we want the ratio of the resistances to be 0.5, so that the signal level in the receiver is the same as the signal level on the input to the amplifier.  The losses in the cabling are so low that we can basically ignore them (Rc ≃ 0), and in real life we cannot really estimate them because it varies from cable to cable anyway and the condition of the connectors.  So, we're left with 75Ω/(Rs + 75Ω) = 0.5, which gives us the series resistance we need, Rs=75Ω.

(The proper mathematical model for this is the transmission line (where G is conductance instead of gain), however.  It turns out that if we assume short typical video cables, we get basically the same answer as above to within 10% or so, which was the precision used above anyway.)

My own reasoning from going from switches/muxes into amplifiers is simple: the amplifiers are cheaper (yes!) at Mouser, it is easier to get best possible fidelity with video amplifiers compared to passive switches and muxes, and the series resistors can be replaced with variable resistors for signal amplitude and monochrome tint adjustment – even though I left them out for simplicity.  That's it; no magic involved.

Like, in the Ubeswitch there aren't any resistors at all to balance out the impedance
That is because it uses switches/multiplexers instead of amplifiers, and thus needs to minimize the on-state resistance.

other sources say it's something that can be done to improve the signal, but in many cases it doesn't make any practical difference.
Yes.  This is because small attenuation in the video signals is not a problem; the 0.7V peak-to-peak is not exact, and only affects the default brightness in the display device.  Some even have automatic gain control, normalizing the brightness before any adjustments, in which case say 10% voltage "error" is utterly invisible to us humans.

Atari STe video bandwidth is also narrow compared to current analog video (like 720p and 1080p HD) that currently available video amplifiers and switches/muxes target.  This means neither switches/muxes or amplifiers will "soften" crisp edges.

The noise added to the video signals by these switches/muxes and amplifiers is tiny, well below 42dB (that corresponds to 8 bits per component, or 256 levels of intensity), so neither will add any human-visible noise/speckling/degradation to the image either.

Thus, for us humans, there should be no difference in the displayed video, be it manipulated by analog switches/muxes or video amplifiers on the way, as long as both are implemented correctly.  (In your latest schematic, the resistors R1-R6 are problematic, as they would reduce the signal amplitude; similar to having a very poor cable made from aluminium wires or something.  Depending on your display device, you might have to crank up the brightness to its maximum to get a good image, for example.)

On another note: I'd like to work out how to generate the needed high/low signals so I can get away with using a simple 3-way slide switch (not needing one with many poles). Is this what the 74LVC2G241 (U4 and U5) in your circuit does?
No, the '2G241 (in reply #42 and #51) buffer the digital sync signals.

It turned out that if the three video switches/amplifiers have the same enable state, and there are two switches or buffers for the the sync signals with opposite enable states (one active low, one active high), no logic is needed, and the slide switch can be used directly.

Here are the signals I need for each of the 3 modes:

(Click to embiggen)
Let's say you use a similar circuit with the slide switch as in my reply #42: the wiper is connected to ground, with the three outputs are connected to pull-up resistors to 5V.  This way, the selected output is LOW, and the two other outputs are HIGH, and one pole slide switch (SP3T, or one side of DP3T) suffices.

U1/U11 Enable and U2/U22 Select are connected to the respective slide switch outputs (making the "Any" state LOW).

For U2/U22 enable, you need a 5V logic inverter (NOT, or XOR with other input connected to GND, for example) from the U1/U11 Enable signal.  (An analog SPDT switch or multiplexer can also be used as an inverter, by just connecting the inputs to GND and 5V, and using the U1/U11 Enable signal as the selector.)  We have LOTS of options for this.

I like the SOT23/SC-74 footprint for hand-soldering, as it is small enough but not too small to solder by hand.  Looking at Mouser catalog, we have some 34 options in stock (in SOT23/SC-74 at 5V).  The cheapest one is SN74ACH1G86DBVR (PDF datasheet) at 0.10€ apiece in singles.  Pin 1 is connected to the U1/U11 Enable signal, pins 2 and 3 to ground, pin 4 to U2/U22 enable, and pin 5 to 5V.  Because it is a XOR gate, and B is always at GND, pin 4 Y = not A (pin 1), the inverted state we need.  If the distance from pin 5 to a capacitor between 5V and ground is longer than a couple of centimeters or an inch, I'd add a 100nF X7R capacitor between 5V and GND close to the SN74AHC1G86: it will almost certainly work absolutely fine without it, but it is what the datasheet and common practice suggests.

What I recommend, is having a strip of 100 in 0806 (bigger) or 0603 (smaller) X7R 100nF = 0.1µF capacitors at hand.  At Mouser, 100 Samsung CL10B104JB8NNND's in 0603 costs 1.60€ total, and 100 Samsung CL21B104KBCNFNC 's in 0805 1€ total.  The smaller ones are harder to solder –– to keep in place while you solder them, actually, being so tiny; without excellent tweezers they tend to ping and vanish when you grab them, never to be seen again –– but useful when working on a small board, so I tend to have both.  I'm actually looking for low-durometer silicone I could dip the end of some wooden barbecue sticks for holding these buggers in place!  Always having the pads for these bypass capacitors is easy, even if not strictly required for the particular application.  You can always just leave them unpopulated afterwards.  Bodging them in without a footprint is much more annoying; and finding out the problem is lack of supply bypass capacitor for some IC is absolutely infuriatingly difficult: you end up finding out it was the problem basically after trying everything else first and fixing it by adding the capacitor to see if it was the issue.)

For the same reason, instead of the SN74ACH1G86DBVR XOR gate, you might instead use a SN74LVC1G97 configurable multifunction gate, so that you can get a few dozen of them, and have in stock for other use cases.  Mouser sells SN74LVC1G97DBVR for 1.29€ for ten.  The idea with these is that they have three inputs, one or two of which you connect to GND or VCC to select the configuration you need.  Figure 8 in the datasheet shows the inverter configuration: pin 1 is connected to the U1/U11 Enable signal, pins 2, 3, and 6 to ground, pin 4 to U2/U22 enable, and pin 5 to 5V.  So almost the same configuration as the XOR gate, except that the XOR gate has one less pins (its pin 5 corresponds to pin 6 in SN74LVC1G97; the connections to that and the new pin differs between these two).

'1G97, '1G57, and '1G58 are similar multifunction gates, but with different logic tables.  Any one of them could be used here instead.

One reason I like the SOT23/SC-74 footprint is that in an emergency or prototyping stage, I can solder wires directly to the legs, then cover them in heatshrink, to do a circuit modification without any PCB, i.e. "dead bug" it.  If you experiment with digital circuits, high-speed multifunction gates like SN74LVC1G97 are very useful when you find you need to combine some signals or invert some signal.  For the exact same reason, I keep SN74LVC1T45 voltage translators in SOT23 (Diodes 74LVC1T45W6-7 or TI SN74LVC1T45DBVR) in stock.
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #56 on: October 31, 2024, 10:16:15 pm »
If you omitted the series resistors R1, R2, R3, and possibly the tint pots R4, R5, R6, I definitely agree it should work.

All "Atari ST to VGA cable" pinouts include resistors on the R, G and B lines of the HD15 connector since the signal level is too high compared to a normal PC's output.
I made a slight change here, so I could have separate resistors for colour or mono modes (for adjusting the colour balance in mono mode).
Is this where you're saying there's a problem, or by having resistors for the R,G,B and monochrome outputs at all?

By the way, out of curiosity I measured the resistance between the R, G, B and monochrome pins to GND from the video output connector (DIN-13). The computer was off when measuring.

R to GND: 220 Ohms
G to GND: 220 Ohms
B to GND: 220 Ohms
MONOCHROME to GND: 127 Ohms



Quote
The key is that when you use switches, you only convey the signal like a plain cable would, so no series or terminating resistors are used; and you want to keep the switch/multiplexer on-state resistances as low as possible.

Aha! That sounds simple enough (like I like it!), and confirms my findings for the Ubeswitch and other Atari to VGA cable pinouts.
But I got confused again because this variation of the Ubeswitch has indeed got termination resistors. Could it be because this version also has a 74HCT14 for buffering the Hsync and Vsync signals? Attached is the schematic which is available from the project's PCBway page.


Regarding the buffer -I was told they're there to prevent the video circuitry in the computer from overloading. Which sounds like a good thing of course, so keeping it would be beneficial, right?
I previously mentioned the (5 channel) TS5V522 multiplexer as a possible replacement for the (4 channel) TS5V330 -the latter being used in my schematic, just as in the Ubeswitch and the Ubeswitch variation above. The TS5V522 datasheet says it has built-in buffering for the sync signals. In any case I need two of them for the whole set of 7 signals (4 MUX chips in total for the PCB) regardless of which MUX I use, but it has more pins (24) than the TS5V330 (16 pins) which would mean more PCB space. Do you think it would make any difference if I go with the addition of a 74HCT14 for this, or have it built-in with the TS5V522? (see an excerpt of the PCBway schematic below showing just the buffer chip. The complete schematic is attached at the end of this posting)
 


Quote
My own reasoning from going from switches/muxes into amplifiers is simple: the amplifiers are cheaper (yes!) at Mouser, it is easier to get best possible fidelity with video amplifiers compared to passive switches and muxes, and the series resistors can be replaced with variable resistors for signal amplitude and monochrome tint adjustment – even though I left them out for simplicity.  That's it; no magic involved.

Ah! I see.
That clears up a lot of confusion  :)
Good to hear that the MUX solution is something that I can go for (at least I understand how that works).

Thanks for the info on the logic switching circuitry.
I need to re-read it to understand it, and possibly draw a schematic before getting back to discuss it. One step at a time   :)
« Last Edit: October 31, 2024, 10:31:55 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #57 on: November 01, 2024, 04:20:47 am »
Edited to prefix: If anyone more experienced than just-hobbyist-myself finds an error in my posts or something that needs to be better explained, please point it out!  Me fail often, and such corrections are definitely appreciated.

If you omitted the series resistors R1, R2, R3, and possibly the tint pots R4, R5, R6, I definitely agree it should work.

All "Atari ST to VGA cable" pinouts include resistors on the R, G and B lines of the HD15 connector since the signal level is too high compared to a normal PC's output.
Right; this means that the signal amplitude on the Atari is too high, and must be attenuated by a series resistor for VGA.

I did not take this into account, because I have no knowledge of the actual voltage levels on the 13-pin DIN connector on the Atari (when terminated with 75Ω to GND).  I only know that for VGA, the red, green, and blue analog video signals should vary between 0V (minimum intensity) and 0.7V (maximum intensity).

Thus, I agree that "omitting" would be wrong too.  I still do not know the exact values or even the range of values needed for the series resistors, though.

Is this where you're saying there's a problem, or by having resistors for the R,G,B and monochrome outputs at all?
R1, R2, R3 being 75Ω looks incorrect to me.

If you use color mode, with a vertical white filled rectangle of about half the screen wide, on black background, you disconnected the video connector, and connected a 75Ω resistor between pin 13 and pin 10, what voltage swing would you see on pin 10?

Some web pages say 1.0V (that would be 0V to 1.0V with respect to pin 13, GND).

On the Atari STe video circuit, pin 10 is the analog blue intensity signal, coming from 2N3904 NPN transistor Q402 acting as an unity gain (emitter follower) amplifier, with Rᵢ=75Ω resistor in series to pin 10.  Let's say the voltage on Q402 emitter is Vₑ, and the measured voltage on pin 10 (on one end of the resistor) is V.  If we call the terminating resistor Rₜ=75Ω, and the web pages are right, then Vₑ·Rₜ/(Rₜ+Rᵢ) = V = 1.0V, i.e.  Vₑ = V + V·Rᵢ/Rₜ, which yields Vₑ = 2.0V.

VGA displays have exactly that 75Ω termination resistor to ground, and they expect a voltage swing of 0.7V at the top of that resistor for red, green, and blue signals.  The resistance of the cable is small, one ohm or less, so we can ignore that: typical 5% resistors resistance varies more than that.  If we use Rₛ for the added series resistance we need to convert from Atari to VGA voltage levels, then Vₑ·Rₜ/(Rₜ+Rᵢ+Rₛ) = 0.7V, i.e. 2.0V·75Ω/(150Ω+Rₛ) = 0.7V, giving us Rₛ ≃ 64Ω.

Note that if the measured swing V above was just 1.05V, then repeating the same calculation would yield Vₑ = 2.1V and we'd need Rₛ = 75Ω for VGA.  If the measured swing V was 1.4V, then Vₑ = 2.8V, and we'd need Rₛ = 150Ω for VGA.

(Because the voltage swing is obviously correct for the Atari 13-pin DIN output, those signals do not have any resistors in series.)

If one measures the voltage between pins 10 and 13 directly, without a resistor, using a high-impedance probe (say 10kΩ or higher impedance), the result is Vₑ directly.  (The higher the impedance, the smaller the error.  It's about 0.75% at 10kΩ impedance, 0.075% at 100kΩ, and so on.)  If the probe has 75Ω impedance to ground, you don't use a resistor at all as it is built-in to the probe so to speak, but otherwise treat the measurement the same as above.  If the probe has some other impedance R, then measurement V yields Vₑ via Vₑ=V+V·75Ω/R.  If you don't know the probe impedance, the measurement is useless.  Therefore, just stating some voltage figure is useless, unless we also know how it was measured!

I've mentioned it before that I do not know that voltage swing for sure, and therefore cannot tell exactly what the series resistors need to be; and that they need to be determined somehow.

My schematic using video amplifiers does not take this into account either, and the resistors must be adjusted (and optionally some more added, in a voltage divider configuration), to get the correct 0.7V voltage swing in the VGA display receiver end.

By the way, out of curiosity I measured the resistance between the R, G, B and monochrome pins to GND from the video output connector (DIN-13).  The computer was off when measuring.
It does not really matter, because the output is an NPN transistor (2N3904), with an emitter resistor to ground to stabilize the gain (because BJT transistors are current-controlled devices).

That is, when unpowered, you are not measuring the properties of the transistor amplifier, but just the series resistance and the emitter resistor in series, because the base-emitter junction is basically a diode in blocking direction here.  The schematic says the series resistance is 75Ω for R, G, B, and the emitter resistance is two 75Ω in series for each, so you should see 3·75Ω=225Ω. For the monochrome, the series resistance is 27Ω, and the emitter resistor is just one 100Ω resistor, so you should see 27Ω+100Ω=127Ω.

Which is what you measured, to within few percent, confirming that the schematic (here) should be correct in this regard.

Quote
The key is that when you use switches, you only convey the signal like a plain cable would, so no series or terminating resistors are used; and you want to keep the switch/multiplexer on-state resistances as low as possible.

Aha! That sounds simple enough (like I like it!), and confirms my findings for the Ubeswitch and other Atari to VGA cable pinouts.
Good.

As discussed above, because the Atari signal swing is a bit too high for VGA, some series resistance is needed to bring that swing down to the 0.7Vpp range, though, and I have not taken this into account before, because I do not know the actual signal swing!

My problem is that I cannot find a reliable source to find out what it is, and since I don't have an Atari STe myself, I cannot even measure it.

But I got confused again because this variation of the Ubeswitch has indeed got termination resistors.
No, it has 75Ω in series with the analog video signals (red, green, blue) between the input 13-pin DIN and the analog switch/multiplexer, plus another 75Ω in series with the VGA red, green, and blue video signals just before the VGA connector.  In other words, it uses Rₛ = 150Ω.
In Ubeswitch mk6, there are three trimpots in voltage divider configuration, so we don't know what the real-world Rₛ there is.

If the schematic you showed works best, it would imply that Vₑ = 2.8V or thereabouts, with the measurement using a 75Ω resistor or 75Ω probe showing V = 1.4V.

Would it be possible for you to do the aforementioned measurement?  Very, very carefully?  With a color mode test image, half-screen-wide white filled rectangle on black background, you'd need less than 1 MHz of bandwidth to measure it, so even the $25 oscilloscopes would suffice.

Regarding the buffer -I was told they're there to prevent the video circuitry in the computer from overloading. Which sounds like a good thing of course, so keeping it would be beneficial, right?
Buffer = amplifier with unity gain (no change in amplitude).  For the sync signals, it means the Atari would power only the inputs of the buffers, and the buffers would provide the power from that on, to the VGA display device and the Atari display.

Thus, yeah: I do believe the buffers are beneficial.  (Essentially, the video amplifiers in my schematic do the exact same thing, except for the analog video signals.)

Do you think it would make any difference if I go with the addition of a 74HCT14 for this, or have it built-in with the TS5V522?
 
74HCT14 is a hex inverter with Schmitt trigger TTL level inputs.  It buffers the sync signals by inverting each twice.  It does not have an enable pin, so it is only valid for this VGA-only schematic, not the switched one.

For the VGA-only model, I myself would prefer a pair of 74AHCT1G17GVH (in SOT23/SC-74/SOT753 footprint, 3mm×1.5mm body, 0.95mm pin pitch, small but still hand-solderable), or a single 74HCT2G17GV,125 (in SOT23/SC-74/SOT457), whichever is easier to route.

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.
« Last Edit: November 01, 2024, 03:55:53 pm by Nominal Animal »
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #58 on: November 01, 2024, 10:01:13 pm »
Is this where you're saying there's a problem, or by having resistors for the R,G,B and monochrome outputs at all?
R1, R2, R3 being 75Ω looks incorrect to me.

If you use color mode, with a vertical white filled rectangle of about half the screen wide, on black background, you disconnected the video connector, and connected a 75Ω resistor between pin 13 and pin 10, what voltage swing would you see on pin 10?

I understand.
Yes, the values may very well be incorrect. I don't know how I ended up with 75 Ohms. It may have been something I picked up from other source, or something I used when testing which appeared good. But no scientific calculations or anything like that from my part. This time around however I want to do it right.

Actually I haven't used my Atari STe for quite a while, but give me a little while and I'll get it ready for testing. I have a recapping kit for the power supply which I think is a good idea to install first, or at least test the power supply to see if it's still good.
I also have a "quickly built" VGA mono cable which I'll be using with a VGA display I have. I should probably reconnect its pins into a test-board or something so I can check out various things before completing the design of the circuit board. Something like this:



Quote
Would it be possible for you to do the aforementioned measurement?  Very, very carefully?  With a color mode test image, half-screen-wide white filled rectangle on black background, you'd need less than 1 MHz of bandwidth to measure it, so even the $25 oscilloscopes would suffice.

I do actually have an oscilloscope (that I built from a kit). It's a JYEtech DSO-150 single channel type, but its bandwidth is only 200 KHz. Is it unsuitable for this measurement?
« Last Edit: November 01, 2024, 10:16:07 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #59 on: November 02, 2024, 01:01:41 am »
I do actually have an oscilloscope (that I built from a kit). It's a JYEtech DSO-150 single channel type, but its bandwidth is only 200 KHz. Is it unsuitable for this measurement?
Actually, it should work for this.  Both AC and DC coupled input modes on the DSO-150 have an input impedance of over 1 MΩ, which means you can just stick probes directly to pins 10 and 13 on the Atari STe, giving you Ve (amplifier emitter voltage).  Because of the high impedance, the current is at most 12µA no matter which pins you stick them into, so it should be quite safe to do, too.

When you look at the 13-pin DIN female connector on Atari STe, it looks like this:
    ⎛    D    ⎞  D = GND         8 = 12V          3 = ExtClock
    ⎜ 9 A B C ⎟  C = Vsync       7 = Red          2 = Composite
    ⎜ 5 6 7 8 ⎟  B = MonoVideo   6 = Green        1 = AudioOut
    ⎜ 1 2 3 4 ⎟  A = Blue        5 = AudioIn
    ⎝   ┌─┐   ⎠  9 = Hsync       4 = MonoSelect
The sole pin is pin 13.  Pin 1 is clockwise from the tab/dent in the female connector, counterclockwise from the tab/dent in the male connector, when looking towards the connector from outside, as if you were the mating connector.  When looking at the pins from the inside, from the cable or enclosure side, remember that you then see the pin order mirrored.)

For clarity, I write units within angle brackets, [ ], below.

The signal has then Ri=75 [Ω] in series for R, G, B and Ri=27 [Ω] for MonoVideo, inside the Atari.  Any cables and switches/muxes on-state resistances and additional series resistances, in series, summed together, is Rs.  Finally, on the VGA display, there is a terminating resistance Rt=75 [Ω] to ground.  On the other end of the terminating resistance in the VGA display, the voltage swing between black and white must be about 0.7 [V]:
    Ve · Rt / (Rt + Ri + Rs) = 0.7 [V]
which means that when you know Ve, you can calculate the total amount of series resistance (including switches and series resistors) you need between Atari output and VGA output:
    Rs = Rt · Ve / 0.7 [V] - Rt - Ri
which for R, G, and B is
    Rsrgb = 75 [Ω] · Ve / 0.7 [V] - 150 [Ω]
For monochrome video split to VGA RGB, the series resistance needed is
    Rsmono = 75 [Ω] · Ve / 0.7 [V] - 102 [Ω]
on R, G, and B after splitting mono video components.  (This includes, as a sum, any series resistance on the monochrome video signal before the split into R, G, B.)

Set up color mode, black background, and a full height filled white rectangle of about 80% screen width.  That will give you the lowest frequency signal, each horizontal scan line taking about 1/15700Hz ≃ 64µs, and the white part about half that (remember, the time includes horizontal retrace also), so 200 kHz bandwidth should be plenty enough.

If you also have a known good multimeter (I have an Aneng AN8008), you could use a 1kΩ or so resistor in series with any battery you happen to have, and measure that with both, to see how closely the multimeter and DSO-150 agree.  (Batteries need to be loaded a bit to get their actual voltage; their unloaded voltage is somewhat higher and can "lie".)

We don't need that much precision here; I'd say getting the voltage swing to within 0.1 volts or so would suffice; 1% precision is about the best we can get with this kind of simplicity.  If you are also active on Atari ST enthusiast forums, you could ask there for someone to do the same measurement (with a high-impedance probe, or with a known-impedance probe on a "proper" oscilloscope).  If you want help formatting the question, PM me (or send me an email; address is here).

To repeat, if you have a probe with impedance R, and the measured voltage swing with that probe only (nothing else but the probe connected to the video output pin, and the ground clip/pin connected to pin 13/GND) is V, then Ve = V + V · Ri / R, where Ri = 75 [Ω] for the color signals and 27 [Ω] for the monochrome video signal.  That is also why for probes with high impedance, say 10 [kΩ] or more, we can approximate VeV: the error is less than 1% of V then, and that's the reasonable limit of precision here anyway.  Also, we already know the sync signals are 5V TTL level digital signals, so it's just the four analog video signals we need info on.)
« Last Edit: November 02, 2024, 01:08:25 am by Nominal Animal »
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #60 on: November 02, 2024, 01:16:36 am »
 :-+   Thanks. Sounds good.
I'll get back to you once I've recapped the STe's power supply. I have all the parts, so I just need the time  :)
 
The following users thanked this post: Nominal Animal

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #61 on: November 07, 2024, 09:20:21 pm »
A little update:
Recapping went fine, but my Atari-VGA cable no longer works  ???
(no big suprise really as it was only intended for a few times use back in the day and has the typical "dead bug" look). I hope to buy some prototyping/experimentation type PCBs in the next few days so I can rebuild it with better reliability which will also allow me to easier test out things while designing the Atari-VGA output board.

A practical question: I want to connect the Atari-VGA output board with a (perhaps 20cm) cable that has a 13-pin DIN (male) at one end (plugs into the Atari STe motherboard), and at the other end something like a 14-pin Molex or similar (I'm open for suggestions) that goes into the video output board.



Using a shielded (75 Ohm?) cable with 14 conductors, should I use 12 of the wires for the first 12 signals, and for pin 13 (GND), should I use the shielding for this which also goes to the GND-plane of the VGA output board? I'm concerned about ground-loops.
(please disregard the DIN13 symbol below -it's supposed to be a plug, not a socket):

« Last Edit: November 08, 2024, 02:07:59 am by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #62 on: November 09, 2024, 12:43:00 am »
Using a shielded (75 Ohm?) cable with 14 conductors, should I use 12 of the wires for the first 12 signals, and for pin 13 (GND), should I use the shielding for this which also goes to the GND-plane of the VGA output board?
Only Red, Green, Blue, Monochrome video, and Composite video need to be 75Ω.  If you don't mind bulky, you could do a cable bunch, and use five 75Ω coaxials for the video signals, and a multi-strand data cable for the rest – my choice would be a four-pair Ethernet cable.  Remember that you can use a small PCB you manufacture at JLCPCB/PCBWay/etc; they do not need to terminate directly at either connector.  (The trick with such is to extend the board outwards from the through holes for the cables, and have ziptie holes so you ziptie the cables to the PCB.  Otherwise they'll easily detach from the PCB.)  On your own board, you can use separate standard connectors for the cables.  If you use Ethernet RJ45 connectors, your socket (jack) needs to be the non-magnetics type, like Adam Tech MTJ-881X1/MTJ-883X1/MTJ-885X1, Amphenol RJE03-188-0310, and so on (that Mouser sells for about 0.5€ in singles).

Shielding and grounding is my weak point; I've asked about this myself here.  However, your device is DC-referenced, which means that the display(s) and the Atari STe must share the same ground.  If possible, I'd power them from the same mains socket, or at least the same mains circuit.

Thus, I would use the shields for GND, yes, but also have a dedicated copper wire for the GND.
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #63 on: November 09, 2024, 09:57:56 pm »
Finally some great news and progress here: I now have a working Atari-VGA cable and the computer appears to work fine ;D
So now I can start the measurements etc. I hope to get that done soon.


Only Red, Green, Blue, Monochrome video, and Composite video need to be 75Ω.

So Hsync and Vsync don't need a 75 Ohm connection (because they're digital signals)?
 
text
Quote
If you don't mind bulky, you could do a cable bunch, and use five 75Ω coaxials for the video signals, and a multi-strand data cable for the rest – my choice would be a four-pair Ethernet cable.  Remember that you can use a small PCB you manufacture at JLCPCB/PCBWay/etc; they do not need to terminate directly at either connector.

What do you mean by "terminate" at the connectors? That the unused wires can be left hanging loose and not be connected to anything at the one end (or both ends)?
It just occured to me that the Atari-VGA cable I've made is in fact a standard VGA cable (with moulded HD-15 connectors at each end and RF-chokes) where I've cut off and stripped one end to attach a DIN-13 plug.
So for the shielded cable I could just cut off the required length and use it for this project. After all, it's shielded, got the right impedance and enough stranded wires  :)



Quote
Thus, I would use the shields for GND, yes, but also have a dedicated copper wire for the GND.

You mean like this?


 
« Last Edit: November 09, 2024, 09:59:41 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #64 on: November 09, 2024, 11:22:40 pm »
So Hsync and Vsync don't need a 75 Ohm connection (because they're digital signals)?
Exactly.  They are just TTL level sync signals, so the characteristic impedance of the signal-ground pair used for them doesn't really matter, especially since Vsync is less than 100 Hz and Hsync less than 40 kHz for Atari STe.

What do you mean by "terminate" at the connectors?
Apologies, I worded myself horribly badly.

Do you have good-quality DIN-13 to DIN-13 cables?  If you do, then disregard everything except "Only Red, Green, Blue, Monochrome video, and Composite video need to be 75Ω." in the first paragraph of that post.

You see, I considered the case where fully-connected DIN-13 cables with five 75Ω impedance video conductors are "unobtainium".
The solution, then, is to split your board into two.  One connects to a male DIN-13 connector, signal wires from the connector soldered directly to the PCB.  That PCB also has five RCA or BNC female connectors for Red, Green, Blue, Monochrome video, and Composite video, plus one or more connectors for the audio and digital signals (which do not need any specific impedance, just good contact and lowish on-state resistance, although hsync, vsync, and monochrome detect can handle a couple of hundred ohms of on-state resistance ).  Then, your board with the VGA, Composite, and DIN-13 outputs would connect to the Atari STe using that bunch of cables.

That was all I was trying to say!  Me fail English.  |O

It just occured to me that the Atari-VGA cable I've made is in fact a standard VGA cable (with moulded HD-15 connectors at each end and RF-chokes) where I've cut off and stripped one end to attach a DIN-13 plug.
Yup, that works well for a single cable.

You mean like this?
Yes, this is exactly how I'd do it.

To recap: among these 13 conductors (plus shield), you have the following kinds:
  • 75Ω impendance high-frequency (video) signals: COMPOSITE_OUT, GREEN, RED, BLUE, MONOCHROME.
    For best results, use a 75Ω coaxial cable for each.
    VGA cables use twisted pairs for red, green, and blue, with 75Ω characteristic impedance. The rest are digital signals.

    Ethernet cables have four twisted pairs, with each pair having 100Ω characteristic impedance, so using my video amplifier schematic, if you wanted a longer cable between the Atari STe and your selector, you could use three Ethernet cables (Cat6a S/FTP preferred), with additional 25Ω or so series resistors on the Atari STe end (on a small board having the male 13-pin DIN connector connected to the Atari), and the input terminator resistors changed to 100Ω, you could use much longer S/FTP Cat6a type cables too I believe.
     
  • Audio signals: AUDIO IN, AUDIO OUT.
    These are analog signals also, but (assuming line audio) any characteristic impedance between 100Ω and 600Ω will work fine.  This is because the termination is different: no terminating resistors, or high values like 10kΩ or higher, so 100Ω to 600Ω impedance only varies the signal amplitude by less than 5%.  This can be done because the frequencies involved are less than 25kHz or so, and the attenuation by a few percent only affects the volume –– 5% by 0.4dB or so.
    The cable used in headphones et cetera would work well, as will a twisted pair in an Ethernet cable for each audio signal; best if you used an S/FTP cable (individually foil-shielded pairs, so basically no cross-talk or coupling between pairs).
     
  • Digital signals: HSYNC, VSYNC, EXT CLOCK.
    These don't need any specific characteristic impedance.  You just want to keep the series resistance reasonable, say below 300Ω.
    If you put these next to the audio signals, unshielded and untwisted, they can capacitively couple to the audio signals.  If you use one strand of a twisted pair for a sync and the other for audio, you will get audible noise, a square wave at the sync signal frequency.
     
  • Constant, or rarely changing: GND, +12V, MONO DETECT.
    These are similar to the digital signal in that you just want a good conductor with low enough series resistance for these; but since the signal in these is basically constant, they do not induce noise in nearby signals.  In ribbon cables, putting a GND wire between two other wires basically eliminates such coupling.

If I used a pair of VGA cables to carry all these signals, I would use the red, green, and blue conductors in one cable for RED, GREEN, and BLUE; and for COMPOSITE, MONOCHROME, and EXT CLOCK in the other.  One would carry hsync and vsync; in the other, I'd use them for AUDIO IN and AUDIO OUT.  I'd use the GND wire for GND in both cables; it's connected to several pins on the HD-15.  That leaves +12V and MONO DETECT, and there should be some conductors left in the cable, typically used for I2C or monitor detection.  I'd use one for MONO DETECT, and split the rest evenly between GND and +12V.  The conductors are thin, so DC resistance relatively high, and any current drawn on the +12V would heat the GND and +12V wires.  By using a thicker wire, or multiple conductors, you spread the load seen by a single conductor, reducing the waste heat.

Ethernet S/FTP and U/FTP cables have a foil shield (that you connect to GND) between each pair, with each pair carrying one signal with approximately 100Ω characteristic impedance.  S/FTP has an additional shield around the entire bunch, a wire mesh; and F/FTP has a foil around the entire bunch.  U/FTP does not have a common shield over the entire bunch.  One cable carries basically four signals among any of the above, except that for the constant/rarely changing you can use one half of a pair.
Cat6a has very low DC resistance, so a single half-of-a-pair suffices for +12V.  Basically, you need ten pairs for the video, audio, and sync signals, one for MONO DETECT, and the final one for +12V and GND.  The only downside is that because of the characteristic impedance, you need to adjust the impedance on the Atari STe end, and use video amplifiers to re-output the five video signals at 75Ω impedance, or otherwise somehow handle the impedance mismatch.  If only there were Cat6a S/FTP cables with 75Ω characteristic impedance!
« Last Edit: November 09, 2024, 11:34:51 pm by Nominal Animal »
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #65 on: November 15, 2024, 11:04:02 pm »
I've been pre-occupied for a while trying to get two Atari STe computers up and running, upgrading some things etc. and a VGA display, but have now got a working STe setup and can check things out in a real hardware environment  :)

Do you have good-quality DIN-13 to DIN-13 cables?  If you do, then disregard everything except "Only Red, Green, Blue, Monochrome video, and Composite video need to be 75Ω." in the first paragraph of that post.

No, because those cables are non-removable from the Atari monitors, having a DIN-13 male plug at one end.
But the VGA cable I already have should do. I suppose it's a good idea to not remove (or cut the cable before) at least one of the RF-chokes when soldering the the new connectors at each end of the cable.


So, at this stage I'm trying to finish my schematic so I can design the PCB and finally order and make it.
In the enclosed schematic I've added the SN74AHC1G86DBVR inverter as you suggested, but I haven't finished the rest of the connections to the 3-way slide switch.
Truth be told I'm struggling to follow your schematic. If there's a simple and quick way to convert the signal labels to actual wire connections between the components, could you do that and post a new version of your schematic? If you need to do it all manually, never mind.

I've also included the Hsync/Vsync buffer (74HCT14) which is taken from one of the Ubeswitch variants (relevant part of the schematic posted here)
But I'm also considering your suggestion of using the SN74LVC2G241).
That's what I have so far.


To finalize the project I need to finish the above (logic connections, redoing the buffer it the existing one isn't suitable).
Then, I suggest designing the PCB with multiple options (jumpers and/or solder pads) so that we can experiement with the resistor values to get the desired result.
I see myself having a few options regarding the R, G, B resistors which include:

1) fixed resistors for everything (monochrome and R, G, B)
2) trimmers for the monochrome lines (for mixing the colour hue output) with jumpers/solder pads for the direction of the trimmers
3) a single fixed resistor for the monochrome line
4) a trimmer for the monochrome line, and trimmers for the colour R, G, B lines
5) trimmers on the R, G and B pins of the HD-15 connector (provided the monochrome signal is the same level as the colour signals)

It's either "all options available", "keep it simple" or something in between.
« Last Edit: November 15, 2024, 11:06:45 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #66 on: November 16, 2024, 09:23:25 am »
Truth be told I'm struggling to follow your schematic. If there's a simple and quick way to convert the signal labels to actual wire connections between the components, could you do that and post a new version of your schematic?
I can do that, but I want to make sure you understand the difference between my suggested approach and yours, the difference between video amplifiers and video switches, first.

A video amplifier is an active device whose inputs act like the inputs to a real display, and whose outputs act like the original outputs of any video card or video output circuitry.  While the output depends on the input, whatever happens on the output will not be propagated back to the input: it is like one-way valve, or a generator powering a motor, in that sense.  It is important to understand that input side ends (and thus may need termination, like analog video does), and the output starts a new signal path.

A switch or multiplexer is just a complex connection between the input and output; not really any different to physical switches, or human connecting and disconnecting separate cables.  It is important that their on-state resistance is low, just like you would by using good-quality cables.  Any load or change on the output side affects the input side.

The two are not interchangeable.  Amplifier approach requires termination and impedance control, whereas switch/multiplexer approach only needs to keep the series on-state resistance low.  Because Atari video signal amplitude is higher than on VGA, some series resistance will be needed to attenuate the signals down to the VGA range.

For fixed resistor values, I'd need to know the emitter voltage swing Ve (as I described in reply #59), but I think it would be better to design it with say 200Ω or 500Ω multi-turn pots instead, for adjustability.  Perhaps Bourns 3296X or 3006P series?

I personally believe the amplifier option is superior, because they are easier to control (adjust, for correct signal levels), and the components needed are cheaper.

I've also included the Hsync/Vsync buffer (74HCT14) which is taken from one of the Ubeswitch variants
Yup.  Hsync and Vsync are 5V TTL signals at less than 40 kHz and 100 Hz, respectively, so there are a bazillion ways and ICs you can use to buffer them.

I do believe two SN74AHCT1G126DBVR (0.10€ at Mouser; 0.11$ at Digikey; part C163712 at LCSC and JLCPCB) plus two SN74AHCT1G125DBVR (0.12€ at Mouser; 0.13$ at Digikey; part C7484 at LCSC and JLCPCB) would be the best option, though.  These are cheap, easily available everywhere, in SOT-23 (small, but hand-solderable), and can directly be controlled from active-low or active-high "Atari" output selector signal without any logic.  The fact that there is one chip per signal per output connector only makes routing the signals on the PCB easier.

multiple options
Definitely.  It only takes a little more space to allow for different footprints, and I already habitually do that with e.g. surface mount resistors: I like to use my own footprint, which has the same outline as 0805, but the same gap between pads as 0603, so I can use either one.

With through-hole multiturn pot footprints, one can also use through-hole resistors in the vertical style.  (The idea is that you do not bend one leg at all, and bend the other leg parallel to the resistor, perhaps with heatshrink around it, making it a vertical cylinder.)

The resistors that affect the monochrome video tint are very nonlinear, because of the effect of the series resistance Rs on the output signal amplitude Vo=Ve·Rt/(Rt+Ri+Rs).  Basically, you'd need close to 1/x = x⁻¹ taper for Rs for Vo to adjust linearly...  For a specific range, you can achieve it by using a fixed resistor in parallel with the potentiometer.  For example, a 1000Ω resistor in parallel with a 100Ω trimmer gives you such a taper between about 91Ω and 909Ω (1% to 99% range), middle of the taper (50%) being about 167Ω.  Since we do not know the range yet, we'll get better range and thus adjustability options with linear potentiometers, even if at one end it barely affects the output, and on the other end is very sensitive to changes.
 
The following users thanked this post: analogix

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #67 on: November 17, 2024, 10:06:52 am »
So which one would you prefer I show the full schematic of: one using amplifiers, or one using switches/multiplexers?

I'll have to redraw it anyway, but I find it fun, so it's not a bother –– as long as it is useful/informative.  I don't mean you should use mine as is, but as a reference point relating to everything I've written thus far, so that you can make your own informed choices as to what you want/need.
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #68 on: November 17, 2024, 12:20:13 pm »
So which one would you prefer I show the full schematic of: one using amplifiers, or one using switches/multiplexers?

I'll have to redraw it anyway, but I find it fun, so it's not a bother –– as long as it is useful/informative.  I don't mean you should use mine as is, but as a reference point relating to everything I've written thus far, so that you can make your own informed choices as to what you want/need.

Yes, this is both informative and educational for sure.
I'm a more of a visual person, which is why I find a full schematic with wires easier to understand than where the wires are symbolized.

I'd like to go for the Ubeswitch-based solution which I've been working on, with the additional MUX chips (to allow for the necessary signals to be switched) and with logic control from the physical switch and the added Hsync/Vsync buffer.

You don't need to spend a lot of time redoing the whole schematic (which is why I was hoping for a KiCAD function that would simply convert labels to wires), but I would like to understand better how the logic switching and buffering is wired up, so maybe you could just draw the wires from the 3-way slide switch to the the rest of the schematic and the buffers in your video amplifier-based schematic in post #51.
I will try to understand it and include the relevant bits into my ubeswitch-based schematic (my most recent version posted in post#65).
« Last Edit: November 17, 2024, 10:00:02 pm by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #69 on: November 18, 2024, 09:18:21 pm »
Attached is the part of the schematic that deals with video signals.  Blue lines are analog video signals, cyan are sync signals, and green are digital selector signals.

On the slide switch, pin 2 is the common pin, and is connected to ground.  Pin 1 is "ATARI SELECT", and it is low when the slide switch is in the Atari position, and high otherwise.  Pin 3 is "VGA COLOR SELECT", and it is low when the slide switch is in the VGA COLOR position, and high otherwise.

U7 inverts the "ATARI SELECT", so that its Y output is high when the slide switch is in the Atari position, and low otherwise.

U1 is connected to the VGA connector.  When /EN is high, the switch is in high impedance mode ("not connected").  When /EN is low –– and it is low whenever the slide switch is not in Atari position (is in either VGA color or VGA mono position) ––, the VGA Red, Green, and Blue are connected to either input Red, Green, and Blue via resistors R1-R3 (to attenuate the signal to 0.7V), or to the input Mono via resistors R4-R6 (to attenuate the signal to 0.7V or less, tinting the monochrome video somewhat), depending on the IN pin voltage.

U2 is connected to the Atari output connector.  When /EN is high, the switch is in high impedance mode ("not connected").  IN pin is tied low, so that only S1 inputs will ever be used.  When the slide switch is in Atari position, this IC is enabled.

U3 and U4 are 74AHCT1G126 tri-state TTL-compatible buffers.  When enabled, they pass the sync signals to the VGA connector.  The OE pin is active high, and is connected to the ATARI SELECT slide switch pin, so that when the slide switch is in the Atari position, these are disabled, and enabled otherwise.

U5 and U6 are 74AHCT1G125 tri-state TTL-compatible buffers.  They are like '126s, except these are active low.  The /OE pin is again connected to the ATARI SELECT slide switch pin, so that when the slide switch is in the Atari position, these are enabled, otherwise disabled.

EXT CLOCK can be buffered using a 74AHCT1G125.

Input MONO DETECT pin handling will use two 74AHCT1G125.  One connects input MONO DETECT to output MONO DETECT when the slide switch is in Atari position, and the other connects input MONO DETECT to GND when the slide switch is in the VGA MONO position.

Thus, by my count, you need 2×TS5V330PWR, 5×SN74AHCT1G125, 2×SN74AHCT1G126, and 1×SN74AHCT1G86DVBR (or any other 5V logic inverter).

Also, I noticed that the +12V output on the Atari STe has a 2kΩ resistor in series.  This means that the pin voltage drops by 2V per each milliamp you draw from it.  Basically, the entire current budget it only 3mA or so!  I would personally consider adding an USB input power connector, connected to a MTE1S0506MC isolated DC-DC converter and a 5V low-drop regulator like BA50DD0WT.
 
The following users thanked this post: analogix

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #70 on: November 18, 2024, 10:34:52 pm »
Using a 4P3T slide switch like E-Switch EG4319A (Mouser) or EG4319 (Mouser), CW Industries G-660S-6010 (Mouser), G-Switch SS-43D01-G090 (C2686900 at LCSC), and so on, we can minimize current draw and eliminate the inverter; see attached image.  Each of the four poles (common pins) is an active-low selection signal:
(Atari)
(VGA color)
(VGA mono)
Active-low signal
Position 1
Position 2
Position 3
MODE_ATARI
GND
+5V
+5V
MODE_VGA
+5V
GND
GND
MODE_VGA_COLOR
+5V
GND
+5V
MODE_VGA_MONO
+5V
+5V
GND
This way, no current is lost in any pull-up or pull-down resistors, and 2×TS5V330PWR plus 7×SN74AHCT1G125 IC's suffice, lowering the BOM cost.

Edit: Instead of SN74AHCT1G125's, use 74LVC1G125's (like NXP 74LVC1G125GV,125 or TI 74LVC1G125DBVR et cetera) since they have TTL-compatible logic levels but include Schmitt triggers on inputs too.

I'll see if I can draw a full schematic using this slide switch, this time including all signals.  Note that the different slide switches have different physical layout, but all 4P3T switches have 16 pins, and if you mount the switch on the enclosure, you can use 6 wires –– +5V, GND, MODE_ATARI, MODE_VGA, MODE_VGA_COLOR, MODE_VGA_MONO –– from the PCB to the switch, with additional "jumper" wires in the switch itself.  The above table tells you what voltage each of the four signals should have in the three different positions.
« Last Edit: November 21, 2024, 06:08:32 pm by Nominal Animal »
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #71 on: November 20, 2024, 10:41:02 pm »
Attached is the part of the schematic that deals with video signals.  Blue lines are analog video signals, cyan are sync signals, and green are digital selector signals.

Thank you  :)
I'll spend a little time studying it and the other one you posted and get back to you.
Thanks again!
« Last Edit: November 21, 2024, 10:45:40 am by analogix »
 

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #72 on: November 24, 2024, 10:08:24 pm »
Attached is the part of the schematic that deals with video signals.  Blue lines are analog video signals, cyan are sync signals, and green are digital selector signals.

Thanks to your schematic in post #69 I believe I now have a more or less finalized schematic   :)
(See attachement below).

I've made these changes:
- Added Hsync and Vsync buffers (2x 74AHCT126) for the VGA output
- Added logic inverter (74AHC86) for opposite logic enable signals of Atari-MUX and VGA-MUX
- Added 3-way slide switch for selecting the 3 video modes
- Added LEDs showing each mode (mainly to see if the MUX chips are working if troubleshooting)
- Added more comments and visual cleanups to make the schematic easier to read
- tied unused MUX inputs/outputs to GND

I have a couple of questions:
a) I've tied the unused multiplexer inputs and outputs to GND (U22, U11) because I've heard floating logic pins are bad (they can fluctuate). Now that I think about it, these aren't actually logic inputs and outputs are they?, so should I just remove those GND connections and leave them unused?

b) One of the VGA MUX chips (U22) switches the Hsync and Vsync signals. They are of course used in both VGA-mono and VGA-colour modes, so I have switch outputs S1A and S2A permanently connected together for Hsync.
Similarly, for Vsync I have S1B and S2B permanently connected together. Is this OK?

c) should there be a pullup resistor on the +5V line of U5 (74AHC86) like there is on the slide switch?
« Last Edit: November 25, 2024, 11:37:22 am by analogix »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7468
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #73 on: December 02, 2024, 09:36:21 pm »
Attached is my version of the mux/switch-based switch.  Apologies, I got "stuck" and couldn't redraw it with wires instead of net labels.  (Promising to do something in the future is my Achilles' heel: even very simple tasks often become very difficult for me to complete.)

AUDIO IN, AUDIO OUT, COMPOSITE, and +12V are directly wired between the two 13-pin DIN connectors.

Only three of the four poles in the three-throw slide switch are used.  They are all active low.  /ATARI is low when the 13-pin DIN output is selected.  /VGA is low when either of the VGA output modes is selected.  VGA_COLOR is low when the color VGA output mode is selected.

The monochrome SELECT signal between the two 13-pin DIN connectors is switched by U4.  When /ATARI is low, they are connected.  When /ATARI is high, IN_SELECT is connected to Q1 (and ATARI_SELECT is not connected).  When /VGA_COLOR is low, Q1 does not conduct (is high-Z).  When /VGA_COLOR is high, Q1 conducts and pulls U4 NO to ground.  This way, in color VGA mode IN_SELECT floats, and in mono VGA mode it is pulled to ground.  Q1 also conducts when /ATARI is low and /VGA_COLOR is high, but U4 ignores the NO then, so it is okay.  R7 on gate of Q1 limits peak current draw, and I think values between 1k and 10k should work fine here.  (All it does is "slow" down the rate at which Q1 switches.)  Note that Q1 is an enhancement mode N-channel MOSFET, similar to BSS138, and is therefore voltage-controlled (or rather, charge-controlled); it draws only tiny leakage currents in steady state.

U6 connects ATARI_EXTCLOCK to IN_EXTCLOCK only when /ATARI is low.

Sync signals are routed by U2.  When /ATARI is low, IN_HSYNC and IN_VSYNC are connected to ATARI_HSYNC and ATARI_VSYNC, respectively.  When /VGA is low, IN_HSYNC and IN_VSYNC are connected to VGA_HSYNC and VGA_VSYNC, respectively.

VGA color signals are controlled by U1.  When /VGA is low, /VGA_COLOR controls whether IN_RED/GREEN/BLUE or IN_MONO is connected.  When /VGA is high, they are not connected.  The series resistors/potentiometers R1-R3 are used in series with the signal to attenuate the red/green/blue from Atari to VGA levels.  The series resistors/potentiometers R4-R6 do the same for the monochrome video signal, and also control monochrome tinting.

Atari 13-pin DIN output color and monochrome video signals are controlled by U3.  Note that it is in 4PST configuration (compared to 3PDT for U1).  Whenever /ATARI is low, IN_RED/GREEN/BLUE/MONO are connected to ATARI_RED/GREEN/BLUE/MONO, respectively.

Because the Atari +12V output is through a 2k resistor (R431), we can draw only about 3mA before the voltage drop over it is 6V, and we only see about 6V on the +12V input.  I am not sure if 3mA is sufficient for this circuit.  The OnSemi LM2931AT-5.0G I added to the schematic is relatively cheap, in an easily cooled TO-220 package (the metal tab is ground), and can handle any input voltage between 6V and 24V.  I suggest using a jumper to a pin header, so that you can supply that externally instead of from the Atari.

I personally would also add pads for 0.1µF = 100nF supply bypass capacitors between the VCC and GND pins of basically all ICs.  They are likely not needed, but can help and might be needed, so although I left them out from the schematic, I do believe I'd put them on the PCB.

Also, the connectors are rather large, making the PCB needed surprisingly large.   The components fit in quite small area, especially if you use a four-layer PCB.
« Last Edit: December 02, 2024, 09:40:18 pm by Nominal Animal »
 
The following users thanked this post: analogix

Offline analogixTopic starter

  • Frequent Contributor
  • **
  • Posts: 252
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #74 on: December 12, 2024, 09:34:46 am »
Attached is my version of the mux/switch-based switch.

Thanks for sharing, and for explaining how it works.
Concerning parts count, board space, cost and efficiency this seems to be a well thought out solution, but my head is spinning!  :o
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.
This is why I want to stick with the 4x TS5V330 design in reply #72.

There are still a few things I'm not 100% sure is correct in that design, but during this thread I've had several eye-opening "aha!" moments learning from yourself and others about how MUX chips work and likewise, inverters. I think the concept of enabling/disabling a whole MUX and the ability to invert a logic signal are both ingenious things to know about, so I greatly appreciate learning that. It'll come in handy for other projects too.
I also think your way of solving the connections from the slide switch with the pullup resistors is a great way to do it, and yet something new learnt that I can put to use in other projects!

OK, so I believe I have a basically functioning schematic with the MUXes, and if the wiring is correct with the 74AHC86 inverter (U5) and the 3-way slide switch I should have the correct logic control signals for the opposite enables of the Atari and VGA MUX chips. Does it look OK to you?

Regarding the parts count, parts cost and power usage:
I will be replacing the original Atari power supply with a better and more powerful one, so it'll be much easier to take power to this board directly from it than trying to find ways to deal with the very limiting +12V supply from the DIN13 connector. I will just pass on that line (DIN13 pin 8) to the new DIN13 connector untouched.
Since the Atari ST has a dual voltage power supply (+12V and +5V) I can really just use the +5V line for this board, making the 78L05 voltage regulator (IC1) unnecessary.
I don't worry too much about the costs as there aren't that many parts here and there really aren't any extreme costs involved. I'd rather just get the project done.
I also understand that there are many ways of improving upon it (as you've shown many times already), and I appreciate that, but I'd rather have an understanding of a simpler circuit than scratching my head over an ideal solution. If it does what it's supposed to do without incurring undesirable side-effects or problems I'm good.

Quote
Because the Atari +12V output is through a 2k resistor (R431), we can draw only about 3mA before the voltage drop over it is 6V, and we only see about 6V on the +12V input.  I am not sure if 3mA is sufficient for this circuit.  The OnSemi LM2931AT-5.0G I added to the schematic is relatively cheap, in an easily cooled TO-220 package (the metal tab is ground), and can handle any input voltage between 6V and 24V.  I suggest using a jumper to a pin header, so that you can supply that externally instead of from the Atari.

Good suggestions, and useful info for similar situations. I appreciate your explanations -I'm learning all the time  :)
But with a direct connection to the +5V of the power supply we needn't worry about the 3mA limitations here.
Can I connect the +5V directly from the power supply to this board, or do I need some current limiting resistors or something first?

Quote
I personally would also add pads for 0.1µF = 100nF supply bypass capacitors between the VCC and GND pins of basically all ICs.  They are likely not needed, but can help and might be needed, so although I left them out from the schematic, I do believe I'd put them on the PCB.

Great idea! with SMD capacitors those pads won't take up much extra space anyway.
Is that ot minimize induction, as the wire traces of the PCB can act as induction coils and cause power "noise" and other problems?


Quote
Also, the connectors are rather large, making the PCB needed surprisingly large.   The components fit in quite small area, especially if you use a four-layer PCB.

I can't make 4-layer PCBs with Eagle. But 2-layers should do fine?
I don't want to make the PCB any wider than necessary, but should contain the VGA connector, 13-pin DIN connector and the slide-switch between them. That's on one end of the PCB, and probably with 2 or 3 reinforced holes for screws and metal brackets (so it can be firmly fastened to the rear panel of the 19" rack enclosure). I think the VGA connector also allows for its own screws to mount through the rack panel, so that should greatly help with stability when inserting/removing the mating monitor connectors on the other side.
As for the depth of the PCB I don't think of any limitations other than that of Eagle's free version limits (off my head I think it's around 10x8 or 10x10cm or something), which will probably be doable. There should be a lot of free horizontal space available inside the 19" rack enclosure for this and other boards.
« Last Edit: December 12, 2024, 03:07:52 pm by analogix »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf