(hide navigation)
  • Swedish content
Fund my projects
Patreon
Steady
Don't miss
Page thumbnail
The hardware chiptune project
Forum
Register
Log in
Latest comments
Syndication
RSS feed
Feedback
Hardware projects

Beagleboard VGA output

This article describes how you can extract a VGA signal from the LCD headers on a revision C beagleboard using two transistors and a bunch of resistors.

Overview

The beagleboard normally provides two video signals, DVI-D and S-Video. We're going to hook into some of the signals going from the OMAP chip to the TFP410 chip (DVI interface). This means that we'll tell the operating system to use the DVI-D interface (rather than S-Video), and read out the digital pixel values as they are transmitted. The DVI-D signal will not be affected, so you could connect both a VGA monitor and a DVI-D monitor and see the same image, as long as the video mode is compatible with both monitors.

Hardware

The hardware consists of three digital-to-analog converters (R-2R ladders), one each for the red, green and blue channel, and two level shifters for the sync signals.

The present solution assumes that the system is using 16-bit pixels in 5-6-5 format, but you can easily extend it to full 24-bit colour by making the resistor ladders longer.

You will need:

QuantityPartNeeded for
1360 Ω resistorR-2R ladders
19120 Ω resistorR-2R ladders
2100 Ω resistorLevel shifters
21 kΩ resistorLevel shifters
2NPN transistor, e.g. BC547CLevel shifters

If you can't find resistors with these exact values, pick something close enough (but see "explanation" below). Try to match the ladder resistors so that one is exactly twice as resistive as the other. I ended up using 60.4 Ω and 121 Ω myself. Use low-tolerance metal film resistors for the ladders.

I would recommend some kind of header or other means of connecting and disconnecting the adapter from the beagleboard, in case you want to change things later. I settled for ribbon cables with headers on one end, soldered directly to the beagleboard at the other end. Another approach would be to solder two receptacles directly to the beagleboard, and plug two 20-way ribbon cables or a PCB with matching headers into them. It's up to you.

Schematic

Disclaimer: There could be errors in the diagram. Please double check all connections and pin numbers with the beagleboard system reference manual. If you've successfully built the adapter from the schematic, let me know and I'll remove this disclaimer.

Adapter schematics

You can pick up the 5 V rail from J4:1 and ground from J4:20, or use the supply which is powering the beagleboard.

Explanation

The digital data lines carry the actual pixel values, expanded into 24 bits. The expansion is done by repeating the most significant bits, so e.g. the five red bits R4 R3 R2 R1 R0 are transmitted as R4 R3 R2 R1 R0 R4 R3 R2 on lines 23 through 16. A logic one is encoded as 1.8 V, and a logic zero is at ground potential. The resistor ladder has an equivalent series resistance of 60 Ω, and the VGA load (monitor) has an input impedance of 75 Ω according to the VGA specification. These resistances will form a voltage divider, converting the 1.8 V peak voltage into 1.8 * 75 / (75 + 60) = 1.0 V, which is the specified peak voltage for a VGA signal.

The sync signals are also at 1.8 V, but VGA requires 5 V TTL signals. The transistors act as TTL inverters. When the base is at ground potential, the transistor blocks, and the output signal is pulled up to 5 V via a 1 kΩ resistor. When the base is at 1.8 V, the transistor becomes open, essentially shorting the output signal to ground. Modern VGA monitors don't care about sync polarity. If you are planning to use a really old VGA monitor, you may have to add an extra inverter to either or both of the sync signals, depending on which video resolution you'll be using.

Caution

You probably already know this, but please take measures to avoid electrostatic discharge. If you're standing on a vinyl floor, wearing rubber shoes, combing your hair with a cat while handling the beagleboard, it may become damaged in non-obvious and strange ways.

Don't forget to verify that your newly attached wires aren't shorted, preferably before connecting power.

Software

Once the hardware is up and running, you may or may not get a picture on your VGA monitor. In either case, you should still get a valid DVI-D signal, allowing you to interact with the system. However, it's a good idea to issue the following commands over an ssh connection to the beagleboard, if possible, because you'll be manipulating the video timing parameters and the picture could disappear completely.

First, make sure to select your desired resolution at boot, e.g. omapfb.mode=dvi:1024x768-16@60. Avoid the R flag (reduced blanking).

When the system is up, cat the following file: /sys/devices/platform/omapdss/display0/timings

The output is in the format pixclock,xres/hfp/hbp/hsw,yres/vfp/vbp/vsw

