User avatar
mikronauts
Posts: 2623
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 9:45 pm

Ah.

Consider:

- Long ribbon cable to breadboard for the T-Cobbler
- breadboard with metalic bus bars
- wires to LCD

Now that ugly scope trace makes sense - you are basically adding a lot of capacitance, filtering the high frequency signals.

In your shoes, I'd try:

- use a small protoboard that plugs directly into the GPIO header
- solder short wires to the LCD breakout pins

I think you will get much better results.
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 10:04 pm

mikronauts wrote:Ah.

Consider:

- Long ribbon cable to breadboard for the T-Cobbler
- breadboard with metalic bus bars
- wires to LCD

Now that ugly scope trace makes sense - you are basically adding a lot of capacitance, filtering the high frequency signals.

In your shoes, I'd try:

- use a small protoboard that plugs directly into the GPIO header
- solder short wires to the LCD breakout pins

I think you will get much better results.
Same results with everything removed and probing directly the GPIO header pins. Without having to read through the datasheets for the micro, any idea on the output structure for the D_CLK pin when in DPI mode? Even if the "blob" is no_termination, is there an intrinsic pull-up/down?

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 10:29 pm

Only the Pi? As in "nothing connected at all"?
You are probing ID_SD, right? With nothing connected, and it still gives off weird traces? Try changing the pin mux to I2C and tossing something out there. It should happen on bootup as the Pi probes for an extension EEPROM, set your DSO to single-shot on a falling edge, put the probe in position and apply power to the Pi. Do you get a clean waveform out of that? You might want to connect an external pull-up resistor of around 1.8 kOhm if you do not get a proper high level before DPI takes over and the oscillations start.

The only other semi-probable cause for the oscillations I can identify is that some harmonic of the pixel clock drives a resonant frequency somewhere along the line. But that does not make too much sense to me, as it would be the fourth harmonic, which does not seem to have a large drive strength behind it - square waves tend to be more about uneven harmonics.

User avatar
mikronauts
Posts: 2623
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 10:31 pm

Sorry, don't know.

dom or gert might know.
PR77 wrote:
mikronauts wrote:Ah.

Consider:

- Long ribbon cable to breadboard for the T-Cobbler
- breadboard with metalic bus bars
- wires to LCD

Now that ugly scope trace makes sense - you are basically adding a lot of capacitance, filtering the high frequency signals.

In your shoes, I'd try:

- use a small protoboard that plugs directly into the GPIO header
- solder short wires to the LCD breakout pins

I think you will get much better results.
Same results with everything removed and probing directly the GPIO header pins. Without having to read through the datasheets for the micro, any idea on the output structure for the D_CLK pin when in DPI mode? Even if the "blob" is no_termination, is there an intrinsic pull-up/down?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 10:52 pm

Is your scope probe set to 50 Ohms or high impedance? (just asking....)
In general the PI is GPIO is NOT designed to drive at high frequency signals. (>30MHz)
The VGA, especially at high resolutions, is working at the edge if its capabilities.
I would start with a low resolution and build up from there.

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 10:57 pm

The resolution is small already. We are talking about a DPI LCD that should have a dot clock in the 7-8 MHz range based on its resolution and refresh rate. The 30 MHz clock is a symptom of the problem at hand, it should not be the cause.

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 11:05 pm

Fat D wrote:Only the Pi? As in "nothing connected at all"?
You are probing ID_SD, right? With nothing connected, and it still gives off weird traces? Try changing the pin mux to I2C and tossing something out there. It should happen on bootup as the Pi probes for an extension EEPROM, set your DSO to single-shot on a falling edge, put the probe in position and apply power to the Pi. Do you get a clean waveform out of that? You might want to connect an external pull-up resistor of around 1.8 kOhm if you do not get a proper high level before DPI takes over and the oscillations start.

The only other semi-probable cause for the oscillations I can identify is that some harmonic of the pixel clock drives a resonant frequency somewhere along the line. But that does not make too much sense to me, as it would be the fourth harmonic, which does not seem to have a large drive strength behind it - square waves tend to be more about uneven harmonics.
Yes, D_CLK = ID_SD. Everything has been removed so the only connections to the Pi are the DSO probe, GND and Power (+Micro SD Card). On bootup, I have always seen a burst (approx. 3ms) of I2C traffic so that looks good. I guess the GPIO is OK.
Gert van Loo wrote:Is your scope probe set to 50 Ohms or high impedance? (just asking....)
In general the PI is GPIO is NOT designed to drive at high frequency signals. (>30MHz)
The VGA, especially at high resolutions, is working at the edge if its capabilities.
I would start with a low resolution and build up from there.
Screen resolution is small, Like Fat D mentioned the D_CLK should not be exceed 7MHz. The probes are stock standard Tektronix shipped with most desktop DSOs. The are matched to 50 Ohm at the DSO input but the probe tip should be Hi-Z.

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Gert's VGA add-on for the B+

