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

0 Members and 5 Guests are viewing this topic.

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #25 on: September 29, 2024, 12:17:21 pm »
Yup, you are AOK with the pull-up resistor and a switch shorting the enable to GND.

Thanks for confirming  :-+


Quote
Dont worry about the 74HC00, just keep it simple.

You got me curious though, and I'm open for learning  ;)
I may be way off here, but I'm guessing the purpose of the 74HC00 is to enable MUX1 while disabling MUX2 (and likewise the opposite) just by using a single logic HIGH or LOW to one of its (74HC00) pins?
In other words, the 74HC00 controls two MUX chips at once, and the mechanical switch controls the 74HC00.



... in contrary to a pure mechanical switch solution (to enable and disable the MUX chips) which would be a more complicated wiring setup.
Is that it?



I'd personally prefer using a logic chip to control the 'EN' (enable) pins of the two MUX chips if that means a single high/low signal from the mechanical switch. I haven't looked in detail into how many poles might be needed, but my initial thought is that it would require less poles and be less complicated.
If I could simply send a HIGH (+5V) or LOW (GND) voltage to the 74HC00 to set it into two modes as follows, that would be great!





Quote
Yes, do use a 78L05 or equivalent.

A 78L05 will take in anywhere from 7.5v to 28v on it's Vin pin.
Tie it's GND pin to GND.
It's Vout pin will be a 5v supply.
Add 2x 0.1uf caps to the Vin and Vout pins to GND.

A 78L05 has a built in current limiter of 100ma, so you will be safe.

It's available in TO-92 3 pin transistor looking type through-hole package, or in an SO-8 pin ic package.
7805 can be used as well, just that they can deliver up to 1amp.

Sounds like a good solution (having everything on a self-contained PCB instead of relying on additional connections), but in case I do run into problems if the +12V from the Atari video output connector is used for something that drains more power than is available after the MUX chips/78L05 takes what it needs (I recently learnt that the +12V was probably used for whenever the Atari video output was attached to a television SCART connector where the +12V connects to a certain pin on the TV's SCART automatically switches over to the AV input)... then maybe I should add the option of a jumper and power connector on the PCB so that I could easy take power directly from the computer's power supply.

By the way, I found there's a MAX4885 evaluation board available, which I understand takes one VGA input (from a computer's VGA output connector) and switches between one of the two available VGA output connectors (for selecting one of two screens). Though close but not exactly what I'm designing here, I took a peek at its datasheet out of curiosity and found it very insightful as it both explains how it works and has a schematic, so I'm going to study that in more detail to understand this better.

A practical question: the MUX appears to come in a 24 or 32 pin package (I haven't quite understood the differences, but something I'll need to look into), and they're both 'TQFN' packages which I looked up and they seem to be a challenge to hand-solder. Can this be done, or are they meant to be soldered professionaly? I plan to buy a soldering-station (ESD-safe) to replace my cheap & simple soldering irons, but will that be enough to make this possible to do myself, or would it be better to order the PCB with the MUX chips pre-soldered? I believe there are some companies out there that both manufacture the PCB and solder components on them, but don't know which companies do that and the costs.

(image source: MadPCB.com)
« Last Edit: September 29, 2024, 06:04:39 pm by analogix »
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #26 on: September 29, 2024, 05:20:12 pm »
Can [TQFN be soldered by hand]?
If you get a small hot plate and hot air, definitely yes.  Others have described using a custom footprint, with a large plated through hole on the bottom, so they can use a fine tipped iron to solder first the IC pads (one at a time, tip in the corner between the PCB pad and the tiny bit of exposed IC pad), and finally the large center pad from the other side of the board.

I myself am exactly at that stage (and after that, onwards to BGA), having a cheap hot air station (see discussions in the Other Equipment & Products subforum here for which one and what to look for), a tiny (for smaller than 2"×2" or 50mm×50mm boards) USB-C PD hot plate you can get off Banggood for a flash deal for under 15€ right now, and a Pinecil USB-C PD soldering iron with full set of tips.

The existing soldering practice kits and DIY kits I've seen don't have interesting enough components – do get a few SMD LED projects or similar for a couple of USD/EUR each, if you haven't soldered any SMD components yet –, so I'll design my own, based on cheap microcontrollers easily programmed with open source tools (my workstations all use Linux).  (I'm specifically looking at a CH32V305-based isolated UART/SPI adapter, designed to be partially populated for programming and testing as soon as the MCU and a couple of capacitors are soldered.)

You can find a lot of videos about the various soldering methods on Youtube, but be careful: there are a lot of garbage videos, so do check the comments, and skim a lot of videos, to see what works.  I can tell that good flux, isopropyl alcohol (IPA), occasionally acetone, and an old toothbrush makes for a much nicer soldering job and results, for example!

which companies do [PCB manufacturing and assembly]
I use EasyEDA or KiCAD to design my own PCBs.  EasyEDA directly interfaces to JLCPCB for PCB manufacturing and optionally SMD assembly, but for assembly you need to use their parts catalog (which is very easy from EasyEDA, as it even shows the per-component price from JLCPCB or LCSC when selecting components).  You can pick any such EasyEDA design and easily check the price by starting the ordering process, the price calculation is online and instant.

Unfortunately, JLCPCB does not seem to have any max4885 in stock right now.

PCBWay is another, often used by for PCB manufacturing and optionally SMD assembly by us hobbyists, but I haven't personally used them yet (only because JLCPCB is so darned easy to use with EasyEDA).

The assembly is usually limited to components on one side of the board, and I do suggest soldering any through hole components yourself.  I do plan to have components on both sides (just because!), but solder everything on at least one side myself.

As to the prices, you can get a set of ten PCBs up to 10cm×10cm/4"×4" for a few USD/EUR plus shipping costs.  For SMD assembly, there are additional costs that vary, but as a rough idea, the setup etc. fees seem to be on the order of 25 USD/EUR for two/five/ten boards at JLCPCB and PCBWay, plus the part costs of course.
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #27 on: September 29, 2024, 08:59:06 pm »
Can TQFN be soldered by hand]?
If you get a small hot plate and hot air, definitely yes.  Others have described using a custom footprint, with a large plated through hole on the bottom, so they can use a fine tipped iron to solder first the IC pads (one at a time, tip in the corner between the PCB pad and the tiny bit of exposed IC pad), and finally the large center pad from the other side of the board.

Good to hear it can be done, although (to me) it sounds very risky.
I was also hoping not to buy any more gear than strictly necessary  ;D
Maybe worth looking into the other option (discussed further down) since this is probably one of the few projects I need to use these kind of components.
 

