Timing is everything

20.02.2011

Using a TFT LCD panel in an embedded application for displaying data opens a whole new range of opportunities. I’m trying to configure a Spartan-III FPGA in a way that this can be achieved.

Connecting the LCD screen to an FPGA

So, I had the Mitsubishi VGA panel from an old MITAC laptop, the pinout of the 31 pins and some scope measurements of the timings that the old laptop had generated. The next step would be to physically connect the display to the FPGA board. For simplicity, I decided to have only 3 bits of color information, i.e. connect all the bits of each color channel (R, G, B) with each other and have only 1 bit per color. So, 7 signals were enough to start with:

The display needs a 5V power supply and logic levels. This also means that directly connecting the signals to the FPGA wouldn’t work as the FPGA’s highest voltage is 3.3V. After spending some time searching for a level converter, I decided to use a 74HCT573 which I had in my box of spare parts. There exist some specialized components for this purpose, but the 74HCT573 works just fine. Everything above 2.0V is recognized as a logic HIGH by this IC, everything below 0.8V as logic LOW. The Spartan-III datasheet specifies the maximum output voltage for logic LOW to 0.4V and the minimum output voltage for logic HIGH to 2.4V in LVTTL configuration of the I/O’s.

The first goal was to display a blank, stable, non-flickering image on the LCD panel. Some time had passed since I had last used the FPGA development tools. Specifically, I had replaced my Toshiba laptop running Win XP with a MacBook Pro two years ago and had no working installation of the development tools. I installed the most recent version of the ISE development environment in a virtual machine on the Mac.

With some trial and error, I managed to get an initial design and display some color lines on the TFT screen (see VHDL file at the right side).

One point I had skipped at that time (and which I still didn’t fix up until now) is the high-voltage supply of the TFT backlight. Luckily, connecting the two-wire high-voltage cable of the TFT to the voltage inverter on the old laptop’s mainboard solved this problem. I plan to find a better solution one day.

Download the source code: sources