Fri Feb 06, 2015 11:17 pm

Actually, most standard probes expect 1 Megaohm at the scope input.

thecodeman
Posts: 6
Joined: Fri Feb 06, 2015 9:42 pm

Re: Gert's VGA add-on for the B+

Sat Feb 07, 2015 4:18 am

Yes that clock looks bad , But it still works .
If you run DE and PixClk through inverters it works very well .
Took us a while to get ours going .
And this is a 5v panel .
ken
pi8-1.JPG
lg8-1
pi8-1.JPG (48.02 KiB) Viewed 5047 times
pi8-2.JPG
pi8-2.JPG (59.43 KiB) Viewed 5047 times

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Sun Feb 08, 2015 7:37 pm

thecodeman wrote:Yes that clock looks bad , But it still works .
If you run DE and PixClk through inverters it works very well .
Took us a while to get ours going .
And this is a 5v panel .
ken
pi8-1.JPG
pi8-2.JPG
Firstly, nice work! :) Secondly, what resolution is your screen and your D_CLK frequency? :)

thecodeman
Posts: 6
Joined: Fri Feb 06, 2015 9:42 pm

Re: Gert's VGA add-on for the B+

Sun Feb 08, 2015 8:06 pm

The display is 800x480 and the the clock is 30mhz .
spec for the display is here http://store.earthlcd.com/LB080WV3-B2
that picture is washed out some it really looks nice .
ken

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Sun Feb 08, 2015 10:15 pm

thecodeman wrote:The display is 800x480 and the the clock is 30mhz .
spec for the display is here http://store.earthlcd.com/LB080WV3-B2
that picture is washed out some it really looks nice .
ken
Are you able to share your config.txt and DPI blob? I'm curious to know your cvt configuration. Thx!

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Tue Feb 10, 2015 10:01 pm

Correct Colours.jpg
Correct Colours
Correct Colours.jpg (40.88 KiB) Viewed 4880 times
Woo hoo! Finally I have the correct colours! :D :D :D
The problem was the phasing of the V+H Sync signals. I do however have a couple of stray pixels on the very first row which I did not have before. Nevertheless I'm not too concerned about these just yet. I'm really happy the the setup now but still have a couple of points I'm hoping I can still get help with (you have all be awesome).

The first is the frame buffer size. When I uncomment the following lines to set the frame buffer to the resolution of the screen (400x240) or even larger (1240x720) I see no image on the screen but the DPI signals are jumping about. The screen is always black as is the DPI is outputting a black screen intentionally.

Code: Select all

#framebuffer_width=1280
#framebuffer_height=720
I would like to have this set to the LCD resolution so by default the text on the screen is wrapped and everything else is correctly sized for the screen size.

Secondly is the refresh rate. When I change the HDMI/DPI_CVT to have a refresh rate of anything other that 50 or 60Hz the DPI interface appears to no longer function. The Pi works OK as I can SSH into it to change the CVT however the DPI shows no activity. As mentioned before there is a short burst of I2C data on the IDD/IDC lines but that is it. Any ideas here? I think this one needs someone who is familiar with the firmware to dig a little, perhaps.

OK:

Code: Select all

hdmi_cvt=400 240 50 6 0 0 0
dpi_cvt=400 240 50 6 0 0 0
NOK:

Code: Select all

hdmi_cvt=400 240 24 6 0 0 0
dpi_cvt=400 240 24 6 0 0 0
Thanks!

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Gert's VGA add-on for the B+

Tue Feb 10, 2015 10:39 pm

CVT only specifies a handful of resolutions, and 50 Hz is the slowest one.
My screen gets by just fine in terms of wrapping without forcing a certain framebuffer resolution. I did use console-setup for a smaller font, though.

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Wed Feb 11, 2015 10:31 am

Fat D wrote:CVT only specifies a handful of resolutions, and 50 Hz is the slowest one.
My screen gets by just fine in terms of wrapping without forcing a certain framebuffer resolution. I did use console-setup for a smaller font, though.
Thanks. I will try the console-setup later in the week. I am also planning on spinning a PCB to mount the LCD to the Pi all nice and neatly. Would be good to understand why the framebuffer is not working as I would expect. I have a 4 channel DSO (+ an external trigger input- good for the V Sync) so I might setup a more sophisticated trigger and trace view to see what is going on.

RSvedman
Posts: 24
Joined: Sun Dec 29, 2013 12:24 pm

(OT) reverse use of Gert's VGA add-on for the B+

Fri Feb 13, 2015 10:28 pm

