Jump to content
IGNORED

[AQUARIUS] RGB interface with pixel correction


Recommended Posts

A while back I posted the circuit of my RGB interface for the Aquarius. It worked well, but one problem still bugged me - sub-pixel vertical lines between some characters. It occurs due to delays in switching between character and pixel colors in the Aquarius. In the screenshot below you can see these lines in the lower angled parts of the 'U' and 'S'.

 

Why there but not in other places with similar shapes? The Aquarius character set has a limited number of graphics characters, so these shapes were created by using the opposite sloped shape and inverting the foreground and background colors. But the character colors are switched slightly before the pixel colors, so for an instant they don't match. The right lower part of the 'S' is character #192, visually inverted by setting foreground/background colors to cyan/black. The next character is a normal Space (character #32) with colors black/cyan. The black line occurs when the (normally invisible) foreground color changes to black before the first cyan pixel of the Space appears.

 

If you look closely you can see that all the black pixels on the right-hand side of the 'S' are slightly stretched. This is caused by the 'preload' delay in the 74LS165 shift register in the Aquarius's video circuitry. After the last pixel of a character is sent out the next character's pixels are loaded into the shift register. During this time the previous pixel remains on the output, so it becomes 'stretched'. This delay is what causes the color mismatch.

 

To fix this problem I added a register to the input of my RGB interface. This lets the digital color inputs stabilize before being clocked into the analog converter by the pixel clock. You can see the results in the second image below - no vertical lines and all the pixels are the same width.

 

I am now designing a surface mount PCB for this project. If I can make it small enough there might be sufficient room to add composite output as well.

post-40459-0-33904300-1497643252.jpg

post-40459-0-39672200-1497646135.jpg

post-40459-0-88895700-1500964768_thumb.png

Edited by Bruce Abbott
  • Like 8
Link to comment
Share on other sites

Excellent work! It's possible to detect this slight color distortion in inverted characters even on a stock Aquarius, if the TV is tuned just right, so you've succeeded in correcting a longstanding flaw in the Aquarius video circuit.

 

I notice that you're using a DB15HD connector for output. Does that mean that this circuit outputs to VGA? The pinout certainly seems to match.

Link to comment
Share on other sites

I notice that you're using a DB15HD connector for output. Does that mean that this circuit outputs to VGA?

Sadly no. At present I am using a Samsung SyncMaster 940mw which has SCART input. However I originally chose a VGA connector to match the input on my GBS-8200 upscaler. I have several others vintage computers with various different RGB connectors, so I use the 15 pin 'VGA' pinout as an intermediary.

 

I looked into making a VGA converter for the Aquarius, but gave up because it was too hard to do at a reasonable price. A basic line doubler won't do the job because it can only produce 640x480 60Hz VGA, which leaves no room for borders and won't work on PAL machines. So you need enough RAM to store a full frame, plus an FPGA to do pixel stretching and interpolation etc. There are dedicated upscaler chips that theoretically can do it, but they are designed for interlaced video and are hard to get.

 

The cheapest and easiest solution is the GBS-8200, which sells for around $20 on eBay. I added a small MCU which replaces the on-board controller and optimizes the settings for non-interlace with minimal artifacting - GBSControl - Custom settings for GBS8200.

  • Like 3
Link to comment
Share on other sites

Thanks! It's too bad that this upgrade doesn't output VGA natively, but you're probably right that it's too complex and expensive to do an all-in-one VGA converter. I also agree that the GBS-8200 is the best solution: when you started experimenting with RGB output for the Aquarius, I picked one up, and so far I really like it. You mentioned that you customized yours with a new MCU, but how would this upgrade work with a stock GBS-8200?

 

(If you're still planning to design a PCB for this upgrade, I'd strongly encourage you to include composite output as well. It would be nice to have both options, and I suspect that for many users, especially those still on CRTs, composite output will be enough of an improvement over RF.)

Link to comment
Share on other sites

If the RGB mod works on PAL Aquarius as well, those of us over here would have access to SCART options, which unfortunately you don't.

 

Anders, a while back I picked up some 18" LCD monitors with SCART input from ebay from a seller in the US. They work great on my Atari, Amiga, C128 and BBC computers as well as some old game consoles, so it's not impossible. Also, there are "SCART" to HDMI adapters on ebay that support RGBs which work as well.

 

Steve

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I did did the PCB layout for RGB + Composite video today. Eagle's autorouter only managed to do 81% of the tracks and was really messy, so I routed the whole board by hand.

 

For buffering the composite video I used a THS7314 triple video amp, which has AC coupling with sync tip clamp so it is not affected by DC voltage on the input, and 8.5MHz low pass filtering to reduce noise. Seems a pity to have the other two channels lying idle, but I have yet to find a single channel chip with the same features.

 

It's been so long since I used the composite output on my Aquarius that I had forgotten how bad it is. The THS7314 does much a better job than the single transistor buffer I was using before, but it can't make up for the general crappyness of the NTSC signal. Still better than RF though.

 

The board is designed to fit in place of the RF modulator. The composite video socket should go through the existing RF output hole, but another hole will have to be cut into the case to fit the RGB connector (which holds the board in place).

post-40459-0-60574600-1502875231_thumb.png

post-40459-0-54860300-1502875243_thumb.png

  • Like 2
Link to comment
Share on other sites

Very nice, Bruce! (I never found Eagle's autorouter to be entirely satisfactory, either, so I've long since gotten into the habit of doing all my layouts manually.) Thanks for including a composite option, too.

 

