...your main source of everything AVR32 Linux

Navigation

AtmelFbDriver

Using the VGA port of the STK1000 board

Producing the proper video timings for an analog video monitor can be tricky. The timings must be fairly precise for the monitor to properly sync up and display the video. It may be necessary to change the clock source for the AVR32 LCDC in the kernel to use OSC1 (the 12MHz crystal on the STK1002) and/or use PLL1. Attached is a patch to provide support for PLL1 in kernels before 2.6.25. It is also necessary to reserve a portion of the SDRAM for the display buffer when booting the kernel, using the uboot bootargs value fbmem. For a 640x480 display at a color depth of 16 bits per pixel, you will need to reserve at least 576k of memory (fbmem=600k). That value can be calculated by the following equation:

X resolution * Y resolution * (bits per pixel / 8)

Timing

The timing values for LCD panels is usually provided in the datasheet for the panel you are using. Simply plug these values into an fbset command. For example, to set the timing for the STK1000's on-board LCD panel (Samsung LTV350QV):

fbset -g 320 240 320 240 24 -t 157741 17 33 10 10 16 1

The timing values for a monitor can be calculated using the gtf command. GTF is an acronym for the Generalized Timing Formula created by VESA, the Video Electronics Standards Association. The timings generated by the gtf command should be compatible with any monitor that adheres to the VESA standards. GTF is a standalone program included in most Linux distributions or can be compiled to run on the AVR32 itself.

gtf 640 480 60 -f

mode "640x480 60.00Hz 32bit (GTF)"
    # PCLK: 23.86 MHz, H: 29.82 kHz, V: 60.00 Hz
    geometry 640 480 640 480 32
    timings 41918 80 16 13 1 64 3
    hsync low
    vsync high
endmode

fbset -g 640 480 640 480 16 -t 41918 80 16 13 1 64 3

fbset

The following is a breakdown of the fbset command. fbset is a utility included in busybox's util-linux section. It can also be compiled as a standalone program.

The -g flag sets the display geometry.

The first two values are the x and y resolution on the display itself. The second two values are the x and y virtual resolution of the display area. If the second set of values is larger than the first, the display area can be panned. The last value is the display's color depth in bits per pixel.

The -t flag sets the timings.

    -pixclock 
        set the length of one pixel (in picoseconds). Note that the frame buffer device may only support some pixel lengths 
    -left 
        set left margin (in pixels) 
    -right 
        set right margin (in pixels) 
    -upper 
        set upper margin (in pixel lines) 
    -lower 
        set lower margin (in pixel lines) 
    -hslen 
        set horizontal sync length (in pixels) 
    -vslen 
        set vertical sync length (in pixel lines) 

r2 - 16 Jul 2008 - 15:21 - JohnVoltz
  Attachment Action Size Date Who Comment
pdf LTV350QV-F09.pdf props, move 714.5 K 28 Jun 2008 - 18:51 JohnVoltz LTV350QV datasheet
else atstk1000-video-timing.patch props, move 5.5 K 28 Jun 2008 - 18:51 JohnVoltz Patch ta add support for PLL1 and improved video
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Atmel®, AVR® and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
All other trademarks are the property of their respective owners.
Powered by Wed, 08 Feb 2006 build 8740
Syndicate this site