Quote
The existing soldering practice kits and DIY kits I've seen don't have interesting enough components – do get a few SMD LED projects or similar for a couple of USD/EUR each, if you haven't soldered any SMD components yet –, so I'll design my own, based on cheap microcontrollers easily programmed with open source tools (my workstations all use Linux).  (I'm specifically looking at a CH32V305-based isolated UART/SPI adapter, designed to be partially populated for programming and testing as soon as the MCU and a couple of capacitors are soldered.)

That's a good suggestion actually -SMD soldering practice kits!
Judging from several Youtube videos it appears that soldering standard SMD components (ICs with normal legs etc.) is doable with normal equipment. I understand that the key is to add a lot of flux to the areas to be soldered (I've never used flux before, so this will be a new experience).
Probably a good idea for me to practice on a few non-critical practice kits before attempting the project I'm discussing in this thread  :)


Quote
You can find a lot of videos about the various soldering methods on Youtube, but be careful: there are a lot of garbage videos, so do check the comments, and skim a lot of videos, to see what works.  I can tell that good flux, isopropyl alcohol (IPA), occasionally acetone, and an old toothbrush makes for a much nicer soldering job and results, for example!

That's the usual problem with Youtube etc. -to distinguish the trash from the proper information. I'll see if I can locate some good ones, then move on to the practice kits. Maybe I can even find one seller with several different SMD practice kits (so as to save on shipping costs, import duties etc). If someone can suggest one, and specific kits I'm all ears  ;)


Quote
which companies do [PCB manufacturing and assembly]
I use EasyEDA or KiCAD to design my own PCBs.  EasyEDA directly interfaces to JLCPCB for PCB manufacturing and optionally SMD assembly, but for assembly you need to use their parts catalog (which is very easy from EasyEDA, as it even shows the per-component price from JLCPCB or LCSC when selecting components).  You can pick any such EasyEDA design and easily check the price by starting the ordering process, the price calculation is online and instant.

Cool!
I still consider myself a novice, but I've spent so much time learning Eagle and built up a small library of additional parts that it would be like starting from scratch to learn another CAD package. Do you know if the above can be done with Eagle too, or if there's a way to order the assembly of certain components from the Gerber file from them (or other PCB manufacturers)?

Quote
Unfortunately, JLCPCB does not seem to have any max4885 in stock right now.

Oh  :(
Do you know if the MAX4885 is a common component which is usually easy to order along with PCBs?
Deciding between 24- and 32-pin versions of this MUX is probably something I should be flexible with depending on what's available.


Quote
PCBWay is another, often used by for PCB manufacturing and optionally SMD assembly by us hobbyists, but I haven't personally used them yet (only because JLCPCB is so darned easy to use with EasyEDA).

The assembly is usually limited to components on one side of the board, and I do suggest soldering any through hole components yourself.  I do plan to have components on both sides (just because!), but solder everything on at least one side myself.

That's OK. I enjoy soldering through hole components, so that's no problem. And I can probably design the board to have any SMD components to be soldered by them on just one side.
Good to know about this -thanks!


Quote
As to the prices, you can get a set of ten PCBs up to 10cm×10cm/4"×4" for a few USD/EUR plus shipping costs.  For SMD assembly, there are additional costs that vary, but as a rough idea, the setup etc. fees seem to be on the order of 25 USD/EUR for two/five/ten boards at JLCPCB and PCBWay, plus the part costs of course.

Are you referring to ten of the same PCBs when ordering at those prices? I probably only need one (but a spare or two won't hurt, being unexperienced at this).
With a setup fee it's probably a good idea to order a few PCBs though, in case I mess things up, or in case someone else might want one.

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #28 on: September 29, 2024, 10:38:55 pm »
I still consider myself a novice, but I've spent so much time learning Eagle and built up a small library of additional parts that it would be like starting from scratch to learn another CAD package. Do you know if the above can be done with Eagle too, or if there's a way to order the assembly of certain components from the Gerber file from them (or other PCB manufacturers)?
Sure.

JLCPCB takes a ZIP file with Gerbers for manufacturing PCBs.  For SMD assembly, you also supply a CSV file (from Excel, LibreOffice, etc. spreadsheet), and a CPL or Pick and Place file.

EasyEDA is supposed to be able to open Eagle (v6 or later) and KiCAD and Altium Designer files in the online Standard editor, but I haven't tested that myself.

It really is a very hobbyist-friendly schematic and PCB editor, probably more suited to hobbyists than actual EEs.  It's what I've used to learn practical PCB design with for the last few years, marking my designs CC0-1.0 aka Public Domain, so it being cloud-only is no issue for me.  Only now, as KiCAD is getting better, I'm switching slowly to KiCAD.

Do you know if the MAX4885 is a common component which is usually easy to order along with PCBs?
Well, LCSC/JLCPCB did supply EasyEDA with the footprints, so it isn't rare.

However, I would reconsider the choice, and look at TI TS5V522CPWR+74CBT3257C as a replacement for each MAX4885.  If I've understood your needs correctly, it should be similar (but with two chips; one for analog signals and I2C, and the other for H and V sync signals), with slightly lower typical resistance (3Ω vs. 5Ω typical) and slightly higher typical capacitance (8pF vs. 5.5pF), but is available at both LCSC/JLCPCB and Mouser, and for only a fraction of the price of MAX4885.

Most importantly, TS5V522CPWR and SN74CBT3257CPWR are a 0.65mm pitch TSSOP packages (dense, but with SMD legs), which are drag-solderable using a standard iron (using e.g. chisel-like K-tip).  I suspect even the signal routing might be easier, because HSync and VSync are in a separate chip.  These have an active-low Output Enable, so you can put several in parallel to the same input signals or to the same output signals to get N:1 or 1:N selection, without chaining the chips, by only enabling the output on one chip at the time.  Both are in EasyEDA component libraries, too.

The main difference is that the TS5V522CPWR analog bandwidth is "only" 380 MHz –– so suffices for up to Full HD (1080p, 1920×1080 50Hz) and 1920×1080 70Hz ––, whereas MAX4885 is 900 MHz.  For what you are doing, there should be basically zero difference in the signal quality.  And, of course, as I already mentioned, H and V sync signals are routed through a separate chip, SN74CBT3257C.

Are you referring to ten of the same PCBs when ordering at those prices? I probably only need one (but a spare or two won't hurt, being unexperienced at this).
Yep, the same PCB.  JLCPCB does offer e.g. assembling only 2 boards and sending you the rest unpopulated, but it doesn't shrink the setup fees.  Its when you have ten or more of the same boards made and assembled, that amortizes the fees to an easily acceptable level (to a minimal-budget hobbyist like myself).

It really makes more sense to use components you know you can solder yourself for one-offs.  And do note that making bare 4-layer PCBs costs about the same (for 2-10 PCBs) as for two-layer boards, just a few USD/EUR plus shipping; no need to limit oneself to 2-layer PCBs.
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #29 on: October 08, 2024, 06:56:36 pm »
Do you know if the MAX4885 is a common component which is usually easy to order along with PCBs?
Well, LCSC/JLCPCB did supply EasyEDA with the footprints, so it isn't rare.

Do they (or other low-cost PCB manufacturers suitable for hobbyists) have a search function for which components they can supply?
I tried to find out, but from the looks of it you have to upload a Gerber file first (which I don't have as I haven't even completed designing my PCB).


Quote
However, I would reconsider the choice, and look at TI TS5V522CPWR+74CBT3257C as a replacement for each MAX4885.  If I've understood your needs correctly, it should be similar (but with two chips; one for analog signals and I2C, and the other for H and V sync signals), with slightly lower typical resistance (3Ω vs. 5Ω typical) and slightly higher typical capacitance (8pF vs. 5.5pF), but is available at both LCSC/JLCPCB and Mouser, and for only a fraction of the price of MAX4885.

Most importantly, TS5V522CPWR and SN74CBT3257CPWR are a 0.65mm pitch TSSOP packages (dense, but with SMD legs), which are drag-solderable using a standard iron (using e.g. chisel-like K-tip).  I suspect even the signal routing might be easier, because HSync and VSync are in a separate chip.  These have an active-low Output Enable, so you can put several in parallel to the same input signals or to the same output signals to get N:1 or 1:N selection, without chaining the chips, by only enabling the output on one chip at the time.  Both are in EasyEDA component libraries, too.

Thanks for your suggestion! Yes, although i've personally never done it before, it seems drag-soldering is something that can be done with good tools and some practice.
Too bad about the MAX4885, because it has the 7 channels I need all in one and I almost had it all figured out, but with the practical soldering issues I'm open for looking into other solutions like your suggestions here.

You mentioned 'I2C': are these digital signals? If i've got it right all the video signals are analog (R, G, B, Hsync, Vsync), right?
Likewise I think the "Monochrome" signal is analog as well as it just outputs an analog video signal.
But I'm more unsure about the "Monochrome detect" signal -if it's analog or digital. Its purpose is to change the computer's video mode to low/medium resolution colour ("Monochrome detect" untouched), or high resolution monochrome ("Monchrome detect" connected to GND).
As far as I've understood an "analog switch" type MUX can be used for either analog or digital signals while there are MUX chips that only work with digital signals, correct?


I've spent some time thinking all this through, studying how the various MUXes work as well as how other VGA output adapters for the Atari ST (Ubeswitch and a variation of that one by Edoardo Kinmami)
They both use the TS5V330 (4-channel 2:1 multiplexer) which I see is sufficient for only switching between 2 display modes (colour and monochrome) on a single VGA connector as only these signals are switched:
  • Red
  • Green
  • Blue
  • Monochrome detect

In addition, the 'Monochrome' signal is connected to one of the switched outputs, so 5 signals altogether.
Building upon this I think the key is to isolate the shared signals so they don't interfere with each other. Thanks to what I've learned here about the ability to switch off an entire MUX in one go, and experiencing that it's hard to find a single MUX chip with several channels (i.e. 7 or 8 ) along with multiple positions (i.e. 3 or 4) I got the idea that I can probably go for a single position (1:1) MUX with 7 (or more) channels for the new Atari DIN13 output side, and if I recall correctly there are several MUX chips like that to choose from with low resistance and in a solderable package.

For the VGA connector side I probably need similar amount of channels (in order to isolate the signals from the Atari DIN13 new output side) which is a little more complex as it has to be a 1:2 MUX (or is it 2:1?), so perhaps your solution with multiple chips is the way to go. Here's a diagram of my suggestion:




Quote
The main difference is that the TS5V522CPWR analog bandwidth is "only" 380 MHz –– so suffices for up to Full HD (1080p, 1920×1080 50Hz) and 1920×1080 70Hz ––, whereas MAX4885 is 900 MHz.  For what you are doing, there should be basically zero difference in the signal quality.  And, of course, as I already mentioned, H and V sync signals are routed through a separate chip, SN74CBT3257C.

How can I find the bandwidth requirement for the Atari ST video output? Is it simply a matter of the Hsync and Vsync frequencies, which is course is much much lower than that. And the resolution is at most 640x400 pixels, so maybe I can even look at lower spec MUX chips and find one which has the 7 channels I need.
Also, do I need to look for a "Video switch" type MUX, or can any analog switch MUX (with a low on-resistance) be used?
« Last Edit: October 08, 2024, 08:00:39 pm by analogix »
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #30 on: October 08, 2024, 09:10:29 pm »
Do they (or other low-cost PCB manufacturers suitable for hobbyists) have a search function for which components they can supply?
Yes, but it is a bit wonky: jlcpcb.com/parts. The part numbers (Cnnn...) are the same as LCSC, so you might wish to use the LCSC catalog, note the part number, and then search on that at JLCPCB.

I've found it easiest to do from within EasyEDA.  Just open the editor, select File > New > Schematic, to start a new schematic.  Clicking on the Library button on the left brings up the parts selector.  I use Search engine: EasyEDA, Types: Symbol, Classes: JLCPCB Assembled to find out what JLCPCB have in their catalog.  Type something in the search bar center top, for example TS5V330, press Enter, and you see the list of seven JLCPCB might have in their catalog.  Clicking on one lists parts price (not taking minimum quantities into account!), LCSC stock, and JLCPCB stock for assembly.  If you don't find what you want, click Cancel at bottom right; otherwise click Place and click on the schematic to drop the part there.

Thanks to what I've learned here about the ability to switch off an entire MUX in one go, and experiencing that it's hard to find a single MUX chip with several channels (i.e. 7 or 8 ) along with multiple positions (i.e. 3 or 4) I got the idea that I can probably go for a single position (1:1) MUX with 7 (or more) channels for the new Atari DIN13 output side, and if I recall correctly there are several MUX chips like that to choose from with low resistance and in a solderable package.
Exactly.  I'm playing with a cheap USB to isolated UART-and/or-SPI gadget, and using something very similar to route the signals via the unidirectional isolators (cheaper and more robust).

Also note that there are cheap, tiny "configurable" logic gates like 74LVC1G57 (in SC-74/SOT23-6/SOT457, the 0.95mm pitch size that is still hand-solderable), that you can use to generate the three selector signals based on the three position signals.    Each one has three inputs and one output.  The idea is that to get the logic you want, you tie one or two of the inputs to VCC or GND, so that you get the desired pattern on the output, for enabling the desired muxes/buffers/switches.

How can I find the bandwidth requirement for the Atari ST video output?
TI AN-944 explains this.

Basically, the maximum video frequency is H×V×f/2, where f is the refresh rate (frames per second), V the number of rows per frame, including blanking and retrace intervals, and H is the number of pixels per row, including blanking and retrace intervals.

For the industry standard VESA 640×480 60Hz non-interlaced mode, it is about 12.6 MHz.  I'd say any analog switch with 3db bandwidth wider than 30 MHz or so should work for you.

What I would do if I were you, right now, is a table (spreadsheet, I use LibreOffice Calc).  Allocate one column for each output connector pin.  Allocate one row for each possible mode.  Label each cell with the input connector pin name.  This gives you the states of the muxes/switches in each mode, and the needed switch/mux topology can (often easily) be derived from that.

To post a nice table here, quote this message, and examine the code for the table below.  Each table row is defined on a single row of text.

so perhaps your solution with multiple chips is the way to go.
Just think of it as a bigger MUX/switch IC split into physically separate parts.  Each part gets the same selector/mode signals, and just provides additional channels; like those rotary switches where you can stack additional modules to the same axle, to get more poles.



Consider this example:
$$\begin{array}{l|ccc}
~ & X & Y & Z \\
\hline
1 & A & B & ~ \\
\hline
2 & A & ~ & B \\
\hline
3 & ~ & A & B \\
\end{array}$$
In mode 1, we have X=A, Y=B, Z=not connected.
In mode 2, we have X=A, Y=not connected, Z=B.
In mode 3, we have X=not connected, Y=A, Z=B.

It turns out that we only need four single-pole, single-throw (1:1) switches to implement the above.  All I need to do, is expand the mode to four separate signals.  1 becomes 1010, 2 becomes 1100, and 3 becomes 0101.  First signal controls X:A, second Y:A, third Y:B, and fourth Z:B switch/mux.  The switches/muxes are in parallel, with A going to the first two switches, B to last two switches; X to first switch, Y to middle two switches, and Z to last switch.

Given a three-pole slide switch (SP3T) with a single wiper and three or four pins, I'd need two pull-down resistors and two 74LVC1G45 chips to expand the slide state to those four signal lines.  The wiper I'd connect to VCC, and the two outer non-wiper pins to U and V with pull-down resistors to ground.  Then, in the first state, U=1 and V=0; in the second, U=0 and V=0; and in the third, U=0 and V=1.

The first of the four signals is 1, 1, 0 in the three states.  That's just V inverted; one '1G45 chip.
The second of the four signals is 0, 1, 1 in the three states.  That's just U inverted; one '1G45 chip.
The third of the four signals is 1, 0, 0 in the three states.  That's just U. No chip needed.
The fourth of the four signals is 0, 0, 1 in the three states.  That's just V. No chip needed.

So, this scheme I could implement with the slide switch, two pull-down resistors, two 74LVC1G45 chips (or one 74LVC2G14 dual inverter chip), and four TI TS5A3167 chips, for about 150 MHz bandwidth and 1Ω on-state resistance, assuming all signals are within 0V and VCC, with VCC between 1.7V and 5.5V (for LVC).

Hopefully you can see how I worked it all out starting from the connection table.

However, personally I'd just use one of the cheap microcontrollers to do the mapping.  That way you can ensure all switches are turned off before new ones are turned on; break-before-make, to ensure no shorts occur.  (If above the two first switches are on at the same time, we end up shorting X and Y together.)  You can get Padauk PFS154 in SOP-8 (1.27mm pitch) which costs less than ten cents in singles at LCSC, and is programmable in C using the Free PDK SDCC-based toolchain.  Or, you could use a more powerful RISC-V CH32V203 MCU (GNU RISC-V toolchain) for 0.30€-0.40€, and maybe add indicator LEDs and other niceties.  (See this one for how simple they are to use.)
« Last Edit: October 08, 2024, 09:30:50 pm by Nominal Animal »
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #31 on: October 09, 2024, 02:10:46 pm »
Also note that there are cheap, tiny "configurable" logic gates like 74LVC1G57 (in SC-74/SOT23-6/SOT457, the 0.95mm pitch size that is still hand-solderable), that you can use to generate the three selector signals based on the three position signals.    Each one has three inputs and one output.  The idea is that to get the logic you want, you tie one or two of the inputs to VCC or GND, so that you get the desired pattern on the output, for enabling the desired muxes/buffers/switches.

You're referring to the logic control of the MUX chips here, right?
I think that's an excellent idea because it'll likely mean that I can use a simpler (less poles) 3-way mechanical switch to set the video output mode  :)

Thanks for taking the time to look into all of this and explaining it.
I'll have to take some time to re-read it all to get a better understanding of many of these concepts which are new to me, but I'm slowly getting there I think  ;)

Regarding the abundance of 8-channel 1:1 MUX options (I mentioned earlier) for the Atari DIN13 output; I did some more searching and it appears they're either very expensive, have a high switch resistance (Ron) or come in packages which are hard to hand-solder  :(
But I've downloaded several datasheets, and can get back here with my findings when I'm done comparing.

EDIT: it seems that Texas Instruments appears to have some suitable chips, such as these four 8-channel 1:1 MUXes.

Anyway, I'll take some time to re-read what you've written, compare some datasheets and try to get the table you suggested writing done, then get back here with my findings.

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #32 on: October 09, 2024, 09:11:07 pm »
What I would do if I were you, right now, is a table (spreadsheet, I use LibreOffice Calc).  Allocate one column for each output connector pin.  Allocate one row for each possible mode.  Label each cell with the input connector pin name.  This gives you the states of the muxes/switches in each mode, and the needed switch/mux topology can (often easily) be derived from that.

Hoping I understood you correctly, here's a table I've made which shows which signal pin connects to where for each of the 3 modes:



The blue row shows the Atari ST video signal pins (DIN13 connector).
The green column shows the 3 modes.
The signal names in all the other cell-boxes shows what connects to the Atari DIN13 video connector (empty cell-boxes means that nothing is connected in that mode).
 
« Last Edit: October 09, 2024, 09:15:14 pm by analogix »
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #33 on: October 10, 2024, 04:00:56 am »
You're referring to the logic control of the MUX chips here, right?
Yes, exactly.

That's for the Atari DIN13 outputs; please add the VGA outputs as additional columns too.  Columns where the value is always the same aren't needed.

(To be honest, I could've done it for you using the schematic you posted in the first message; but I'm sneaky, and want you to learn instead of having an answer handed to you.  I'm evil that way, sorry.)

We do need to do the RGB-to-mono combination after the switch, so instead of a single mono, we'll need to treat it as MONO-R, MONO-G, and MONO-B.

There are lots of suitable analog switches at Mouser, Digikey, LCSC, and JLCPCB assembly, and the prices aren't too bad either, something like 3€-4€ for the really good ones (with sub-ohm on-state resistance, hundreds of megahertz of bandwidth, and so on).  I wouldn't bother looking at any specific ones before the needed configurations are known.  Specifically, I do not think you need 8PST switches at all, more like 3P or 4P in ST, and DT with output enable/disable.  Of course, having extra poles in a switch is okay, just connect their inputs to GND or VCC (depending on what the datasheet suggests); having multiples of the same IC is usually better than having different ICs, as long as the price difference isn't huge.
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #34 on: October 10, 2024, 05:18:21 am »
That's for the Atari DIN13 outputs; please add the VGA outputs as additional columns too.  Columns where the value is always the same aren't needed.

(To be honest, I could've done it for you using the schematic you posted in the first message; but I'm sneaky, and want you to learn instead of having an answer handed to you.  I'm evil that way, sorry.)

Hehe, no problem  :)
Although harder, I do appreciate actually learning this instead of just getting an answer, so just continue being sneaky  :-+

But I don't understand about the additional VGA outputs column you ask for, because that's already in the "VGA mono mode" and "VGA colour mode" sections.
What I've done is create a table which shows all the connections of all three modes, but maybe that's not it?
And why should I leave values that are the same out? Surely that's different from signal-pins that aren't connected, but again I have a feeling you're asking me to create a table which shows something slightly different from what I've done here.


Quote
We do need to do the RGB-to-mono combination after the switch, so instead of a single mono, we'll need to treat it as MONO-R, MONO-G, and MONO-B.

You mean, something like this?

« Last Edit: October 10, 2024, 05:35:51 am by analogix »
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #35 on: October 10, 2024, 01:45:25 pm »
Have you checked out ubeswitch mk6?

What I've done is create a table which shows all the connections of all three modes, but maybe that's not it?
Here's what I was hoping to see, based on your initial schematic:
Code: [Select]
        ║ Atari DIN13 Output        ║ VGA Output        │  (Mono)   ║
Mode    ║ M │ D │ H │ V │ R │ G │ B ║ H │ V │ R │ G │ B │ r │ g │ b ║   Inputs:
════════╬═══╪═══╪═══╪═══╪═══╪═══╪═══╬═══╪═══╪═══╪═══╪═══╪═══╪═══╪═══╣   M = DIN13 pin 11
Atari   ║ M │ D │ H │ V │ R │ G │ B ║   │   │   │   │   │   │   │   ║   D = DIN13 pin 4
────────╫───┼───┼───┼───┼───┼───┼───╫───┼───┼───┼───┼───┼───┼───┼───╣   H = DIN13 pin 9
VGAMono ║   │   │   │   │   │   │   ║ H │ V │   │   │   │ R │ G │ B ║   V = DIN13 pin 12
────────╫───┼───┼───┼───┼───┼───┼───╫───┼───┼───┼───┼───┼───┼───┼───╣   R = DIN13 pin 7
VGA     ║   │   │   │   │   │   │   ║ H │ V │ R │ G │ B │   │   │   ║   G = DIN13 pin 6
────────╨───┴───┴───┴───┴───┴───┴───╨───┴───┴───┴───┴───┴───┴───┴───╜   B = DIN13 pin 10
This assumes that in Atari mode, VGA outputs are disabled; that in VGA modes, Atari output is disabled; and that Atari outputs RGB even in mono mode.

According to this post, Atari outputs only Mono signal in mono mode (not R, G, B signals), and the input DIN13 pin 4 needs to grounded to enable Mono mode (floating otherwise):
Code: [Select]
    Input D ║ Atari DIN13 Output        ║ VGA Output        ║
Mode    ║   ║ M │ D │ H │ V │ R │ G │ B ║ H │ V │ R │ G │ B ║   Inputs:
════════╬═══╬═══╪═══╪═══╪═══╪═══╪═══╪═══╬═══╪═══╪═══╪═══╪═══╣   M = DIN13 pin 11
Atari   ║   ║ M │ D │ H │ V │ R │ G │ B ║   │   │   │   │   ║   D = DIN13 pin 4
────────╫───╫───┼───┼───┼───┼───┼───┼───╫───┼───┼───┼───┼───╣   H = DIN13 pin 9
VGAMono ║Gnd║   │   │   │   │   │   │   ║ H │ V │ M │ M │ M ║   V = DIN13 pin 12
────────╫───╫───┼───┼───┼───┼───┼───┼───╫───┼───┼───┼───┼───╣   R = DIN13 pin 7
VGA     ║   ║   │   │   │   │   │   │   ║ H │ V │ R │ G │ B ║   G = DIN13 pin 6
────────╨───╨───┴───┴───┴───┴───┴───┴───╨───┴───┴───┴───┴───╜   B = DIN13 pin 10
instead, preferably with voltage divisors between M input and each of the VGA R, B, G outputs.  (As there is already a 75Ω resistor in the STe on these, it is just a matter of adding suitable resistance, for example a 100Ω trimpot, to ground.)
In order for those voltage divisors to not affect the signal when used, they need to be isolated on both sides, so the RGB selection needs three 3PST switches.  The VGA sync signals only need a DPST.  I'd use one of the SOT23 SPST or SPDT switches for grounding the input D pin in VGA mono mode.
For the Atari mode, a 7PST (or say two 4PST) analog switch is needed.

Also, consider whether you'd prefer to use two switches, selecting between Atari and VGA outputs; with a second one selecting between Mono and Color for the VGA only.  Changing it while in Atari mode would not affect the input D pin; it would only be grounded in the VGA mode.



You could also support both Atari and VGA outputs simultaneously.  Attached is a rough sketch on how I might try to do it, using very cheap components from Mouser in TSSOP-14/16, omitting the logic (switch enable logic) and H/V sync signals, and assuming no adjustment is needed between the Atari and VGA RGB signal levels; if adjustment is needed, then the two sets of three 75Ω resistors must be adjusted as needed.  U1 buffers the signals to the Atari output connector.  U2 buffers the RGB signals for the VGA connector.  U3 buffers the mono signal to RGB on the VGA connector.  U4 selects between mono and color VGA output.  All video signals are DC-coupled.  The input impedance of THS7374 is about 800kΩ, and the on-state resistance of the TMUX1574 is typically 2Ω, maximum is 4.5Ω.  And yes, one could replace one of the THS7374s with a TMUX1574, but the former are much cheaper than the latter.  Gah, I had to edit this attachment four five times!

Mouser sells THS7374IPWR for about 0.35€ apiece in singles, and TMUX1574PWR for about 0.57€ in singles, so the BOM cost for U1-U4 is just 1.62€.
Edited to add: For sync signals, two TS5A22364DGSR would do, which Mouser sells for about 0.78€ in singles.  The rest is capacitors, resistors, and the digital logic to enable the desired ICs in different modes.  If you used three SPDT switches – one to enable/disable the Atari output, one to enable/disable the VGA output, and one to select between mono and RGB for VGA output –, and a SP3T switch to control the Mono Detect the STe sees (per Atari output, Color, Mono), no logic chips would be needed.
« Last Edit: October 10, 2024, 02:55:22 pm by Nominal Animal »
 
The following users thanked this post: analogix

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #36 on: October 10, 2024, 05:24:07 pm »
Attached is a more complete schematic.  Still lacks the 5V supply, and the supply bypass capacitors for the ICs, plus the connectors.  Suggested bypass capacitors are mentioned in the datasheets.  IN_ refers to input Atari pins, ATARI_ to output Atari pins, and VGA_ to VGA connector pins.  Blue net ports are analog signals, green ones are digital signals.

Two SN74LVC1G97 multifunction logic gates are used to disable the video amplifiers when not needed, to save power.
As the THS7374 input impedance is around 800kΩ, enabling/disabling an output should not visibly affect the other outputs.

One NX138AKR N-channel MOSFET is used to detect the MONO_DETECT state on the Atari input connector, and invert it for use as VGA_MONO in autodetect mode.  This is a cheap MOSFET, similar to BSS138, but slightly faster (lower gate capacitance).  Any logic-level N-channel MOSFET will do, especially BSS138.

At the bottom, you have two three-way toggle switches (SP3T), and two two-way toggle switches (SPDT).
The first three-way toggle switch controls the Atari STe video mode.
The next three-way toggle switch controls the VGA color/mono mode.
The next two-way toggle switch controls the Atari output.
The final two-way toggle switch controls the VGA output.

If you want LEDs to indicate if an output is enabled, you connect the LED cathode to ATARI_DIS or VGA_DIS.
To indicate Mono mode, use another NX138AKR with gate on IN_SELECT, source to GND, and drain to the LED cathode.
To indicate Color mode, use another NX138AKR with gate on the top input pin of SW2, source to GND, and drain to the LED cathode.
In both cases, connect the LED anode to a current-limiting resistor, and the resistor to +5V.  Each LED needs their own current-limiting resistor.
If you want LED current I, and its voltage drop is Vf, use a resistor value of R=(5V - Vf) / I.

Adjusting the 75Ω resistors (4+3+3) in the center of the schematic adjusts the corresponding signal voltage levels.  I'm not sure if 75Ω is correct, because the video amplifiers do have a 3db amplification.

If FILTER_ENA is connected to GND, the video signals are filtered by the amplifiers with a 9 MHz low-pass filter.
If FILTER_ENA is connected to +5V, the amplifiers have about 150 MHz of bandwidth.  I *think* FILTER_ENA should always be connected to +5V with these amplifiers.  And yes, I should have named it FILTER_BYPASS or FILTER_DIS(able).

Do not trust this schematic as-is, since even I wouldn't.  But it should show you an interesting approach to solving your problem, I hope.
« Last Edit: October 10, 2024, 05:31:52 pm by Nominal Animal »
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #37 on: October 13, 2024, 09:06:50 pm »
Have you checked out ubeswitch mk6?

Absolutely!
In the Atari online community (which is still active) there's for a long time been DIY solutions for VGA adapter cables (one type for each video mode) and "multisync" switchboxes. I built and used such a switchbox back when I had an NEC Multisync II (which was capable of displaying both video modes) connected to my Atari STe.

The Ubeswitch is (as far as I can tell from the schematics) the same thing as the multisync switchbox, but with a MUX instead of the large switch along with a more practical design (it plugs directly into the DIN13 output and has an HD15 plug on the same PCB -someone has also designed a 3D-printable plastic enclosure for it).
Version 6 (which you linked to above) has some built in logic/memory (ATtiny25) which is a little outside my understanding, but as far as I can tell it relies on a single momentary pushbutton which is used to change the video mode, controlling the MUX and has the ability to store the last used setting in its flash memory. Basically a VGA multisync adapter with memory for the switch setting.

So.... after having learnt a lot of new things from you, BrianHG and others in this thread along with studying many schematics and datasheets I believe I have a general idea on how to work out a solution:


Explanation of the above:
Basically I'm thinking of two separate "zones" (VGA output and the new Atari output) isolated from each other by switching off the opposite zone's MUX (using the EN pin) so they don't interfere with each other.
"Atari zone" just passes all the 13 signals along to the new DIN13 connector. The job of its MUX is only to pass through or stop all signals at once.

"VGA zone" will basically be the same thing as a Ubeswitch, but with some minor (but important) differences.
The actual Ubeswitch has a 2-way MUX but with only 4 channels. But with the added Atari DIN13 output I need to separate all the shared signals, so I'm counting 7 signals which both zones use, but that I don't want to be active in both zones at once.
Therefore, as I see it, the VGA zone also needs a 7-channel MUX in order to break those signals from reaching the new Atari DIN13.


Moving on to a more detailed explanation....
As posted before, here's a diagram showing my proposal with two 7-channel MUXes (the "VGA zone" one having two-way switches and the "Atari zone" MUX just needing one-way switches).
As for switching modes, I'm thinking back to what you suggested about using one/several logic chips and that this could let me get away with perhaps just a single pole 3-way switch. Obviously I need to know how many different logic outputs are needed for the MUXes, and if they're high or low, and that's something I intend to do in a table, but after we've decided on which MUXes to use as the don't appear to have a common standard.



Finally, here's the same principle as above but with multiple 4-channel MUXes (as you suggested earlier, based on the difficulty in finding larger MUXes). I believe the following parallel connections to the SEL (select) and EN (enable) pins will work to control several MUXes at once in the same way (i.e. two 4-channel muxes will behave like 8-channels).





Quote
Here's what I was hoping to see, based on your initial schematic:
Code: [Select]
        ║ Atari DIN13 Output        ║ VGA Output        │  (Mono)   ║
Mode    ║ M │ D │ H │ V │ R │ G │ B ║ H │ V │ R │ G │ B │ r │ g │ b ║   Inputs:
════════╬═══╪═══╪═══╪═══╪═══╪═══╪═══╬═══╪═══╪═══╪═══╪═══╪═══╪═══╪═══╣   M = DIN13 pin 11
Atari   ║ M │ D │ H │ V │ R │ G │ B ║   │   │   │   │   │   │   │   ║   D = DIN13 pin 4
────────╫───┼───┼───┼───┼───┼───┼───╫───┼───┼───┼───┼───┼───┼───┼───╣   H = DIN13 pin 9
VGAMono ║   │   │   │   │   │   │   ║ H │ V │   │   │   │ R │ G │ B ║   V = DIN13 pin 12
────────╫───┼───┼───┼───┼───┼───┼───╫───┼───┼───┼───┼───┼───┼───┼───╣   R = DIN13 pin 7
VGA     ║   │   │   │   │   │   │   ║ H │ V │ R │ G │ B │   │   │   ║   G = DIN13 pin 6
────────╨───┴───┴───┴───┴───┴───┴───╨───┴───┴───┴───┴───┴───┴───┴───╜   B = DIN13 pin 10
This assumes that in Atari mode, VGA outputs are disabled; that in VGA modes, Atari output is disabled; and that Atari outputs RGB even in mono mode.

That sounds right, though I don't know about the last part (Atari outputs RGB even in mono mode).
Even so, those R,G and B signals are disconnected from the HD-15 connector in mono mode.





Quote
According to this post, Atari outputs only Mono signal in mono mode (not R, G, B signals), and the input DIN13 pin 4 needs to grounded to enable Mono mode (floating otherwise)

Yes, pin 4 (monochrome detect) determines the video mode which the computer boots/reboots into.
When an Atari monochrome monitor (typically Atari SM-124, SM-125 or SM-144) is attached, then pin 4 and pin 13 (GND) are connected together (internally, inside the monitor), making the computer boot (or reboot if the monitor's cable is attached after the computer has already been powered on) into monochrome high resolution (640x400) mode.

With a VGA monitor on the other hand there's no such 'automatic' action, so we have to force pin 4 to GND in order to set it to monochrome mode. I admit I don't know much more about how this all works in detail, but suffice to be able to choose between Atari ST colour and mono modes then pin 4 is the key to this.




Quote
Also, consider whether you'd prefer to use two switches, selecting between Atari and VGA outputs; with a second one selecting between Mono and Color for the VGA only.  Changing it while in Atari mode would not affect the input D pin; it would only be grounded in the VGA mode.

I prefer a single 3-way slide switch for this (Atari/VGA mono/VGA colour).


Quote
Attached is a more complete schematic.

Thanks for taking the time create those! I've taken a look and read through what you've written but need a little more time to process and understand it all.
Please excuse my ignorance, but is this a just a different way to do it compared to the diagrams I've enclosed in this posting, or will the ones in my diagrams not work properly and I need to look into another way, such as your idea in the schematics?



« Last Edit: October 13, 2024, 09:15:23 pm by analogix »
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #38 on: October 14, 2024, 07:40:28 am »
It would be easier to read your diagrams if you used the actual signals instead of broad strokes –– it's annoyingly vague, really! ––, and perhaps SPDT switches for illustration; similar to the schematic in the first image.

See attached, with switching units just marked with the switch type, and numbered on top left corner for reference.  Switch 2, the SPST, should probably be an amplifier, and/or followed by an amplifier (so splitting switch 1 into 3PST and a video amplifier with enable/disable).  I've omitted the logic control, grounds and VCCs, for simplicity too.

is [the more complete schematic] just a different way to do it compared to the diagrams I've enclosed in this posting
In essence, THS7374IPWR can be used as a 3PST or 4PST switch, but as it is an amplifier with high (800kΩ) input impedance, you need to terminate the incoming RGB and Mono signals via 75Ω resistors to ground, and use 75Ω resistors on the outputs.  If one or more of the channels is unused, both the input and the output of that channel are connected to ground.

If we ensure at most one of the two THS7374IPWR's connected to the VGA output is enabled at any given time, then we can omit the TMUX1574, and just join the respective channels of the two THS7374IPWR's before the 75Ω resistors, and the resistors connected in series to the VGA RGB pins.

As Mouser sells THS7374IPWR for 0.34€ in singles, those are an easy way of handling the video part of the multiplexing.  You just need some careful logic control of the DISABLE pins on them.

Edited to add: As THS73741IPWRs are amplifiers and not just switches, it means the "downstream" stuff won't affect the signal source.  That is why one could use both the Atari and the VGA output at the same time, as long as one uses non-inverting buffers for Hsync and Vsync also; say, a pair of  74AHC2G241 (one pair suffices for both the Atari and the VGA output, because one half of the chip uses active-low and the other half active-high enable).

The three THS7374IPWR take care of switches 1, 2, 5, 6 in the attached diagram.

Switches 3 and 7 are two digital DPST switches or buffers for the horizontal and vertical sync, one for VGA output and the other for Atari output.  The maximum frequency is less than 20 kHz, so both are within audio range.  Easiest would be one TC7WB66CFK and one TC7WB67CFK, as they are the same chip except one uses enable low and the other enable high, so a single signal would choose between the two.  I think I'd prefer 74AHC2G241 buffers, though.

Switch 4 is also digital (forgot to mark it, darnit!), and one or two 74LVC1G66 or 74LVC1G384 should work well for it.  One connects the input Select to output Select, and the other connects the input Select to Ground.  In Atari output mode, the first is enabled.  In VGA mono mode, the second is enabled.  In VGA color mode, neither is enabled.

Now, as to how this correlates to your diagrams: I can't parse your diagrams well enough to say; sorry.  I'm sure to you they are obvious, but I just cannot tell exactly what I'm seeing.

As to the three-position slider switch: Doable, sure.  It will only need to pass enough current for enable signals (less than a milliamp), and you'll need some logic chips to implement the three states.  Only needs a couple of the multifunction logic gates.  I haven't worked out the logic map for a three-position slider switch, but it won't be more than two or three of the little buggers.

All in all, I'd say you should easily get the IC cost down to 5€ or so.  The connectors will be the most expensive part, I reckon.



A completely different approach would be connect a fast MCU directly to the video shifter (R0-3, G0-3, B0-3, Mono) plus Hsync and Vsync via two SN74LVC8T245 level shifters (from 5V to 3.3V or lower that the MCU needs), and generate pixel-perfect VGA or DVI/HDMI video in standard resolutions.  This Github repo indicates an RP2040 should be able to do it; perhaps using Adafruit Feather RP2040 with DVI (details).  Note that you can use a DVI-D to HDMI cable to connect this to any HDMI monitor or TV.
« Last Edit: October 14, 2024, 08:59:18 am by Nominal Animal »
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #39 on: October 14, 2024, 06:12:26 pm »
It would be easier to read your diagrams if you used the actual signals instead of broad strokes –– it's annoyingly vague, really! ––, and perhaps SPDT switches for illustration; similar to the schematic in the first image.

..........

Now, as to how this correlates to your diagrams: I can't parse your diagrams well enough to say; sorry.  I'm sure to you they are obvious, but I just cannot tell exactly what I'm seeing.

Yes, I understand what you mean. Sorry about that.
I'll make a more detailed diagram to illustrate what I'm thinking, then take it from there.
 
The following users thanked this post: Nominal Animal

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #40 on: October 15, 2024, 10:50:57 am »
Thanks!  And don't take it as negative; I'm just blunt with no social skills, that's all.

And others, please don't let me hog the thread.  I'm just a hobbyist myself, with some interest in generating video with microcontrollers (albeit mostly to small IPS panels from EastRising/BuyDisplay): I'd like to find out a way to add small status displays to gadgets like routers and NASes that describe their status intuitively to non-technical users without having any way of said users accidentally disabling the device via that UI.
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #41 on: October 15, 2024, 04:23:19 pm »
No problem  ;)
I'm currently busy drawing a proper schematic and will post here when done.
EDIT: OK, done! Here it is (attached)

In the schematic I've used four TS5V330PWR MUX chips, as used in the Ubeswitch. The VGA part is based on the Ubeswitch version 5.
I have ideas for other, better MUX chips including the ones you've suggested earlier, but for the schematic it illustrates my general idea.
I haven't included the resistors (as I have some undecided thoughts/ideas on that), and likewise there are some improvements to the signal which I'm thinking might be useful to add, but this schematic is the general idea.

Each "zone" (VGA zone, Atari zone) contains two MUX chips, giving a total of 8 channels. The logic control pins (EN and SEL) for each pair are connected together for the same behaviour, so in essence each pair should act like a single 8-channel, 2-way MUX.
I haven't drawn the actual logic controls, but we've discussed that earlier and it will be based on a physical/mechanical 3-way slide-switch which in turn controls some logic chips (which is a bit over my head at the moment, so I don't have that part worked out yet), but as I understand it can be set up to give the correct combination of logic signals for both zones' MUX chips.

As for the actual logic signals needed: I don't have that worked out yet as different MUX chips appear to use different combinations of those, but to summarize, this is what I want those signals to do in each mode:

Atari mode:  enable Atari-MUX (U1 and U11) while disabling the VGA-MUX (U2 and U22)
VGA mono mode: disable Atari-MUX (U1 and U11) while enabling the VGA-MUX (U2 and U22). SEL (select) for the VGA-MUX is set for group 2 switches
VGA colour mode: disable Atari-MUX (U1 and U11) while enabling the VGA-MUX (U2 and U22) -same as for VGA-mono mode. SEL (select) for the VGA-MUX is set for group 1 switches
« Last Edit: October 16, 2024, 11:23:48 am by analogix »
 

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #42 on: October 17, 2024, 02:20:56 pm »
Thanks!  Yes, I do believe we are in full agreement.

I do believe your schematic can be implemented using THS7374IPWR amplifiers (Mouser 0.34€ apiece, JLCPCB/LCSC part C2652746, at JLCPCB for assembly at 0.38€ apiece), some 75Ω resistors (since amplifiers need inputs to be terminated for good signal quality; and as these have gain 2, they also need an outgoing 75Ω resistor to limit the signal level; adjusting these resistors adjusts also the signal voltage levels), and two '2G241 switches for the sync signals, say TI SN74LVC2G241DCUR (Mouser 0.47€ apiece, LCSC part C10430, at JLCPCB for assembly at 0.31€ apiece).

The amplifiers take logic low (GND) for enable, high for disable, and the '2G241 have one of both, so the slide switch can connect the wiper to ground, with some very weak pull-ups, say 10kΩ or more, since the enable signals only draw microamps.

I do believe (but have not verified) that the attached schematic would work.  The BOM cost is around 6€ or so, including the connectors, so not expensive at all.  No BGA or QFN packages; the trickiest to solder are the 0.65mm pitch U1-U5, but everything should be hand-solderable with flux (and braid to suck up any solder bridges if you use too much solder).  I would definitely use a four-layer board, and solder the components myself.

(By the way, I looked at the Atari STe video timings, and noticed that for NTSC, the medium and low modes fit pretty neatly within standard VGA 640×480 60Hz mode if scanline-doubled.  Essentially, you need a tiny FPGA that has 24000 bits or more of embedded RAM, and can run at 24+ MHz (25,196,800 Hz would be optimal), connected to 12 of the shifter RGB pins plus Hsync and Vsync pins, and the same for outputs, with resistor dividers and a THS7374 amplifier for the video output, and a '2G241 for the sync signals).  In very real sense, it would be a simple double-buffered shift register, and only add one or two scan line latency, or about 0.1ms to 0.2ms, to the video output.)
« Last Edit: October 17, 2024, 02:24:27 pm by Nominal Animal »
 
The following users thanked this post: analogix

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8115
  • Country: ca
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #43 on: October 17, 2024, 04:45:35 pm »
Warning on the VGA HD15 video output plug.  Some modern monitors look for the 5v signal as a key to sense if they should be in sleep mode, or when to auto power up...

See pin 9 in attached image.


I would just feed 5v through a 100 ohm resistor into this pin.  The 100ohm resistor is to prevent shorting out your circuit in case of a problem.

Also pay attention to all the other GNDs.
 
The following users thanked this post: analogix, Nominal Animal

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #44 on: October 18, 2024, 07:44:51 am »
Thanks, BrianHG!

In case anyone is interested, the above schematic I cobbled together –– I even used net flags instead of wires :-- –– is available at https://oshwlab.com/nominalanimal/atari-ste-video-switch, and is dedicated to Public Domain per CC0 1.0 Universal.  I added the 5V supply through a 100Ω resistor to VGA pin 9 as BrianHG suggested, and included three LEDs (about 3mA at 2.0V forward voltage, when using 1kΩ current-limiting resistors) to indicate the currently selected mode.

You can open the schematic in EasyEDA online editor using the Open in Editor link on the right edge under the schematic itself, making it easy to create a PCB design, and order it from JLCPCB.  Although JLCPCB should have the important components available for assembly –– check the capacitors and resistors, and pick the size and model you prefer ––, I would recommend creating a four-layer board, and soldering the components to it yourself.  Don't forget to add 2.5mm (M2.5 or #2-56) or 3mm (M3 or #4-40) mounting holes for your PCB, with good clearance for the screw heads, for ease of mounting.

Beware: It is not tested, nor verified!  The schematic was created to illustrate the idea of using cheap video amplifiers as analog switches and digital buffers/switches for sync signals, all controlled by a SP3T switch.  (I'd use a toggle switch instead of a slide switch myself; maybe even use a four-pin connector on the PCB for the switch, because it is the most likely thing one may wish to change.)  Because the amplifiers have active-low enable signals, and the buffers both active-low and active-high enable signals, having the enabled output low and all others high suffice; we do not even need any logic gates here!

Although I'm pretty sure the logic is correct, I haven't really verified it, and I do not really trust it is correct.  So use at your own risk, please!  Or, best of all, take the ideas in it, and create your own, an even better one!
« Last Edit: October 18, 2024, 07:47:48 am by Nominal Animal »
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #45 on: October 18, 2024, 12:17:44 pm »
Thanks!  Yes, I do believe we are in full agreement.

Excellent!
And thanks for taking the time to create your schematic and making it available at OSHWlab  :-+
I'd like to study and understand it better (I've had a few quick looks already), but for now, to simplify things, I prefer sorting out the details of my own schematic which I already understand the basics of and am more familiar with. Hope you don't mind  :)

First, choosing suitable MUX chips.
The MAX4885 is now out of the questions because of it's physical design (hard to hand-solder).

There's the TS5V330 (4-channel, 2-way) which is proven to work with the Atari ST video signal as it's the one used in the Ubeswitch.

On the other hand, the TS5V522C (5-channel, 2-way MUX) seems very similar, but has an additional channel and built in H-sync and V-sync buffering. Like the TS5V330 it also runs on 5V and has a switch resistance of 3 Ohms. Both are marketed for video applications.
So, regardless of either I'd need two of these for each output (7 channels need to be switched), totalling 4 chips.

For the Atari output I only need 1-way switches (which will be permanently on) and using the SEL input to shut on or off the entire chip, so I've looked at 8-channel chips for this:
MAX4781 (8-channel, 1-way) has a very low switch resistance (0.7 Ohms), is available in TSSOP but is expensive (almost US$ 7), runs at 3V instead of 5V and the datasheet doesn't say anything about video applications, so I'm not sure if it's suitable.
Will a switch resistance of 0.7 vs. 3 Ohms make a visible difference, justifying the much higher cost of this MUX, or is it just a waste of money as it'll be just the same in real life use?

Other 8-channel, 1-way MUXes, but that are much cheaper (similar to TS5V522C or TS5V330C) are: SN74CBT3244CPW, SN74CBT3245CPWR and SN74CBT6845CPWR.
They all have 3 Ohm switch resistances, can be hand-soldered and run at 5V, but perhaps there's no advantage of using a single one of these over two of the ones I suggested first?

PS: I know you've suggested the THS7374IPWR, but this isn't a MUX, is it? The datasheet says "video amplifier", but at the same time it appears to have the ability to shut off the signal flow (with the DISABLE and/or BYPASS pins), so in essence it'll work in the same way as I want to set up my Atari-side MUX where I just "let all 7 signals through" or "stop all 7 signals"? I couldn't find the switch resistance other than perhaps "Output impedance: 0.7 Ohms" -is this it?

I have some other questions about the resistors, grounding etc. but this for now.
« Last Edit: October 18, 2024, 01:20:10 pm by analogix »
 

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #46 on: October 18, 2024, 12:36:23 pm »
Warning on the VGA HD15 video output plug.  Some modern monitors look for the 5v signal as a key to sense if they should be in sleep mode, or when to auto power up...

Thanks. I wasn't aware of this signal and have added it to my schematic as you suggested.
Will a modern monitor possibly fall into sleep if +5V isn't supplied to that pin?

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. Since this isn't even a PC, and with the risks involved, would it be just as good to leave it out altogether? Alternatively I could make provisions for it, but leave out the 100 Ohm resistor when assembling the board (effectively disconnecting pin 9 from +5V), but allowing the possibility if someone else wants to use my design and finds out they need it.


Quote
Also pay attention to all the other GNDs.

I was wondering about the grounding -if I should connect all GND together or not. And if I'm going to rely on external power (+5V directly from the computer's power supply) and not a 12V to 5V regulator (fed from the +12V pin from the Atari video output connector) I'm wondering if I should leave out the GND wire between the power supply's GND and this VGA output PCB (because there's already a GND connection from the video output connector to my VGA board, and I'm thinking it might cause a ground-loop).
Thoughts on that?

Online Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6942
  • Country: fi
    • My home page and email address
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #47 on: October 18, 2024, 03:06:06 pm »
On the other hand, the TS5V522C (5-channel, 2-way MUX) seems very similar, but has an additional channel and built in H-sync and V-sync buffering. Like the TS5V330 it also runs on 5V and has a switch resistance of 3 Ohms. Both are marketed for video applications.
So, regardless of either I'd need two of these for each output (7 channels need to be switched), totalling 4 chips.
The one issue I see is the impedance on the monochrome video signal when converting to VGA.

On the display end, these should have a transmission line with 75Ω impedance.  If we look at e.g. this STe video schematic, it looks to be closer to 27Ω (Q403, a 2N3904 NPN transistor is used as the signal driver in emitter follower configuration, with R438 setting the source impedance).  It is pretty close, though, so it might just work, but personally I'd prefer using a video amplifier to ensure good signal drive. (The THS7374 are designed to be able to drive two parallel outputs, so they have ample strength.)

Without the monochrome signal or mixing, the 5-channel switches (for RGB signals only) would be perfect.

A secondary issue is that the sync signals are not really split into three, but only into two; and the Mode Select is a digital open collector signal that is connected to either the Atari connector, to ground, or left floating.  They are TTL digital signals between 0V and 5V.  (The high-frequency video signals should be between 0V and 0.7V or so.)

So, counting "7 per output" is pessimistic, doing it the hard way; using separate switches to do the exact same thing.  If you count my schematic, I have 12 analog switches (10 video amplifier channels, 2 one-channel TS5A3159 for Select signal), and four digital switches (for hsync and vsync signals), or 16 in total.  It's only three quarters of 3×7=21.

For the Atari output I only need 1-way switches (which will be permanently on) and using the SEL input to shut on or off the entire chip, so I've looked at 8-channel chips for this:
Why do you believe using a single IC for switching the entire set of signals is better than two or more ICs?

Even routing is more difficult with just one single IC, because the signal order is all different in the VGA vs. the 13-pin DIN connectors.  If you have the switches in separate ICs, routing the signals is easier.  Plus, you can then route the analog video signals separately, perhaps even using width and distance to surrounding ground traces to get an input impedance close to 75/27 ohms on the RGBM signals, for best video quality.

Really, I see only downsides in stuffing both the analog and the digital signals into the same IC.  For one, the analog video signals are just 0-1V or so, while the sync signals are 0V-5V TTL.

Will a switch resistance of 0.7 vs. 3 Ohms make a visible difference, justifying the much higher cost of this MUX, or is it just a waste of money as it'll be just the same in real life use?
I believe any analog switch will have worse visual quality than the THS7374 video amplifiers.

Will it be actually discernible, visible, in real life use?  I don't know; I don't have enough practical experience.  I did have a Commodore C128 way back in the day, and even a NEC Multisync 2a 14" (my first Intel compatible was a '286 with an ATi EGA Wonder), so I know what you worry about.  It is also why I'd be more interested in picking up the video signal digitally at the video shifter, and producing a genuine VGA-compatible video signal in all modes.. one could experiment with it using e.g. Olimex iCE40HX1K-EVB, iCE40-DIO for interfacing to the shifter 5V logic, and iCE40-IO for the VGA output.  NTSC or 60 Hz Atari STe is much easier, because scan doubling the color modes will bring it within a fraction of a percent of standard VGA timings (although video aspect ratio might be wonky). PAL 50 Hz color modes will need every second frame doubled, to get to 75 Hz that most displays accept.  For NTSC/60 Hz Atari STe, DVI/HDMI output should be possible with just Adafruit Feather RP2040 DVI and level shifters (two '8T245 or one 16T245); if the video shifter can be desoldered and put on a socket, one could do a removable interposer PCB with pixel-perfect TFT-compatible DVI/HDMI output.)

PS: I know you've suggested the THS7374IPWR, but this isn't a MUX, is it? The datasheet says "video amplifier", but at the same time it appears to have the ability to shut off the signal flow (with the DISABLE and/or BYPASS pins), so in essence it'll work in the same way as I want to set up my Atari-side MUX where I just "let all 7 signals through" or "stop all 7 signals"? I couldn't find the switch resistance other than perhaps "Output impedance: 0.7 Ohms" -is this it?
No.  Consider it as something that takes the original signal, and then retransmits it.  You set the output impedance via series resistors; R5-R8, R9-R11, R12-R14 in my schematic.  Its input impedance is very high (800kOhm for THS7374), which is why the input signals must be terminated to ground.  (In fact, I need to adjust R4 in my schematic, because the proper termination for the monochrome signal is about 27 ohms and not 75.)

Analog muxes and switches act like a load on the signal, whereas these video amplifiers, well, buffer it.  For amplifiers, what matters is their frequency response.  The worst case Atari video signal is monochrome with every other pixel black, every other white.  The fundamental frequency of that is about 14.3 MHz, but "perfect" reproduction would be a rectangular signal; something like 10 times the fundamental frequency in signal bandwidth is generally considered sufficient to represent even non-sinusoidal signals.  Thus, to reproduce your video signal "perfectly", we might need up to 143 MHz of analog signal bandwidth.  The THS7374, in bypass mode as in my schematic, have 150 MHz of bandwidth, so they should be able to reproduce the video signals the Atari generates.  As no amplifier is perfect, we also need to look at distortion, crosstalk, signal to noise ratio, power supply rejection ratio, which are all comfortably low for THS7374; considering that 42dB corresponds to 8-bit dynamic range.

(When the THS7374 is "off", it has about 20kOhm input impedance.  Since the input has those 75 Ohm resistors to ground, that added 20k in parallel decreases the termination by 0.28 Ohms, or by about 0.37%.  When you use three THS7374's in parallel as in my schematic, there are always two off in parallel, so the effective termination resistance (assuming no resistance in PCB traces and perfectly accurate resistors) is about 74.44 Ohms.  This varies only by the amount of variation between different THS7374 IC's, and is neglible in my opinion.)

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!
 
The following users thanked this post: analogix

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 8115
  • Country: ca
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #48 on: October 18, 2024, 08:18:08 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)

Don't worry about the DDC pins.  Ignore them.  If you were making a PC graphics card, you would read these to see which video modes/scan rates the monitor can support.  The 5v was originally intended to power a small I2C prom inside the monitor.  However, during the more modern LCD days, sometimes a few monitor brands have also used it as a sense for a 'deep sleep' power down mode.  Other monitors still rely on having some of their circuitry powered up to sense activity on the sync lines.
 
The following users thanked this post: analogix

Online analogixTopic starter

  • Regular Contributor
  • *
  • Posts: 215
  • Country: no
Re: VGA display switching with debouncer/multiplexer/buffer circuitry?
« Reply #49 on: October 18, 2024, 08:50:48 pm »
On the other hand, the TS5V522C (5-channel, 2-way MUX) seems very similar, but has an additional channel and built in H-sync and V-sync buffering.

The one issue I see is the impedance on the monochrome video signal when converting to VGA.

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:






Quote
Without the monochrome signal or mixing, the 5-channel switches (for RGB signals only) would be perfect.

How about using the TS5V522 (or TS5V330) for those signals, and a different model MUX for the rest?



Quote
For the Atari output I only need 1-way switches (which will be permanently on) and using the SEL input to shut on or off the entire chip, so I've looked at 8-channel chips for this:
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.


Quote
Even routing is more difficult with just one single IC, because the signal order is all different in the VGA vs. the 13-pin DIN connectors.  If you have the switches in separate ICs, routing the signals is easier.  Plus, you can then route the analog video signals separately, perhaps even using width and distance to surrounding ground traces to get an input impedance close to 75/27 ohms on the RGBM signals, for best video quality.

Ah! I hadn't thought of that. Good point!



Quote
Really, I see only downsides in stuffing both the analog and the digital signals into the same IC.  For one, the analog video signals are just 0-1V or so, while the sync signals are 0V-5V TTL.

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? 

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!
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.
I do understand bits and pieces, but not the overall circuit idea, so please bear with my newbie questions.
But one step at a time and I'll get there eventually  :)
« Last Edit: October 18, 2024, 10:55:47 pm by analogix »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf