VOGONS


First post, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

I recently bought this China (6€!) logic analyzer. It can capture signals with 24 MHz on 8 channels! Software available for free here:
https://www.saleae.com/de/downloads/

sal2.jpg
Filename
sal2.jpg
File size
52.21 KiB
Views
1693 views
File license
Fair use/fair dealing exception

I was really surprised after connecting to my CGA how accurate the signal is. Below screenshot shows:
Channel 0 VSYNC
Channel 1 HSYNC
Channel 2 One color Channel

Sale1.jpg
Filename
Sale1.jpg
File size
99.89 KiB
Views
1693 views
File license
Fair use/fair dealing exception

Even if 24MHz might not sound sufficient I started with a 320x200 startup screen and tried to reconstruct the image from the saleae capture file with a simple QBASIC-Program. Thats what I get

Screenshot from 2020-06-22 23-24-08.jpg
Filename
Screenshot from 2020-06-22 23-24-08.jpg
File size
16.64 KiB
Views
1693 views
File license
Fair use/fair dealing exception

For this picture only every 2nd Pixel (and one color channel) on the x-axis was used - so much potential left for this resolution.

Compared with cinch-out:

IMG_9487r.jpg
Filename
IMG_9487r.jpg
File size
718.93 KiB
Views
1693 views
File license
Fair use/fair dealing exception

Has this been done before..? I think this has a fantastic potential when looking at this:
EGA/CGA capture with High-Speed Digital I/O Card

This is far beyond my skills...but if it is possible to capture the data directly from the USB-device it would be a very simple and cheap way to connect a EGA card to a modern PC...?

I will try to further improve my program to see how it can look like at 640x480x16.

Last edited by Predator99 on 2020-07-13, 13:38. Edited 2 times in total.

Reply 1 of 211, by darry

User metadata
Rank l33t
Rank
l33t
Predator99 wrote on 2020-06-22, 21:48:
I recently bought this China (6€!) logic analyzer. It can capture signals with 24 MHz on 8 channels! Software available for free […]
Show full quote

I recently bought this China (6€!) logic analyzer. It can capture signals with 24 MHz on 8 channels! Software available for free here:
https://www.saleae.com/de/downloads/
sal2.jpg

I was really surprised after connecting to my CGA how accurate the signal is. Below screenshot shows:
Channel 0 VSYNC
Channel 1 HSYNC
Channel 2 One color Channel
Sale1.jpg

Even if 24MHz might not sound sufficient I started with a 320x200 startup screen and tried to reconstruct the image from the saleae capture file with a simple QBASIC-Program. Thats what I get
Screenshot from 2020-06-22 23-24-08.jpg
For this picture only every 2nd Pixel (and one color channel) on the x-axis was used - so much potential left for this resolution.

Compared with cinch-out:
IMG_9487r.jpg

Has this been done before..? I think this has a fantastic potential when looking at this:
EGA/CGA capture with High-Speed Digital I/O Card

This is far beyond my skills...but if it is possible to capture the data directly from the USB-device it would be a very simple and cheap way to connect a EGA card to a modern PC...?

I will try to further improve my program to see how it can look like at 640x480x16.

If you can get it to run in real time on Raspberry Pi (especially an old model)with output to HDMI, you may make a lot of friends .

Reply 2 of 211, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

As said, real time capture is beyong my skills...would be very happy if somebody could try this. But it seems to be possible to get the data from USB in realtime.
https://learn.sparkfun.com/tutorials/using-th … k-pulseview/all

Below screenshot is from a BIOS Setup screen (CGA80) using the 3 RGB channels. It is not scaled to fit on the screen and shows all data captured (right part is not displayed). CGA output is 640 pixels per line. In the capture file I get 1529 bits from it for each channel. This should be enough data to remove that jitter effect which is still visible. 640 pixels is the maximum CGA/EGA resolution so this 6€ device has enough power to make a perfect capture als from 640x480x16 EGA...

Screenshot from 2020-06-23 12-22-46.jpg
Filename
Screenshot from 2020-06-23 12-22-46.jpg
File size
33.43 KiB
Views
1649 views
File license
Fair use/fair dealing exception

Reply 3 of 211, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

Quite surprised nobody seems to be interested. This has the potential to replace a MCE2VGA or GBS8200 for just 6€..? Its also a big benefit the output can be displayed in a window on your Desktop.

I recalculated and you have 1071 samples for a 640 pixel line. So every pixel is captured, most of them twice. Below picture combines all data (CGA).

Attachments

Reply 4 of 211, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

And the data used for generation of this picture, can be viewed with the saleae software
https://www.saleae.com/de/downloads/

Filename
24 MHz, 2 M Samples [30] color panels.rar
File size
89.55 KiB
Downloads
14 downloads
File license
Fair use/fair dealing exception

Reply 5 of 211, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

For those who are following my boring topic :-p

Good news, there may be a possibility to get this running in real time with my rather limited Windows-Programming skills:

The device works with above mentioned "sigrok" which has a CLI which can output the captured data on the stdout:
"C:\Program Files (x86)\sigrok\sigrok-cli\sigrok-cli.exe" -d fx2l afw --continuous -O hex

D0:00 08 00 20 00 80 00 00 00 04 00 10 00 40 01 00 00 02 00 08 00 20 00 80
D1:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 40 00 00
D2:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 40 00 00
D3:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 00 40 00 00
D4:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D5:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D6:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D7:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D0:00 01 00 04 00 10 00 40 00 00 00 02 00 08 00 20 00 80 00 01 00 04 00 10
D1:00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
D2:00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
D3:00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
D4:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D5:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D6:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D7:ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
D0:00 40 00 00 80 02 00 08 00 20 00 00 00 01 00 04 00 10 00 40 00 00 80 02
D1:00 00 00 00 00 00 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00 00 00 00
D2:00 00 00 00 00 00 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00 00 00 00
D3:00 00 00 00 00 00 00 00 00 00 00 00 00 42 00 00 00 00 00 00 00 00 00 00

I also managed to transfer my DOS-QBasic-Program I made above screenshots with to Windows 7 (QB64).

Therefore I should be able to combine both (redirect sigrok output to qb64-Program via ">") and it should be running in "live" mode.

Currently everything much too slow...it takes some seconds to draw a single image from a csv file. But this can be improved by using a hex-format for data-transfer and my program is currently not designed for speed...

So if anybody has c# programming skills you are invited to support...I am afraid qb64 will be too slow at all for 25fps. But I will try 😉

Reply 6 of 211, by maxtherabbit

User metadata
Rank Oldbie
Rank
Oldbie

I actually find this quite interesting, but if you want to generate more public interest you're probably going to have to post at least one screenshot that doesn't look like ass 😀

Reply 7 of 211, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

:-p :-p :-p
Hehe, I dont think its that bad for the beginning 😉

Screenshot from 2020-06-23 19-52-33cor.jpg
Filename
Screenshot from 2020-06-23 19-52-33cor.jpg
File size
177.18 KiB
Views
1567 views
File license
Fair use/fair dealing exception

Reply 9 of 211, by BreakPoint

User metadata
Rank Newbie
Rank
Newbie

Really great find! I think it has great potential as a converter.
Looks like there is no API documentation so some reverse engineering is required. Can you check is this one based on Cypress FX2 chip?

I'll order one immediately. I do not have much time but in month or two i can get some results.
Basically there are 3 main things to be done:
1) High speed data capture. Professional cards like ADLink PCIe-7350 provide efficient API for high speed data processing. I need to investigate how API implemented here.
2) Signal analysis. This part more or less implemented in my software. This step includes on-the-fly VSYNC and HSYNC pattern recognition and conversion from bitset to RGB.
3) Visualization. None of Windows standard APIs does not allow 60fps drawing. You need direct access to video buffer. I implemented it using OpenGL.

And jaggies ...
I have no idea where are they come from. On some cards it's really terrible.

My CPU collection - http://cpu.f5soft.com

Reply 10 of 211, by Predator99

User metadata
Rank Oldbie
Rank
Oldbie

Many thanks for your reply! 😀

I think for data capture "sigrok" is the key, sources are also available:
https://sigrok.org/wiki/Sigrok-cli

The driver is "Fx2lafw" - so yes, Cypress FX2
https://sigrok.org/wiki/Fx2lafw

Jaggies: I assume they come from the 24MHz sample frequency which doesent match the video frequency. So for for one line you have 1071 bits, for the next one only 1070...and so on. I think this can be solved with some calculations. I will capture some test patterns and see what I can do..

Reply 11 of 211, by root42

User metadata
Rank Oldbie
Rank
Oldbie

Commenting so I stay subscribed to this thread. This looks interesting. I think I have one of those things here. Have to rummage through my boxes. I only have one EGA card, which is untested. I could hook it up to my OSSC, albeit I would need a conversion circuit for the RGBrgb pins or the RGBi. Having this as an option would also be nice. Will RGBrgb modes work? 350 line modes?

YouTube and Bonus
80486DX@33 MHz, 16 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & GUSar Lite, PC MIDI Card+X2+SC55+MT32, OSSC