I'm curious: would it be possible to widen your board slightly so that mounting holes can be added to the corners for standoffs/spacers? It's been a while since I looked at an Aquarius board without the RF modulator attached, but once it has been removed, there may be enough empty space in that area to safely drill some mounting holes, which would make for a more secure installation. (If there's not enough space in the corner near the composite connector, perhaps the hole can be added in the area between the composite and RGB connectors.)

 

Another alternative—which I might try on mine, since I'm very interested in getting one of these boards—would be to simply mount the board with double-sided tape and pull the composite and RGB signals, and even audio, out to a DIN-8 connector mounted in the RF output hole, with an external breakout cable. That might avoid the need to drill any additional holes in the case at all.

Link to comment
Share on other sites

I'm curious: would it be possible to widen your board slightly so that mounting holes can be added to the corners for standoffs/spacers? It's been a while since I looked at an Aquarius board without the RF modulator attached, but once it has been removed, there may be enough empty space in that area to safely drill some mounting holes, which would make for a more secure installation.

I am thinking it could be soldered to the motherboard using the same holes as the RF modulator. I could also pick up GND, +5V, composite Video and audio from the same pads.

 

Another alternative... would be to simply mount the board with double-sided tape and pull the composite and RGB signals, and even audio, out to a DIN-8 connector mounted in the RF output hole, with an external breakout cable. That might avoid the need to drill any additional holes in the case at all.

Good idea! The only question is what pinout to use - MSX perhaps? The hole in the case will have to be enlarged slightly, but this should be easy to do (certainly not as difficult as cutting out the holes for a DE-15 VGA connector!).

post-40459-0-11904700-1503046820.png

Link to comment
Share on other sites

Some more pinouts you might want to consider:

 

Sega Genesis/Mega Drive 1 RGB: uses a 262 degree one like the MSX but different pinout. I'm not sure if this type of cable is more common.

SNK Neo Geo RGB: uses a 270 degree connector, partly similar pinout to the Genesis.

XRGB Mini: Entirely different connector, perhaps not of much use unless users are expected to connect the Aquarius directly to the XRGB Mini.

(There's also the Genesis 2 pinout but it just means more fiddly work for potentially less benefit)

 

Any way you do it, there will be at least one user for whom it doesn't match existing equipment...

Link to comment
Share on other sites

Here is my latest design. Two big changes:-

 

1. 8 pin DIN socket wired to MSX II standard, with solder bridge jumpers and an 8 pin header for using different pinouts and/or sockets.

 

2. Using an ATF22V10CQZ SPLD (equivalent to GAL22V10 but lower power) to convert from digital to analog RGB. This requires fewer parts and is more flexible than hard-wired logic.

 

Previously I had resisted using a GAL because a standard 22V10 draws up to 130mA. Also a special programmer is required and nobody makes GALs anymore. However I recently discovered the Atmel/Microchip ATF22V10CQZ, which has current draw proportional to clock speed (estimating 30-40mA at video frequencies) and is still in production. I designed a simple ATF Blaster for DIYers who don't want to spend $100+ on a suitable commercial programmer. Hopefully this will also do the CQZ version - will find out when I receive them! (it's worked with every chip I have tried so far).

 

The SPLD converts Aquarius 4 bit digital RGBI into 9 bit digital RGB (3 bits per color) using a lookup table, then clocks its output registers with the pixel clock to synchronize the colors. The 3 bit digital RGB outputs are finally converted to analog using resistors. This only uses 7 of the SPLD's 12 inputs, so other inputs can be used to select different color palettes, eg. original Aquarius, ZX spectrum, MSX, C64 etc. I intended to use the RF channel switch to switch between palettes, but it could be controlled programmatically using eg. the printer TXD or CP/M I/O pin.

 

I haven't built a fully working circuit yet. Initial tests and calculations show that it should be able to reproduce the original Aquarius colors fairly accurately (at least as good if not better than my discrete logic design) so rather than wasting time and energy building a prototype on matrix board I will just get some PCBs made. If for some reason the SPLD doesn't do the job then I will go back to the discrete design.

 

Due to the thickness of the PCB the DIN socket sits a bit higher than the cassette port. The hole obviously needs to be enlarged, but there should be just enough room without having to cut into the lip at the top of the case (the photo below shows it even higher because I didn't trim the pins). Alternatively you could use a panel-mount socket and connect it to the RGB board via a short cable and 8 pin plug. Panel-mount sockets fit into the existing hole from the outside, which doesn't look quite as nice as internal mounting but is simple and robust. You could fix it with screws, or hot glue it from the inside if you don't want to drill holes in the case.

 

The RGB circuit board is designed to fit in the same space as the modulator, with GND connections aligned to the modulator ground tabs and Audio / Video / +12V / RF_switch inputs lining up with the modulator inputs. Wires connecting between these points hold the PCB in place.

 

+12V is required to turn on the SCART port in a TV. In the Aquarius this normally powers the RF modulator. It is fed through a 180 Ohm resistor on the motherboard, so should be fairly safe against accidental shorts.

 

Instead of changing color palettes the RF switch could be used to switch the SCART port between composite video and RGB. On SCART this is done by putting a signal on the 'Fast Blanking' pin which tells it to overlay an RGB image on top of the composite video. The RF switch input goes into the SPLD, so it can be programmed to use either CSYNC or CBLK to control fast blanking, or it could just produce a constant +1V - depending on what works best (some TVs apparently don't like true fast blanking and prefer to have a fixed voltage on the FB pin).

 

SCART normally extracts sync pulses from the composite video signal, though it can also use CSYNC for this purpose. If you are not using SCART this is not an issue, but you will probably want CSYNC somewhere on the RGB socket.

 

The solder bridge pads connect between the signals named (which also go to the 8 pin header) and the DIN socket. If you need a different pinout (eg, for a different MSX computer or ZX Spectrum +2/3) then you can solder wires from the DIN side of the pads to different pads on the other side or to the 8 pin header holes. This combination of pads and pin headers should support any pinout that you might need.

 

 

 

 

post-40459-0-85387800-1503347589.jpg

post-40459-0-60457300-1503347598.jpg

post-40459-0-95022100-1503347727_thumb.png

post-40459-0-37727300-1503347742_thumb.png

Edited by Bruce Abbott
  • Like 4
Link to comment
Share on other sites

Looks great! Good call on including an 8-pin header; I won't know until I try it, but I might end up using a panel-mounted DIN socket instead of the PCB-mounted one, just to get better alignment with the existing hole (although it's inevitable that it will need to be enlarged slightly). I'm looking forward to seeing the completed boards!

Link to comment
Share on other sites

I wonder about the low powered GAL solution, is that something that could be adapted to all kinds of RGBI systems? I know people elsewhere, e.g. in the C128 and CGA countries are coming up with solutions, one more advanced than the other, to get a good RGBI to analog RGB solution, in particular those who want good brown colour in the palette. Since you mentioned your solution will be able to use predefined palettes, I suppose it might be very flexible. Now you're probably busy enough as it is with the Aquarius but I wonder if you're the first to have come up with this idea, or perhaps it already is used elsewhere so no benefit to hint others to do something similar?

Link to comment
Share on other sites

I wonder about the low powered GAL solution, is that something that could be adapted to all kinds of RGBI systems? I know people elsewhere, e.g. in the C128 and CGA countries are coming up with solutions, one more advanced than the other, to get a good RGBI to analog RGB solution, in particular those who want good brown colour in the palette. Since you mentioned your solution will be able to use predefined palettes, I suppose it might be very flexible. Now you're probably busy enough as it is with the Aquarius but I wonder if you're the first to have come up with this idea, or perhaps it already is used elsewhere so no benefit to hint others to do something similar?

9 outputs produces 512 colors, which is the same as the Atari St. I could use all 10 outputs (4 outputs on green) to get 1024 colors.

 

The circuit should able to work with a variety of machines. CGA doesn't have a pixel clock so it would simply run unclocked like my earlier RGB interface, and CBLK won't be needed if the RGB signals are already low during the sync period.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Success!

 

At first the colors were messed up and I couldn't figure out why. All the color mapping equations looked correct, cables were wired correctly - what could be wrong? Then I realized that I had programmed the input signals in the wrong order. No problem - simply reassign the pins in WinCUPL, reprogram the GAL and now it's working perfectly! The GAL draws 26~28mA (varying slightly with pixel density) which is less than I expected.

 

Next step: install and test the composite video and audio circuits.

 

The PCB could do with a few minor changes. Unfortunately the 8 pin socket I choose turned out to be the type 'B' version with 41º pins, and the PCB layout for type 'A' sockets is different. This is not a problem if you use a panel-mount socket. I can see faint vertical lines on some colors, indicating that the +5V supply needs more filtering.

 

So far I have only programmed the GAL with the stock Aquarius color palette. This is using up 6 out of 10 available product terms on one of the Blue outputs, which may limit what other palettes can be installed. Now I have to decide what second palette I want and see if it will fit.

 

post-40459-0-68575300-1505599715.jpg

post-40459-0-79804400-1505599726.jpg

  • Like 2
Link to comment
Share on other sites

A 4.7uF capacitor across the 5V supply removed the faint vertical lines on RGB. Total current draw varied from 30-46mA depending on screen content (3-18mA of this being consumed by the 75 Ohm terminations in the TV). With the video amp installed and terminated (RGB output disconnected) the total current draw was 45-55mA.

 

As expected the composite image is blurry and muddy, with horizontal streaks and vertical lines sometimes visible, but still much better than the original rf signal. Colors are better than the images below suggest, as my camera tends to oversaturate red and blue.

 

 

post-40459-0-87560700-1505753437.jpg

post-40459-0-53512400-1505753458.jpg

post-40459-0-26261500-1505753467.jpg

post-40459-0-81055300-1505753498.jpg

post-40459-0-67054400-1505753510.jpg

post-40459-0-81517000-1505753525.jpg

post-40459-0-72228200-1505753571.jpg

post-40459-0-43519800-1505753615.jpg

post-40459-0-79641000-1505753627.jpg

  • Like 1
Link to comment
Share on other sites

Could this be adapted for use with NTSC Intellivision to provide analog RGB?

Looks like it should be able to do it. The AY-3-8915 color encoder in the Intellivision has 5 digital inputs which select 1 of 16 colors plus blanking and sync. This is similar to the Aquarius except that it encodes everything into the 5 bits instead of having a separate sync bit.

 

I will calculate the required RGB levels and try it out on the Aquarius!

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...