Author Topic: Converting 15kHz analog RGB to digital  (Read 52821 times)

0 Members and 1 Guest are viewing this topic.

Offline Ed Herdman

  • Contributor
  • Posts: 14
Re: Converting 15kHz analog RGB to digital
« Reply #25 on: June 09, 2014, 05:12:36 am »
It's in the topic title:  Analog RGB.  This means a specific variety of component video, which he specified as RGBs later on.  No guesswork is required as to what the OP wants.

The Saturn and Genesis both support RGB natively.  In my previous post I've listed the only exceptions to systems that output RGB natively (assuming the correct cable is purchased, and you don't have one of the less common revisions of a console - there's different SNES and Genesis consoles - the SNES mini and Genesis 3 - that require modification to output RGB, but the resulting output is very good on both, IIRC).

I asked elsewhere (at the thread I linked in my first post) about the question - one other user notes that the A/D step is critical, especially if the goal is something like a 1:1 pixel mapping.  Do I have any idea what the difficulty is, from an EE standpoint, of doing this?  Not really!  I do know that it's something that has engaged companies for a while, though, and it doesn't look simply trivial to do, so I am reluctant to try and do something totally from scratch.  And it's worth pointing out the workflow challenges too, I think.
« Last Edit: June 09, 2014, 05:16:55 am by Ed Herdman »
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #26 on: June 09, 2014, 02:32:12 pm »
I spent a few hours last night combing forums and reading sixfortyfive's review of the XCapture-1: http://www.sixfortyfive.com/streaming/xcapture1.html

The whole process looks like an exercise in frustration and compromise. You need a specific USB 3.0 chipset (NEC Renesas) or it won't work. If the resolution changes during capture, it drops out for a few seconds. If it switches between interlaced and progressive your audio goes out of sync. If resolution changes and i/p switches only occurred when switching games or systems it wouldn't be a problem, but if a game switches modes on the fly, it will be. Depending on the source resolution haloing can be introduced into the captured image.

I'm not saying I could make something better. I'm sure the engineers at Micomsoft are smart people tackling a difficult problem. It amazes me that old, analog CRTs handle all of this effortlessly, but attempts at digitized capture have so many problems. Maybe I need an analog intermediary to provide a uniform interface to the capture device. Maybe I need... a VCR.
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #27 on: June 09, 2014, 04:10:33 pm »
Here's the scope images of the green signal at various zoom levels. Amplitudes will be off since I'm not using a 75R termination.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #28 on: June 09, 2014, 04:16:06 pm »
Maybe I need an analog intermediary to provide a uniform interface to the capture device. Maybe I need... a VCR.
Actually not a bad idea.

I used to have a multi format VCR that I bought on a trip to Japan in the electronic district. It could handle all formats known to mankind and their derivatives and convert between them.
It used some ADCs because it will digitize the image to convert it.

It was an Aiwa HV-MX100 and it cost me quite a bit back in it's day, but my family would send me PAL video tapes and this will let me play them on NTSC.

They are not even cheap now, and I have no clue what bonanza.com is.
http://www.bonanza.com/listings/Aiwa-Worldwide-Video-Ntsc-Pal-Secam-Vcr-Hv-Mx100-U-Mx100-Working-Condition/173558599

The quality was so good that the artists at work asked me to bring it too work all the time but capture crisp highres pictures for textures.
You could pause it and it would be really crisp. I'm pretty sure my wife threw it away on her routinely clearing up space.

"you don't need this, you haven't used it for years"

It didn't have rbg inputs as I recall but the image in that link shows a scart connector! I guess I never had use for SCART.

Edit: I'm going to tell her that she threw away money. Those things seem to hold it's value for a dead tech :)

http://www.amazon.com/Aiwa-HV-MX100-Hi-Fi-Multi-System-VCR/dp/B00001QGUQ


Edit: looking at the schematic (page 22), the SCART connector doesn't have the RGB pins connected :(

Edit again: plus I don't know if this will lock into the console.

« Last Edit: June 09, 2014, 05:40:29 pm by miguelvp »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #29 on: June 09, 2014, 05:57:16 pm »
Here's the scope images of the green signal at various zoom levels. Amplitudes will be off since I'm not using a 75R termination.

Seems like it's around 15.625KHz (hard to say) between lines. I eyeballed 13 divisions minus1/5 of a division. so around 64us. Edit: but skipping every other line. (probably because being 240 instead of 480?)

the actual visible line seems to be 6 divisions so 30us, what is the horizontal resolution? if it's 320 then it puts the pixel clock around 10.666 MHz

What system was that one? the SNES or the TG16?

Also I don't see any sync signal there, does it have separate horizontal and vertical sync lines?