Reply 13 of 211, by BreakPoint

User metadata
Rank Newbie
Rank
Newbie

Actually resolution does not matter. You just keep drawing line until HSYNC asserted, then you go to beginning of new line and wait for HSYNC deasserts. Same with VSYNC you keep drawing new lines untill VSYNC asserted. Once that happens you go to [0, 0] point and wait for VSYNC deasserts. So signal analyzer does not really care about actual screen resolution. It can be even some non-standard resolution.
Unfortunately real life you'll get 2 problems:
1) VSYNC and HSYNC logic implementation vary on different cards.
2) When you sample SYNC with high speed card you'll get some fake "assertions"

My CPU collection - http://cpu.f5soft.com

Reply 14 of 211, by maxtherabbit

User metadata
Rank Oldbie
Rank
Oldbie
Predator99 wrote on 2020-06-25, 12:06:

Yes 64 colors will work. The device has 8 channels. Hsync, vsync and two for each color.
Should be no difference between 200, 350 and 480 lines, Pixel clock stays the same?

no it doesn't

more lines = higher pixel clock since they all conform to 60Hz vertical

Reply 15 of 211, by mkarcher

User metadata
Rank Member
Rank
Member
maxtherabbit wrote on 2020-06-25, 15:20:

no it doesn't

more lines = higher pixel clock since they all conform to 60Hz vertical

Exactly. As long as we don't go super EGA, we have to deal with two dot clocks:

  • 200-line modes run CGA compatible at 14.318 MHz
  • 350-line modes run at 16.257 MHz (same pixel clock as MDA)

As EGA has only 640 and not 720 visible pixels, and EGA also has shortened blanking, EGA can run at 60Hz using the same dot clock and line count as MDA at 50Hz.

The cheap logic analyzer solution should work fine if we can get a sample for each pixel outside of the rise/fall time. The closer the pixel clock gets to 24MHz, the higher the chance that we do not sample at all while the pixel line is stable. At CGA, I am confident that you should get a stable picture if you choose the sampling point sensibly. At EGA timings, I'm no longer that sure, but it still might work. VGA-like timings will definitely not work. The standard VGA pixel clock for 640x480 (at 60Hz) is already 25MHz, which is above the sample rate of your analyzer.

Reply 16 of 211, by Tronix

User metadata
Rank Newbie
Rank
Newbie

The idea is not new. The main problem is that Saleae Socket API does not allow to receive a continuous stream of data. But..
There is a very similar project using a fx2lp microcontroller Cypress CY7C68013A on demoboard LCSOFT CY7C68013A (like Chinese-clone Saleae 8 ch): https://github.com/y-salnikov/vcaptfx2 He replaces the firmware in the microcotnorler with his own (slightly modified fx2lafw version from sigrok project) and has Windows and Linux-based client for display captured image. It’s not really for CGA but very similar video output from Soviet home computers like БК0010-01 and ZX Spectrum clones. Pictures and hardware descriptions there: http://y-salnikov.github.io/vcaptfx2/

Reply 18 of 211, by Tronix

User metadata
Rank Newbie
Rank
Newbie
Predator99 wrote on 2020-06-25, 18:29:

Will try to install this, but I dont think it runs with CGA out of the box.

Unfortunately, most Chinese clones of Saleae-8ch logic analyzers based on FX2LP dosn't have IFCLK pad traced to anywhere on PCB. Vcaptfx2 uses IFCLK pin for external pixel clock source, so this pin must be connected to 14.318Mhz crystal generator or crystal resonator placed on CGA video-card for run propertly. I am not the author of this project and I do not know whether it is possible to do without IFCLK pin. But out of the box this will not work, you need to edit both the firmware and the program on the desktop.
BTW, demo board using this software costs around 4,92€ on ali: https://aliexpress.ru/item/32502185484.html

Reply 19 of 211, by pentiumspeed

User metadata
Rank Oldbie
Rank
Oldbie

Oversampling rate do matter lot. Usually 4x over 14.318MHz but for best results, i like odd multiplers to catch the "betweens" that did not quite catch is around 17x or so. That's the expense right there for high bandwidth oversampling and enough bits.

In back then of the day, I tested a modified video capture card by cutting out the circuit traces from input right to the end of circuits right next to chipset and installed coax cables cut out of the VGA extension to cut down on noise (herringbone noise in image) and the capture chip is capable of 10 bits but it was actually used as 7 or 8 bits produced clear but blurry capture real time video from s-video signal.

Then abandoned the project as poor results.

Cheers,

Great Northern aka Canada.