componentless VGA

13 Nov 2009

I bought a mbed to play around with a video terminal replacement like the componentless VGA. I was a bit disappointed to see no real code anywhere on this project so I would have to start from scratch, I guess. Seems a shame to have to reinvent the wheel.

14 Nov 2009

What made you think mbed has a VGA interface? I certainly haven't seen anything like that mentioned anywhere on the site. It's pretty clearly intended to mostly interface with digital hardware.

14 Nov 2009 . Edited: 14 Nov 2009

A couple of weeks back I got an mbed and the first thing I did (after making the LEDs flash), was spend a day hacking up 'componentless composite'. I guess I could call it 'componentless component' to make a bad pun.

Hack is the operative word here - I'm making a low-res grayscale TV picture by hammering the DAC output -  in a way the mbed designers probably never intended/imagined :-)

I'll post it up here (probably tomorrow), since it would be interesting to see if anyone can make a use for it - my inspiration was PIC tetris, I've not gone as far as that, but I'm sure the same is possible (if not easier) on mbed!

14 Nov 2009

Are you using any external hardware for this application, aside from the VGA pins itself? Like a DAC chip, and what about the RAM?

This looks very interesting I cant wait to see more.

14 Nov 2009 . Edited: 14 Nov 2009

PIC tetris seems to generate an analog TV signal, not VGA. That said, I thought VGA is analog too, but apparently it's digital after all. So it could be easier to generate it, as someone has done with a PIC.

It might be possible to use SPI or I2C to generate the signal instead of manual bit-banging.

14 Nov 2009

I take that back, the VGA is analog, that project just uses simple 0/100% levels. I found another project which actually uses an LPC chip:
http://www.jandspromotions.com/philips2005/Winners/AR1784.htm

14 Nov 2009

I have designed many video controllers in the past using TTL logic and/or controller chips or just software solutions. To do the VGA as well as the Componentless VGA project you need a processor with the speed of the newer LPC devices. You can feed digital signals to the VGA with just some "resistor adjustments"  to the signals as long as it is fast enough. I just have a sudden need and would like to have something that is more software than hardware so all suggestions are welcome.

14 Nov 2009 . Edited: 14 Nov 2009

Yes - just to be clear - I was going for an analogue (composite) TV signal.

Perhaps you can treat VGA as digital if you are only showing 8-colour (on/off for R,G,B). The signals would need to be 'analog' to get the different shades of red/green/blue.

If you want VGA, perhaps you want a RAMDAC, so you will have a framebuffer you can write to from the mbed board. [edit - just saw the above post, sounds like that might be a bit too hardware rather than software for you]

I was just hacking something together to see if it could be done - getting colour out of a composite signal is fiendishly complicated, so I stuck with grayscale. The DAC generates the whole signal as a single wire output.

 

Here's a couple of sample pics of it running on an old philips TV monitor:

drawing a fractal:

mbed fractal!

writing random values of every pixel to the framebuffer:

random pixels

The on-TV pictures are generated by the mbed on the fly - I used the blank bit at the bottom of the screen to do the processing, and the rest of the time to generate the picture. Resolution is about 125x128.

You can see in this blurry pic I added 1 resistor, but other than that it is just straight into the AV input through the phono cable. It works without the resistor as well, so you can't get much more componentless than that!

 

Got to go, I'll have a go at publishing the code tomorrow!

14 Nov 2009

What kind of analog values are you passing to create that fractal. Really really cool, mbed video games!

15 Nov 2009 . Edited: 15 Nov 2009

OK, I just added some explanation and published the code for composite tv generation.

It's spaghetti code, but like I said this was just a hack, not really intended for public consumption - having said that anyone feel free to use it, improve and play around with it. My C programing is a little rusty at the moment.

The timing might be a little unstable, the only equipment used in its production was an mbed, google and an old CRT tv! I don't have anything like a 'scope to check the timing is quite right. The analogue values for display are unsigned 16 bit DAC writes, so you easily have a full range of shades of gray (even though I think the DAC is 10bit and I use about half the range for non gray values)

 

The fractal code is based on wikipedia, which I ported to C and then tweaked based on another page to make a little faster, but it is all done using doubles, so is super slow (seconds per frame, not frames per second!).

However, the screen updates at 50Hz, even while the picture is being drawn.

 

Anyone who want to make games/understand video - feel free to appropriate this code and improve!

 

(mods - apologies if I have thread-jacked - might be worth spawning this into a seperate thread?)

28 Sep 2010 . Edited: 28 Sep 2010