« Last Edit: June 09, 2014, 06:13:03 pm by miguelvp »
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #30 on: June 09, 2014, 06:08:53 pm »
That was the SNES. I'm not sure what the resolution was for that game since the SNES can have 256 or 512 pixels per horizontal line and 224, 239, 448 or 478 vertically.
 

Offline Ed Herdman

  • Contributor
  • Posts: 14
Re: Converting 15kHz analog RGB to digital
« Reply #31 on: June 09, 2014, 06:31:32 pm »
Didn't know about the XCAPTURE-1 USB issues - it looks like there's still something going on there.

I'd think an old VCR would likely convert the signal to Y/C, since that's the best its tape format can manage.  I have heard of people using DVRs to capture game video, though, and you should have some component output ability or even onboard file encoding there (though I don't know what the processing is like there).  But I wouldn't spend money on getting one - the StarTech card is only $120-ish on Amazon (before shipping), and I'm not sure how quality will be (probably you are limited to relatively few options there, and it encodes media itself).

@ miguelvp: None of these systems have separated sync lines.  The kinds of sync used in these systems are composite video as sync (carrying all the other parts of a composite video signal, so artifacts can appear) or composite sync (which is a basic combined h + v sync).  A decent reference on this topic is found here.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #32 on: June 09, 2014, 06:58:58 pm »
Different approach but it's a one off:

http://forums.nesdev.com/viewtopic.php?f=9&t=9561

His goal was to do a pixel perfect conversion to VGA.

@legion, what kind of dev boards to you have in hand?
I'm tempted to an RGB adaptor for the Saturn or the Genesis, what do you use, something like this?

http://retrorgb.com/genesisrgbcables.html

I guess I can just get a couple of DIN connectors and play with at least the Genesis and the Saturn to see what is possible, since I find this interesting :)

 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #33 on: June 09, 2014, 07:10:02 pm »
Didn't know about the XCAPTURE-1 USB issues - it looks like there's still something going on there.

I was actually warming to the idea of using the XCapture-1 until I read about the USB chipset specificity. For me, that kills the primary advantage it had of portability. I liked the idea of a USB device since I could use my laptop. A PCI-Express card would require me to bring my desktop out to the living room for capturing which is cumbersome. If I wanted to use a laptop I'd have to buy a new one with the primary selection criteria being the USB 3.0 chipset which is very limiting.
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #34 on: June 09, 2014, 07:18:58 pm »
@legion, what kind of dev boards to you have in hand?
I'm tempted to an RGB adaptor for the Saturn or the Genesis, what do you use, something like this?

http://retrorgb.com/genesisrgbcables.html

I don't have any FPGA dev boards. I had been eyeing that Altera board as a means to learn about FPGAs. Didn't buy one yet as I'm not sure if I have the time to learn how to do anything meaningful with them. For cables I'm using the appropriate cable for each console from http://www.retrogamingcables.com/ Each terminates in SCART and then I have a SCART to BNC adapter to go into the Sony PVM: http://www.retrogamingcables.com/sony-pvm-scart-converter-bnc.html
 

Offline Ed Herdman

  • Contributor
  • Posts: 14
Re: Converting 15kHz analog RGB to digital
« Reply #35 on: June 10, 2014, 12:00:10 am »
If your laptop has an ExpressCard slot, you might be able to use an adapter for the PCI-E cards.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #36 on: June 10, 2014, 02:47:23 am »
So I did fired up the Saturn (RTC battery dead to it did boot to the set time screen, not sure if it still does that once I moved it to my office).

Good news is that I identified the pins and there is a dedicated sync pin.


Bad news is that SCART cables don't use that pin and use the component signal for the clock.
From: http://members.optusnet.com.au/eviltim/gamescart/gamescart.htm


Here is the pinout of the SCART connector Notice there is no sync pin so they must use the component signal.


The cable you linked uses the Yellow cable (composite probably to derive the sync)

Good news is that there is hardware that will split it all up for you if you are so inclined

http://members.optusnet.com.au/eviltim/vga2arc/vga2arc.htm#acvid

Or you can use the composite signal to get the sync, here is the red signal synced with the composite signal above.


But to use the composite signal  you will have to find the sync, maybe easy with a comparator.
I have not yet researched how the vertical sync is encoded in composite yet, but I will be able to find it, by using the sync pin to see what is going on during vertical refresh.

Next I will post captures using the sync pin in the Saturn (pin 1)
I will use the same method to look at the composite vertical sync signal.

« Last Edit: June 10, 2014, 03:30:35 am by miguelvp »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #37 on: June 10, 2014, 02:57:06 am »
Here is a full frame (kind of a full screen capture) of the Saturn:


Here is the vertical back porch measurement:


And here is the Vertical back porch plus the visible frame measurement:


Finally here is the detail of the vertical sync followed by the vertical back porch:


