Syncing to external clock

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Still working on converting the MGA signal to VGA. I do not have access to the dot clock, only the horizontal and vertical syncs (the video board is buried three boards down on the back of the machine and the signals are at the operator's pendant about 2 meters away). The basic problem is the MGA screen rate is 50HZ and VGA is 60Hz. If two SRAMs (such as FM25V05) are used, one reading the MGA the other writing the VGA the problem is mostly providing two clocks with the MGA clock the most critical. Two possible ways to sync to the MGA is to time the horizontal sync pulse and adjust the fast RC clock to match or use an external programmable frequency synthesizer such as a DL1085L. The horizontal sync is 18.265KHz so it should not be too hard to measure. Is one method preferable to the other?

The SRAMs have an SPI interface which means two clock rates, one for MGA and one for VGA. which might be problematic for one SAM4S to handle. Alternatively, since the data rate is 14.9MHz (18.265KHz * 816 bits/line) on the MGA and 25.427MHz (31.476KHz for 808 bits/line) for the VGA, two SAM4s and two SRAMs could be used, each SAM4S at the required clock speed and swapping control of the SRAMs to transfer the data.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i don't think your technique is viable. I'd be using a fpga with some ram along with a specific chip to regenerate the dot clock. A microprocessor would just be used for initialisation.
The gonbes board i linked to does all this (although it uses a custom chip) for a price less than the cost of me supporting your questions.

By all means, if you REALLY want to do a frame rate converter, then doing all your timing via a microprocessor is the hard way to do it. Using spi fram is also not making your task any easier.
The 'usual' technique is to have hardware to recover the dot clock and put the pixels into ram (aka framebuffer'. You then have more hardware to read the framebuffer, adjust the geometry then output as vga. The challenge is that you have two tasks accessing the same memory at different rates. You can use dual port ram, video ram or normal ram that is fast enough to accomodate both tasks. At some point in the chain you need to manage the inherent asynchronism. So you'll want to have some solid digital design skills.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am looking at an XuLA2-LX9 board that has an XC6SLX9 FPGA, 32 MByte SDRAM, 8 Mbit Flash, microSD card socket, PIC 18F14K50 and USB port. The PIC is a drawback since I have not worked with them before. I was going to use a DS1085L frequency synthesizer to generate the MGA clock using the horizontal pulse and timer to get the setting. A fixed oscillator would be used to generate the VGA clock. With the difference in frame rates it would have to read the MGA frame then send out two VGA frames whilst reading the next MGA frame. 30Hz refresh rate is not a problem since this is not a video game. The operator watches the program run through each line of machine code (or more often watches the tool with a finger on the feed hold button).

I thought about a dual port RAM but it really does not help because if the same memory is used for the MGA and VGA data then the VGA will have data from two different frames being displayed which could make a lot of jitter in the image. So two SRAMs with swapping control between the MGA reader and the VGA writer seemed more feasible.

 

Converters.tv has an MGA to VGA converter for $225 which looks to be the same as the GONBES converter (must be an expensive case). Finally found the GONBES board at focusattack.com and jammaboards llc for $39.95. The CGA scan rate is 14.5kHz - 16.5kHz, 23.5kHz - 25.5kHz or 30.5kHz - 32.5kHz. I will have to ask if it will work at the 18.263KHz of the MGA output.

 

Just got a reply from jamma boards. The GONBES board does not support the MGA scan rate so I guess the XuLA board is the next best option.

Last Edited: Mon. Nov 16, 2015 - 05:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know how you'd use a ds1085 to recover a dot clock. How would you phase lock it? If you adynchronously sample the incoming pixels you get a jitter effect. Thus the need to phase lock or oversample by 8 times and adjust the phase. Either technique has its challenges.
The pic is the least of the problems - it hardly has to do anything.

For the price of a gonbes board, i'd be reverse engineering the micro (it doesn't do much) and coaxing it to do mga - it can do cga and ega so the hardware should be able to cope with mga. I think the micro uses spi or i2c to talk to the main chip. This should make it easy to sniff.

If you can buy a box for $225, then i'd be using it. If you want to make a commercial product, the design time would be around $100k. If it were commercial, i'd be asking the gonbes manufacturer how much to make it do mga.

Last Edited: Mon. Nov 16, 2015 - 07:26 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

$225 is for what looks to be a GONBES board mounted in an aluminum case. The GONBES board retails for about $25. The conversions listed do not include MGA (the description does include MDA which I assume means Monochrome Display Adapter).

I bought a GONBES board to try. It has a 12.0MHz and 27.0MHz crystal so it has to synthesize the other scan rates somewhere.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In typical Chinese fashion, there's a number of manufacturers of the same board. Some have different firmware. So it is hard to know exactly what you are getting. Nevertheless, $25 is cheap for what it does - you'd be pushed to make something similar for the price.

The 12MHz crystal is probably for the micro. The 27MHz will get multiplied etc for the video.

Last Edited: Mon. Nov 16, 2015 - 10:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The main chip is a tvia5725. There's data on the web. Seems there's a few people hacking these boards.