FieldUnitDescription
pixclockpicosecondsThe duration of one pixel
xrespixelsWidth of visible area (typically width of framebuffer)
hfppixelsHorizontal front porch
hbppixelsHorizontal back porch
hswpixelsHorizontal sync width
yresrowsHeight of visible area (typically height of framebuffer)
vfprowsVertical front porch
vbprowsVertical back porch
vswrowsVertical sync "width" (in rows)

Details are available in the kernel sources, in Documentation/arm/OMAP/DSS.

Getting an image at all

As root, experiment with the values in timings. If your monitor can display the current horizontal and vertical frequency, study how they change.

Try out various pixclock values first, until you have a stable image on the screen. Then tweak the porches and sync widths until you're satisfied with the size and placement of the image.

Fixing the right border

Some display lines may look strange. This is because the digital data bus we're sampling doesn't revert to black after each display line, so the rightmost pixel will "carry over" through the horizontal blanking period and into the beginning of the next line. Some monitors calibrate themselves during horizontal blanking, so whatever voltage they see during that time will be considered black in the upcoming line. Try to move the mouse cursor along the right end of the screen and see if you get this strange phenomenon.

If so, you can fix it easily by adding a black pixel to the right of each video line:

The timings file describes the dimensions of the actual video signal. The framebuffer, i.e. the chunk of memory where all the pixels are stored, is described using something called an overlay (/sys/devices/platform/omapdss/overlay0/...).

This means that we can modify the dimensions of the video signal, extending it somewhat to the right, without modifying the size of the framebuffer. The width has to be a multiple of eight pixels, so we have to go from e.g. 1024 to 1032.

This fixes the VGA signal, but unfortunately the DVI-D picture now has a small black border along the right edge. I don't know of a way to fix this properly, but most monitors allow the user to resize and move the image around freely, so you might be able to scroll those black pixels off the screen.

Examples

My monitor works with the following parameters:

Boot modeModified timings
1024x768-16@6060000,1032/120/128/32,768/3/15/4
800x600-16@7550000,808/34/198/20,600/23/37/6

I have configured my boot scripts to update the timings file automatically one second after x.org has started.

A better way?

Writing to timings directly is a kludge, and it's probably possible to get x.org to use VGA-compatible timings in the first place. This will definitely be an issue if you want to be able to switch between different video modes during regular use. I'm using a fixed resolution, so I haven't looked into this yet, but it's probably just a matter of putting the right thing in your xorg.conf.

Please post your suggestions on this page!

Troubleshooting

Verify that there are no shorts or breaks. When the device is on, verify that the board is configured for DVI-D output, and that the DVI-D signal is still working. Fill the screen with pixels in various colours (black, white, red, green, blue, ...) and study the DC voltage at various points in the circuit. Experiment with different resolutions and timings.

Posted Sunday 17-Jan-2010 17:00

Discuss this page

Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.

Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.

Anonymous
Mon 18-Jan-2010 15:17
Wow, this is pretty cool! I will definitely build this! :) When is a bit indefinite tough...
Anonymous
Wed 20-Jan-2010 10:42
This is great, since i don't have dvi-monitor and i'm not willing to pay for one just for beagleboard use, atleast not now.
Anonymous
Fri 22-Jan-2010 00:53
Quite some research, good work!

For the R2R ladder would maybe save some money if instead of using resistors of double the resistance, just put two in series? I do that with R2R DAC's for VGA and sound production. For example, interfacing with a VGA I use a bunch of 270 ohm resistors to approximately match the 75ohm impedance of the VGA. For audio, I use 10K resistors mostly.

SMD resistors on a roll, are usually from the same batch, so they are pretty well matched. Saves on buying 1% types, but the price difference between 5% is small anyway.
Anonymous
Wed 27-Jan-2010 23:37
That's a sweet little monitor! Is that 7"? Most small lcds I've seen don't take vga input or are usb only! Where did you buy that?
lft
Linus Åkesson
Thu 28-Jan-2010 16:18
That's a sweet little monitor! Is that 7"? Most small lcds I've seen don't take vga input or are usb only! Where did you buy that?

It's a TM7100 from Deltaco, 7" TFT 1024x768, VGA and two composite inputs. Very handy when playing around with video signals.
Anonymous
Thu 28-Jan-2010 22:19
This is an elegant solution to the VGA issue on the beagleboard.

How would you modify the design to send out a combined sync signal? I have a display in my car that is 400 x 234 but the input is RGBs.