I can use this method to figure out how the composite vertical sync looks like.

Forgive the noise, I just have some pin jumpers hooked in the connector so it might be picking up a lot of noise, although they are short breadboard jumpers.

Next the horizontal timings (a line of the screen)
« Last Edit: June 10, 2014, 02:59:04 am by miguelvp »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #38 on: June 10, 2014, 03:07:20 am »
For the horizontal captures I selected a line that looks pretty uniform on the red channel. Since I have it triggering on a pulse of 5us of the vertical sync I can lock into the same line anytime.

First this is the Horizontal sync measured:


This is the Horizontal sync plus the back porch:


And this is the full line, HSync+back porch+visible line+front porch:


I'm going to try to trigger the component vertical sync using this pulse triggering on channel 2.
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #39 on: June 10, 2014, 03:11:00 am »
If your laptop has an ExpressCard slot, you might be able to use an adapter for the PCI-E cards.

Unfortunately it doesn't. It doesn't have USB 3.0 either. It's a decent machine, but I bought it just before USB 3 became widely available in laptops. So I'd likely have to get a new laptop to capture footage regardless, I just don't like limiting my options to a certain chipset.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #40 on: June 10, 2014, 03:20:07 am »
Here is the Sync (pin 1) compared to the Composite signal showing the VSync and the back porch:


And a close up of the VSync itself, the bottom one is the composite VSync:


Edit: notice the color burst signal after every HSync.

Now to try to fire up that superscan and hack it to get the ADC outputs, not sure what to do about the sync, I might need to use pin 1 to make it easy for now.
« Last Edit: June 10, 2014, 03:23:28 am by miguelvp »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #41 on: June 10, 2014, 08:32:30 am »
So I re-purposed a spare VGA to DVI adapter (was a pain to hack it apart) then used some spare wires to make the Saturn to VGA to feed into the SuperScan 2, and I found a power supply for the device.



Also the chips next to the TDA8707 (Triple RGB 6-bit video analog-to-digital interface) are d42280v-30 2 Mb Field Buffers, so 256K words 8bit FIFOs for a whole one MegaByte worth of buffered data since there are 4 of them.

http://www.datasheetarchive.com/dl/Datasheets-SX27/DSASW0041403.pdf

Now I want to find a DIN connector that fits the saturn for the home made cable to test this and look if the composite output of the SuperScan displays something.
Edit: maybe I got lucky since it seems no one can find sources for the connectors but I think this will work:



I'm going to connect the HSync to pin 1 so I don't have to deal with the composite signal for now. Hopefully that is enough to feed the FIFOs.

Then I think I will have to lift the chip that controls the fifos outputs (to the right of the board on a picture I posted earlier labeled YUAN EC1000T) so that I can patch some cables to control the fifos from an FPGA to get the data out. Unless I can find something else down the pipe that makes it simpler. There is a pot next to that chip to adjust something, maybe the pixel sampling clock?

After that I will have to get the composite signal to split the HSynch and VSynch like in the diagram linked before:
http://members.optusnet.com.au/eviltim/vga2arc/vga2arc.htm#acvid.

Haven't think about the audio yet, some audio ADC or use the DACs on the Nano with some comparators to make a ramp ADC.
« Last Edit: June 10, 2014, 09:14:37 am by miguelvp »
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #42 on: June 10, 2014, 03:06:21 pm »
What I'm still not clear on is how to derive your pixel clock. You have an H-sync for each line. But without knowing the resolution of the image, how do you know how to subdivide the signal for sampling?
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13695
  • Country: gb
    • Mike's Electric Stuff
Re: Converting 15kHz analog RGB to digital
« Reply #43 on: June 10, 2014, 03:29:55 pm »
What I'm still not clear on is how to derive your pixel clock. You have an H-sync for each line. But without knowing the resolution of the image, how do you know how to subdivide the signal for sampling?
For standard formats, I think you can identify which format it is from the sync timings, which gives you the pixel clock, for broadcast type formats, a multiple of the colour subcarrier is normally used.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #44 on: June 10, 2014, 03:36:24 pm »
For standard formats, I think you can identify which format it is from the sync timings, which gives you the pixel clock, for broadcast type formats, a multiple of the colour subcarrier is normally used.

So the H-Sync timing adjusts based on resolution? Ed Herdman was saying a lot of consoles change resolutions on the fly in game. They also switch between progressive and interlaced.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #45 on: June 11, 2014, 01:46:46 am »
Depends on how you configure the FPGA it should be able to automatically switch on the fly.

BTW, source for the connector:
http://www.wallcoinc.com/Pan_Pacific_MD_10P_Mini_DIN_MALE_CONNECTOR_10_PIN_p/wal78-md-10p.htm