Hmm. wouldn't it be possible to reverse the use of (or modify) the vga666 to INPUT an analog RGBhv signal, to capture for example the picture from an Atari ST or other vintage computer, effectively using the pi as a RGB -> HDMI converter with recording and/or video effects option, or just having the retroputer display in a window of modern flatpanel? Just turn all the pins to input, make sure to adjust the signal level, write the code? How would one go about syncing / timing?

Where is the big flaw of this idea?

User avatar
mikronauts
Posts: 2623
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: (OT) reverse use of Gert's VGA add-on for the B+

Fri Feb 13, 2015 10:37 pm

Not a chance. vga666 is OUTPUT ONLY.
RSvedman wrote:Hmm. wouldn't it be possible to reverse the use of (or modify) the vga666 to INPUT an analog RGBhv signal, to capture for example the picture from an Atari ST or other vintage computer, effectively using the pi as a RGB -> HDMI converter with recording and/or video effects option, or just having the retroputer display in a window of modern flatpanel? Just turn all the pins to input, make sure to adjust the signal level, write the code? How would one go about syncing / timing?

Where is the big flaw of this idea?
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: (OT) reverse use of Gert's VGA add-on for the B+

Fri Feb 13, 2015 11:00 pm

RSvedman wrote:Hmm. wouldn't it be possible to reverse the use of (or modify) the vga666 to INPUT an analog RGBhv signal, to capture for example the picture from an Atari ST or other vintage computer, effectively using the pi as a RGB -> HDMI converter with recording and/or video effects option, or just having the retroputer display in a window of modern flatpanel? Just turn all the pins to input, make sure to adjust the signal level, write the code? How would one go about syncing / timing?

Where is the big flaw of this idea?
No for several reasons:
1/ Behind the VGA is a display driver, (all done in hardware, no CPU involved)
You can not change that into a video receiver.
2/The VGA board uses a a resistor network to convert three 6-bit digital signals into an analog versions.
Unfortunately there does not exists a simple reverse version of that.
You will need a trio of high speed A/D converters to do that.

PR77
Posts: 26
Joined: Tue Jan 06, 2015 9:11 pm
Location: Germany

Re: Gert's VGA add-on for the B+

Wed Feb 18, 2015 9:27 pm

Quick update... Pixel perfect success! With a half decent trigger setup and digging into the timings for the display I now have a pixel perfect display. I no longer have the 2 quirky pixels on the top of the screen and the frame buffer is correctly doing the text wrapping.

I ditched the CVT and went straight into the hdmi_timings;

Code: Select all

enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=327701 #corrected h+v sync polarity and phase.

#cvt does not seem to be required when using hdmi_timings
#hdmi_cvt=400 240 50 6 1 0 0
#dpi_cvt=400 240 50 6 1 0 0

#hdmi_timings configuration notes
#h_active_pixels = 400
#h_sync_polarity = 0
#h_front_porch = 0
#h_sync_pulse = 20
#h_back_porch = 2
#v_active_lines = 240
#v_sync_polarity = 1
#v_front_porch = 2
#v_sync_pulse = 2
#v_back_porch = 4
#v_sync_offset_a = 0
#v_sync_offset_b = 0
#pixel_rep = 0
#frame_rate = 50
#interlaces = 0
#pixel_freq = 400 * 240 * 50 = 4800000
#aspect_ratio = 6

hdmi_timings=400 0 0 20 2 240 1 2 2 4 0 0 0 50 0 4800000 6
I'm now even seeing the rainbow at bootup! :D Thanks to all for your great help. I now just need a problem for this solution to solve! :idea:

EDIT: The D_CLK is also what I would expect now, 4.8MHz. It is a little slow for the display, the Typ. is 7.5 MHz. I will dig into this next to see. Does anyone know what (if any) plausibility check is performed on the hdmi_timing parameters by the firmware? The Pi doesn't seem to boot if I make the Pixel Clock higher than the multiple of the 400*240*50.

User avatar
ElectricCrowbar
Posts: 13
Joined: Mon Feb 16, 2015 5:15 pm
Location: Brooklyn

Re: Gert's VGA add-on for the B+

Sat Feb 21, 2015 9:36 pm

I'm having grey issues, unfortunately I don't have a scope but i'm making do with a logic analyzer:
http://imgur.com/a/ct9vX

As you can see my color lane looks horrific, It should afik be in sync with clock, but it looks like a mess. I'm thinking it may be bread board capacitance related. (Pi cobbler, ribbon cable, blaa)

The effect on the color is interesting. It's not really effecting SOLID colors, but when you start shades it all goes wrong.

I created a sheet to calculate the various settings, even tho I haven't nailed down my screen yet I think the maths in this are sound:
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Also here is my pin out:
https://docs.google.com/spreadsheets/d/ ... B-R7MSeMU0