Thank you.
trevj
Trevor Johnson
Wed 17-Feb-2010 15:54
Hi. I've not tried building this but recently sent a link via usenet, which received the following comment:
It's well-meaning, but the designer clearly hasn't thought that the output resistance of the logic gates isn't zero, so the 120 ohm resistors should have a lower value (lower by the typical output resistance of the gates). It doesn't stop it working, but it spoils the linearity of the D-A conversion. There might be some interesting effects on a graduated fill.
Has anyone else here come to the same conclusion?
Anonymous
Sun 7-Mar-2010 16:31
Hi, i'm the Anonymous from Wed 20-Jan-2010 10:42.

I just got my VGA converter ready and it seems to work great. The picture on the VGA side has some top rows on the bottom even after i adjusted the monitor(quite old nokia 500 Xa LCD monitor). The colors seem ok(the orange angstrom logo and the blue text), though i haven't had any full color pictures up yet, so don't know about the graduated colors, that TrevJ commented about. I have both VGA and DVI on(straight HMDI cable to a TV).

The schematic is fine. I added the DDC lines, 5V and 1,8V lines including voltage converters for the DDC lines on mine based on the sparkfun i2c level converter.

Just finished it like half an hour or so ago.

Thank you very much.
trevj
Trevor Johnson
Mon 8-Mar-2010 10:19
Great news :-)
...don't know about the graduated colors...
Please keep us posted on this.

My BeagleBoard just arrived last week but I'm having to use a borrowed monitor until I sort out something else (like this adapter).
Anonymous
Sun 21-Mar-2010 07:28
This is great!! thanks for posting this.
Just out of curiosity, do you know if S-Video to VGA converter will work? like http://www.svideo.com/video2vga.html.
lft
Linus Åkesson
Tue 23-Mar-2010 07:09
This is great!! thanks for posting this.
Just out of curiosity, do you know if S-Video to VGA converter will work? like http://www.svideo.com/video2vga.html.

Yes, it should work. You'd be limited to S-Video resolution, though.
Anonymous
Sun 4-Apr-2010 11:40
Hi,

I've been struck with a beagleboard for 6 months now( i don't have anything except VGA monitors!) and now i'm going to try this. Can you throw some light on the connections to be taken from the beagle board? Images would be of great help.

Cheers,
pracas
Anonymous
Fri 9-Apr-2010 06:09
What about output current from the processor ? You plug outputs from the processor against 240 Ohm -> 7.5 mA.
Isn't the nominal current only 0.1 mA ? I have this info from the OMAP3530 datasheet.
lft
Linus Åkesson
Sat 24-Apr-2010 18:52
What about output current from the processor ? You plug outputs from the processor against 240 Ohm -> 7.5 mA.
Isn't the nominal current only 0.1 mA ? I have this info from the OMAP3530 datasheet.

Good point! I didn't think of that. This should in theory cause non-linearities, but I have looked at gradients and they look all right.
Anonymous
Thu 8-Jul-2010 20:10
Is not the VGA signal peak level 0.7V? every vga module data sheet, vga spec and web documents state this, sync being TTL level 5v, and rgb 0.7v, even the TI Video DACS (THS3185, THS8200) state a 700mV peak level for white

From information in the net, only some non standard monitors use 1v level

http://microvga.com/faq/electrical/what-are-vga-voltage-levels
http://en.wikipedia.org/wiki/Video_Graphics_Array#Technical_details
http://www.ti.com/litv/pdf/slas343a

Or this beacuse the blanking level is 350mV and this offsets the 700mV to be 1v peak white?
Anonymous
Wed 22-Sep-2010 11:01
i have an LCD screen that i managed to salvage from a broken laptop - how can i use that with the beagle board? do you have an ideas on how i can do that? or point me in a direction where i can start looking?

Thanks and regards,
..Partha
ajaysusarla at gmail [dot]com
Anonymous
Fri 24-Sep-2010 17:30
Does this work with BB xm as well ?
Anybody with any experience so far ??
Anonymous
Thu 25-Nov-2010 13:16
Nice work Linus!
I have no experience with this, but wouldn't it be possible just to connect an HDMI to DVI adapter followed by a DVI to VGA adapter to the HDMI port on the BB?

/G
Anonymous
Sun 28-Nov-2010 04:53
Nice work Linus!
I have no experience with this, but wouldn't it be possible just to connect an HDMI to DVI adapter followed by a DVI to VGA adapter to the HDMI port on the BB?

/G
no it would not, the only signal that is coming through the HDMI port is digital. The way most DVI to VGA adapters work is by taking the analog portion of DVI and wire it to VGA. The alternative method to this would be to buy an actual digital to analog converter. However this method would cost more than the Beagleboard itself.
Anonymous
Fri 3-Dec-2010 17:20
I found a solution to the right border issue, but it requires modification of the linux kernel. For whichever display driver you're using (OMAPFB or OMAP-DSS2), you can enable the AC-Bias signal (normally used to prevent polarization in LCD displays) to generate a "blank" signal. This could be then used to trigger some kind of analog mux (I'm using the TI THS8135's blank input) to drive the outputs to zero (blank level). The register you need to modify is DISPC_POL_FREQ, specifically fields ACBI and ACB. I used ACBI=0 and ACB=0x28 which matches up with my 640x480 display quite nicely. :-)

OMAP2-DSS allows you to set this easily in display-generic.c, in generic_panel_probe():
dssdev->panel.config = OMAP_DSS_LCD_TFT;
dssdev->panel.timings = rwc_vga_panel_timings;
dssdev->panel.acbi = 0;
dssdev->panel.acb = 0x28;
Anonymous
Wed 2-Mar-2011 13:47
Hey
I tried using the same system for a BB XM. Somehow the board does not boot up when the circuit is plugged in. I am getting the DVI output but nothing on the VGA screen (plugged in after the boot). Any ideas??
Andre
André van Schoubroeck
Sat 19-Mar-2011 20:03
Hi, i'm the Anonymous from Wed 20-Jan-2010 10:42.

I just got my VGA converter ready and it seems to work great. The picture on the VGA side has some top rows on the bottom even after i adjusted the monitor(quite old nokia 500 Xa LCD monitor). The colors seem ok(the orange angstrom logo and the blue text), though i haven't had any full color pictures up yet, so don't know about the graduated colors, that TrevJ commented about. I have both VGA and DVI on(straight HMDI cable to a TV).

The schematic is fine. I added the DDC lines, 5V and 1,8V lines including voltage converters for the DDC lines on mine based on the sparkfun i2c level converter.

Just finished it like half an hour or so ago.

Thank you very much.

I have a question about the DDC lines. These are to return the monitor identification and information.
But what does the BeagleBoard do with the values. Will it auto-configure the display timings based on these values?

Also, if I look at these I will need to supply 5 volts on pin 9 http://pinouts.ru/Video/VGAVesaDdc_pinout.shtml
The SDA and SCL, are they supposed to be level shifted to 5 volts? Or what's their signal level supposed to be?
Anonymous
Tue 26-Apr-2011 19:23

Andre wrote:

Hi, i'm the Anonymous from Wed 20-Jan-2010 10:42.

I just got my VGA converter ready and it seems to work great. The picture on the VGA side has some top rows on the bottom even after i adjusted the monitor(quite old nokia 500 Xa LCD monitor). The colors seem ok(the orange angstrom logo and the blue text), though i haven't had any full color pictures up yet, so don't know about the graduated colors, that TrevJ commented about. I have both VGA and DVI on(straight HMDI cable to a TV).

The schematic is fine. I added the DDC lines, 5V and 1,8V lines including voltage converters for the DDC lines on mine based on the sparkfun i2c level converter.

Just finished it like half an hour or so ago.

Thank you very much.

I have a question about the DDC lines. These are to return the monitor identification and information.
But what does the BeagleBoard do with the values. Will it auto-configure the display timings based on these values?

Also, if I look at these I will need to supply 5 volts on pin 9 http://pinouts.ru/Video/VGAVesaDdc_pinout.shtml
The SDA and SCL, are they supposed to be level shifted to 5 volts? Or what's their signal level supposed to be?

The VESA E-DDC specification specifies use of I2C at +5V.
Anonymous
Wed 11-May-2011 19:17
Linus, so why did you go with 1volt peek-to-peek?
Some monitors provide support for 1V peak-to-peak signals,
but they are not standardized.
So why not 0.7v in your calculations?

Option: Using two 2R's in parallel to make the R's
And a there are less R's than 2R's,
so less waste than putting two R's in series to make 2R
Anonymous
Tue 31-May-2011 17:49
Or one could try to use a FMS-3818 tripple dac
Anonymous
Thu 2-Jun-2011 17:03
Is it possibile to connect two monitors to a BeagleBoard (CE6 does support it) ?
Anonymous
Sat 4-Jun-2011 06:02
hello ,i want to change the timings,but i don't know how to save it
lft
Linus Åkesson
Fri 1-Jul-2011 12:00