Ordered 3. Also added 3 BNC dust caps, a couple of T BNC connectors a couple of 50 Ohm terminators and a pair of 75 Ohm terminators since their minimum order was $15 so I had to pad my order and I needed those bits. + $8 shipping (the cheapest they offer is FedEx ground)

I know, ordering 3 connectors is overkill specially not knowing if it will work, but they are pretty cheap.
Oh crap, I should have gotten a couple of regular DINs for the Genesis, oh well too late. and I might have some around, looks like a old PC keyboard connector might do.

Oh, btw the SuperScan also outputs s-video as well, not that it helps on anything but just to mention it.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #46 on: June 11, 2014, 02:25:38 am »
Well, Since VGA and RGB SCART have the same signal levels and the same impedence I thought I'll give it a quick test.

But the SuperScan wouldn't lock with feeding the Sync signal to just the HSync, I think I have to extract both HSync and VSync from the composite video:

Source:
http://members.optusnet.com.au/eviltim/vga2arc/vga2arc.htm

LM1881 datasheet:
http://www.ti.com.cn/cn/lit/ds/symlink/lm1881.pdf

Alternatively I can run the combined sync signal to the FPGA and the FPGA can drive the horizontal and vertical sync after separating them by logic.

Going to wait for the connector, since using breadboard jumpers is getting already out of hand a bit.

« Last Edit: June 11, 2014, 02:29:54 am by miguelvp »
 

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Re: Converting 15kHz analog RGB to digital
« Reply #47 on: June 11, 2014, 02:29:47 am »
Which FPGA are you using? Is it the Altera Cyclone V?
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #48 on: June 11, 2014, 03:59:59 am »
On the finalized version I want to use a BeMicro CV (Cyclone V) because it has 1GB DDR3 and microSD. Plus it's only $50.

But my plan is to use the DE0-Nano (Cyclone IV) to start with and convert the capture data directly and convert it to VGA to know that I'm getting the right data since I already have a DAC that can handle the output part:



Seems I need to feed the sync from the Saturn into the FPGA to derive the HSync and VSync, (unless I go for the hardware approach) to drive the SuperScan device. Also I have to take those vertical sync pulses to generate a VGA compatible VSync. So that will take 3 pins.

Once that is done then test the composite output of the SuperScan to make sure it's locking into the signal. I should be able to see the image on a TV via composite indicating that the board is locking into the signal.

To capture the data from the SuperScan, so far I have two routes, one is to tap directly into the capture chip (TDA8707), the other is to tap into the FIFO output.

If I go for the FIFO approach I need 40 pins all 4 memory modules (8 for data+2 for read input clock and the read clock input per memory module).

If I go for capturing directly from the chip I need 6 bits per color (18 total) plus one for the ADC clock to know when there is data so that's only 19 pins.

Also I need one to get the synch signal in and 2 for the HSynch VSync to drive the capture board as explained earlier so add 3 to either case.

I could use my other bigger devboard (Cyclone V GX starter kit) but then i'm restricted on GPIOs unless I buy a module that adds 3 40 ping GPIO headers, that I will eventually get but not yet.

 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Converting 15kHz analog RGB to digital
« Reply #49 on: June 14, 2014, 03:40:02 am »
So I've heard from Wallco Inc and they told me that it's going to be 2 to 3 weeks until they can ship my order so I went ahead and asked them to add the 8 pin DINs for the Genesis which they did.

In the meantime I decided to use the FPGA to generate the VGA signal to start tapping into the SuperScan2.

First thing was to make sure the SuperScan was locking and converting the signal to composite (meaning the data is being captured and converted to NTSC) using the same patern as in the previous post.


Then I did push the menu button on the SuperScan and that brought up the OSD driven by an MC141540P4 OSD CMOS (btw that's how I did setup my trigger)


This is a single line encoded as composite.


Also I took a picture of the back of the FIFO buffer to start mapping the 18 digital signals to the FIFOs where I will have to solder wires so I can feed it to the FPGA. I'm planning to use  a IDE 40 pin connector cut so I can just plug it into the FPGA's GPIO (of course avoiding the voltage pins but I will use the ground pins). I added the pinout for the FIFO chips (D42280V), to the right of those is the ADC and to the left is the custom ASIC (where there is some gunk from a label I removed that was hiding traces) that feeds the stream to the rest of the system. By the arrangement it looks like the data is double buffered.


My wife is watching TV so I can't see how the composite video looks on the screen, yeah, we only have one TV but I'll test it tomorrow and take pictures.

Later I'm going to start looking with the scope the signals on the FIFO pins to see if I can see any data going by. I only need to probe the DO pins the read enable and read reset. Plus the read clock I guess.
« Last Edit: June 14, 2014, 04:12:00 am by miguelvp »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf