Here is a SW example for setting up the VS23S010 video display controller in
PAL video mode. A picture containing 256 boxes of different colors is
This software is written for VS1005 using VSOS 3.25 operating system. VS1005
Developer board is connected to VS23S010 lab board. VS1005 SPI bus is used to
control VS23S010. VS23S010 VideoOut is connected via 75 ohm serial resistor to
composite video input of a TV.
The program is quite generic so it can be used as a guide for writing SW also
for other micro-controllers with SPI interface.
The main program is in main.c. It just calls the SpiRamVideoInit() function.
pal.c has the main functions and parameter setting for the video display
controller. SpiRamVideoInit() is the function that sets up the video display
controller and generates picture.
The pal.h header file has all the definitions used by video display controller.
There are several parameters that can be adjusted by editing #defines:
- INTERLACE selects progressive or interlaced picture. In this program
interlaced picture just makes the picture area of first field twice. The
vertical synchronization of video is changed in the programme according to
- BYTEPIC selects 8 bit or 16 bit pixels.
- PLL_CLKS_PER_PIXEL selects the length of pixel in VClk cycles. In this
program it should be three or more. This value sets the pixel length in VClk
- BEXTRA is the amount of extra bytes after picture end to prevent picture
to proto area border artifacts. Zero is a good starting point. If there are no
artifacts, let the value be zero. If there are artifacts, set BEXTRA to eight.
- STARTLINE sets the line at which the picture area starts.
- YPIXELS set the picture area in pixels in Y direction. Check that the
picture data amount does not exceed the memory area.
- STARTPIX sets the horizontal pixel at which the picture area begins.
Notice that STARTPIX value has to be larger than line blanking end value.
STARTPIX value is given in CSClk cycles.
- XPIXELS set the picture area in pixels in X direction. Check that the
picture does not become bigger than the memory area. Also check that the length
of picture area is not longer than the line or does not reach the front porch
of the line.
- different BLANK_LEVEL, BLACK_LEVEL and BURST_LEVEL values
can be selected by commenting and uncommenting #defines. By adjusting
BURST_LEVEL different color palettes can be created.
- PAL horizontal sync timing constraints are defined here too (SHORT_SYNC_US,
SHORTSYNC, SHORTSYNCM ... FRPORCH).
Here is a picture of TV screen after the program is run. Video is
progressive and 8 bits is used for a pixel in picture area. The picture area
(299x240 pixels) is framed by greenish lines. Other parts of image are
generated by prototype lines.
The microcode program for picture area is B22 A22 Y44 N10:
- Pick 2 bits B (U), shift 2 bits B22
- Pick 2 bits A (V), shift 2 bits A22
- Pick 4 bits Y, shift 4 bits Y44
- and do nothing N10
- Total 8 bits is used for a picture area pixel
The color burst level (U and V value) is set to 0xb5 in the proto line. In the picture can be seen the
color palette of this setup. PLL_CLKS_PER_PIXEL is set to 5.
Here is the VS1005 std out to terminal when program is run:
- VS23S010 INIT
Manufacturer ID: 2b03
ID ok, 4 VS23 ICs in system
Linelen: 2260 PLL clks
Picture line area is 299 x 240
Upper left corner is point (0,0) and lower right corner (298,239)
Memory space available for picture bytes 127860
Free bytes 54180
Picture line 308 bytes
Picture length, 187 color cycles
Picture pixel bits 8
Start pixel 39
End pixel f4
Index start address 8e0
Picture line 0 address c8c
b8 <= 0eh
01 <= 40h
28 <= 0039h
29 <= 00f4h
2b <= 3000h
2a <= 08d4h
2c <= 0238h
34 <= 0000000010h
2d <= d138h
Current line: 806e
and different microcodes of picture area.
Please feel free to ask any questions regarding this example or VS23S010 usage.
Pasi Isotalus, Senior IC Design Engineer, VLSI Solution Oy