Andre wrote:

Also, if I look at these I will need to supply 5 volts on pin 9 http://pinouts.ru/Video/VGAVesaDdc_pinout.shtml

In my experience, if you don't need DDC then you can leave pin 9 floating; all monitors will gladly display the signal anyway.
lft
Linus Åkesson
Fri 1-Jul-2011 12:31
Linus, so why did you go with 1volt peek-to-peek?
Some monitors provide support for 1V peak-to-peak signals,
but they are not standardized.
So why not 0.7v in your calculations?

Hmm, you are quite right. The answer is that it's a mistake. However, my setup is working, and a possible explanation might be that the digital signals are current limited or have an internal resistance that compensates for this error.

Option: Using two 2R's in parallel to make the R's
And a there are less R's than 2R's,
so less waste than putting two R's in series to make 2R

Splendid!
Anonymous
Thu 22-Mar-2012 15:54
hello ,i want to change the timings,but i don't know how to save it

echo "your new timings" > /sys/devices/platform/omapdss/display0/timings
Anonymous
Thu 21-Jun-2012 14:21
In the new beagle board-xm revision C J4 & J5 are called P11 & P13 instead... Please take a note of this. Check the BB's Rev C manual not generic one here...
http://beagleboard.org/static/BB-xM_REV_C-2011-05-23.zip
Anonymous
Sat 19-Jan-2013 06:31
do i have to give separate 5V and gnd or ds the ckt inherently take it from the board..??
Anonymous
Tue 2-Apr-2013 20:38
do you have hdmi to vga homemade ?
Anonymous
Mon 10-Jun-2013 18:45
Master Linus, I'm trying this (for HDMI out from Android phone to vga monitor):

https://sites.google.com/site/scidiy/pc-diy/hdmi-to-vga

As none can see anything in the section "How to wire it up:", can anyone show us? (that site has no way to contact (or know who is) the owner...)

I'm wondering here, can someone draw the schematics using that thinking, with the suggested improvements:

a) The original project uses software to generate the H/Vsync signals and thereby it uses up 2 valuable GPIO's. So we need to generate these signals with a couple cheap and simple oscillators (NE556). The maker chose to generate them with software but maybe it is more convenient to do that electronically with a NE556 dual timer IC.


1) added the DDC lines, 5V and 1,8V lines including voltage converters for the DDC lines on mine based on the sparkfun i2c level converter.

2) For the R2R ladder would maybe save some money if instead of using resistors of double the resistance, just put two in series? I do that with R2R DAC's for VGA and sound production. For example, interfacing with a VGA I use a bunch of 270 ohm resistors to approximately match the 75ohm impedance of the VGA. For audio, I use 10K resistors mostly. SMD resistors on a roll, are usually from the same batch, so they are pretty well matched. Saves on buying 1% types, but the price difference between 5% is small anyway. (Saves room too, for those who desire smaller mountings)

3) Option: Using two 2R's in parallel to make the R's
And a there are less R's than 2R's,
so less waste than putting two R's in series to make 2R

4) Or one could try to use a FMS-3818 tripple dac

Can anyone? Thanks.
dssence
Paul
Mon 21-Oct-2013 08:45
Hi I got a beagleboard normal model not beagleboard XM. I'm desperately trying to make VGA out work. I know this board supports DVI via a cape add on. I've read on another site some guy did manage to make vga work out emulating the EEPROM Data. Now my question is would this work on my board? if I can check the pinouts or will be worthless?
Anonymous
Fri 31-Jan-2014 01:31
Attach the following to each R G B signal at the connector to drive the signal low on each horizontal blank

.....10k ohm... |/---- Red (repeat for Green and Blue)
hblank... -/\/\--|
...................... |\ 2n3904 transistor
........................ |
...................... gnd
Anonymous
Sat 29-Mar-2014 15:55
Attach the following to each R G B signal at the connector to drive the signal low on each horizontal blank

.....10k ohm... |/---- Red (repeat for Green and Blue)
hblank... -/\/\--|
...................... |\ 2n3904 transistor
........................ |
...................... gnd
Anonymous
Fri 30-Jun-2017 14:15
If I want to modify the schematic to fit a 40 pin tft, would I continue the resistance chain to fit the 8 channel RGB? or do I recalculate the resistance based on a total?
I have no experience with working with the confusing and complex LCD variations. to be honest, I don't know what to do with most the LCD pins on a BBB
for reference: https://www.element14.com/community/message/224509/l/bbb-and-tft-lcd-driver-board#224509