Hopefully these are found useful by any one else trying this.


EDIT:

Success! It was the bread board. It works perfect once i took the breadboard out of the equation.
https://www.dropbox.com/s/5dckwxovf2e9e ... 5.jpg?dl=0

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Gert's VGA add-on for the B+

Sun Feb 22, 2015 9:11 am

The picture looks more like you mixed up the bits of the green channel. And the Logic Analyzer trace looks like you mixed HSync and VSync as well. On my display (Adafruit 40-pin one) I just ditched the two lines altogether, as DEN and DCLK were doing just fine on their own and I got a free I2C port out of it.

User avatar
ElectricCrowbar
Posts: 13
Joined: Mon Feb 16, 2015 5:15 pm
Location: Brooklyn

Re: Gert's VGA add-on for the B+

Wed Mar 04, 2015 11:29 pm

Hey guys, I wrote up my experience working with DPI on my blog in the hopes that others will have an easier time than I did.

A great deal of the technical information was found here so I credited you all as best as I could. If you feel left out let me know:
http://blog.reasonablycorrect.com/raw-dpi-raspberry-pi/

Fat D
Posts: 32
Joined: Wed Feb 12, 2014 4:22 pm

Re: Gert's VGA add-on for the B+

Thu Mar 05, 2015 7:00 pm

ElectricCrowbar wrote:Hey guys, I wrote up my experience working with DPI on my blog in the hopes that others will have an easier time than I did.

A great deal of the technical information was found here so I credited you all as best as I could. If you feel left out let me know:
http://blog.reasonablycorrect.com/raw-dpi-raspberry-pi/
Great writeup. But some notes:
1: The CFG2/CFG3 variants provide a slightly different pin mapping, that is the main difference. It is all there in Gert's manual.
2: Some screens do not need all four control signals, you might get away with just two or three of them. The Adafruit screens work well without HSync/VSync for instance, giving you access to one of the I²C busses. The one intended for ARM use even.
3: dom deserves some of the credit for releasing the config patterns.

User avatar
ElectricCrowbar
Posts: 13
Joined: Mon Feb 16, 2015 5:15 pm
Location: Brooklyn

Re: Gert's VGA add-on for the B+

Fri Mar 06, 2015 2:06 am

Great feed back, I'm updating now.
2: Some screens do not need all four control signals, you might get away with just two or three of them. The Adafruit screens work well without HSync/VSync for instance, giving you access to one of the I²C busses. The one intended for ARM use even.
I wasn't sure how to handle this. The screen is more than happy running with out them, but does this effect it's reliability in the case of signal noise/instability ?
3: dom deserves some of the credit for releasing the config patterns.
Done, I've re-written the Thank you section. Don't know how I missed that.

Thanks!

civic95man
Posts: 1
Joined: Sat Apr 25, 2015 11:22 pm
Location: Oregon, USA

Re: Gert's VGA add-on for the B+

Mon Apr 27, 2015 6:24 pm

First off, this is great work from Gert! I managed to get my LCD (1024 x 600) interfaced to my Raspberry Pi 2 without any trouble and got it displaying an image shortly after. I discovered after reading the datasheet of the LCD several times that v_sync and h_sync weren't needed and left them disconnected from the pi (but tied to ground on the LCD side). I am using the 888 mode for 24bit color and had to modify the dt_blob to account for this, I also released the h_sync and v_sync gpio lines from the dpi interface so they should be usable for i2c (haven't tested yet).

I have one question about the pixel frequency for "hdmi_timings" in the config.txt file. I see everyone saying that clock is (h_pixels * v_pixels * refresh rate), which makes sense but what exactly is h_pixels and v_pixels? For my display, 1024 * 600 * 60 = 36.864MHz, whereas the datasheet specifies the clock at ~51.2MHz @ 60hz. I'm wondering if we need to account for the synchronization pulses too. My display has a nominal Horizontal blank of 320 dclk cycles and a Vertical blank of 35 dclk cycles. So if I calculate the clock to be the entire horizontal and vertical period (visible and blanking), that comes out to: (1024 + 320) * (600 + 35) * 60 = 51.2064MHz. This value matches what the datasheet specifies for the LCD. I tried putting this into the config.txt and the display works fine still.

This is the config.txt changes:
dpi_output_format=461847
hdmi_timings=1024 1 0 320 0 600 0 0 35 0 0 0 0 60 0 51206400 6

I thought that the HS blanking of 320 was a bit much and the datasheet does say that the minimum value is 90. I might try something lower like 100 and see if I still get a picture. Anyway, I just wanted to see if I had the correct understanding here or if I missed something.

Thank you

Return to “B+ addons”

Who is online

Users browsing this forum: No registered users and 1 guest