In the old cookbook, there is a beta VGA and PS/2 keyboard demo at http://mbed.org/projects/cookbook/wiki/VGAConsole and  http://mbed.org/projects/cookbook/wiki/ComponentlessVGA But I can't seem to find the code and it sounds like some work might be needed to run on the new 1768 boards. For keyboard input there is http://mbed.org/projects/cookbook/wiki/PS2Keyboard and mouse at  http://mbed.org/projects/cookbook/wiki/PS2Mouse

Sparkfun has a PS/2 breakout board and I found at least one VGA breakout board. One of the new baseboards has VGA and PS/2.

Does anyone have updates or more info on all of this?

  PS/2VGA 

01 Dec 2010

Rob Younger,

I have put your code on my mbed kit but there seamed to be a problem with the horizontal sync. Has anybody else had the same problem? How can I resolve this problem?

02 Dec 2010 . Edited: 02 Dec 2010

See http://mbed.org/projects/cookbook/wiki/ComponentlessVGA

http://mbed.org/projects/cookbook/wiki/VGAConsole

There are some pretty nifty ideas buried in the old cookbook that people seem to have forgotten about...

EDIT: Hmm I got too excited and didn't realize that someone pointed out the links already...

09 Dec 2010

I heard that vga is history so why don't we start investigating HDMI transmitters. Is there a company out there that can make a breakout board for the following IC.

http://www.nxp.com/documents/data_sheet/TDA9981B.pdf

http://iteadstudio.com/store/index.php?main_page=product_info&cPath=10_22&products_id=272

10 Dec 2010 . Edited: 11 Dec 2010

 

Christian Lerche,

 

I was hoping somebody could come with a low cost board with double buffered video memory on it and hdmi out.

 

This would solve the speed problem.

Sony can output hdmi very cheap with their foto camera's and they must be using some sort of buffered memory.

It is really about the budget. Can a development platform be made for say 20 euro that has enough performance to output a hdmi signal and has a bit of memory to work with?

If I look at mobilephone ,digital photo frames and digital camera's then i most conclude that it is possible to make such a platform..

 

Pieter

 

 

06 Jan 2011

There are also USB to DVI/HDMI/VGA converters which have framebuffers, that would make things a lot easier. In linux some of these devices are already supported so sourcecode is available.

07 Jan 2011

Thats a good idea.. the USB host on the mbed should be fast enough...The problem is with the driver. I wonder if there is enough RAM on the mbed for a decent driver.

19 Jan 2011

Hello,

I only just noticed these comments, so I may be a few months late here!

The code was a slightly crazy on-the-fly generation of something approximating a composite video signal, just to see if it could be done. All signal timing was based on multiplying up the time a DAC write took to produce something like a video signal. The code crudely skips the bottom lines of the picture, using the time to generate the fire/fractal demo code, so there is a good chance that many tv's will just lose sync as there is a big gap in the signal with missing h-sync pulses. Old analog TVs are very forgiving about what input they take, and if they break - it's a good excuse to go out and buy a shiny 40" LCD :-)

If anyone needs 'proper' vga/composite, something like http://www.MicroVGA.com/ could work well (disclaimer - never used this) while keeping things manageable.

If you need anything with better graphics or hdmi, the USB based display adaptors look like a cool idea - I assume they have their own frame buffer and likely use some clever compression to try to fit the data over USB (can they work at low speed USB levels or is it full speed USB 2.0/3.0 only?) It would be worth trying to understand the protocol they use before buying one to see if it could be driven from an mbed easily. (http://floe.butterbrot.org/displaylink/doku.php) Would make a great feature though!

good luck!

16 Feb 2011

http://mbed.org/forum/electronics/topic/1837/?page=1#comment-9138 has some info I just posted on a $49 VGA chip breakout board. Looks like it just came out around Xmas.

15 Feb 2011

Hi Rob, enjoyed your demo, but have some troubles with my PC capture to sync properly. Probably should use real CRT...

Found another interesting app (with LPC2138 / ARM7, all in assembly) http://www.jandspromotions.com/philips2005/Winners/AR1784.htm

15 Feb 2011

Here is a link to a guy that did a pong game using a PIC. It is amazing, I think. I built it and it works very well.

The Mbed could be used too.

The schematic shows how to generate the composite signal. After that, it is just timing!!

http://dt.prohosting.com/pic/pong.html

15 Jul 2012
15 Dec 2012

This looks interesting. http://www.ghielectronics.com/catalog/product/356 But it is a bit expensive.