APPLICATION NOTE
1
ANXXXX.0
04/01/2014
CAUTION: These devices are sensitive to electrostatic discharge; follow proper IC Handling Procedures.
1-888-INTERSIL or 1-888-468-3774 | Copyright Intersil Americas Inc. 2010. All Rights Reserved
Intersil (and design) is a trademark owned by Intersil Corporation or one of its subsidiaries.
All other trademarks mentioned are the property of their respective owners.
T
e
c
h
w
e
l
l
SPI OSD
TW8836
Overview
This document describes about SPI OSD part of TW8836 base on the datasheet. The customer can get the further information
from the datasheet.
TW8836 SPI OSD can read the bitmap images from SPI Flash memory and merge it with the Video input and then, display it on
the LCD Display screen. TW8836 supports 9 SPI OSD windows that can be overlapped. The bitmap image can be a 4/6/7/8 Bit
per Pixel image and two window images can be compressed.
Features
9 Bitmap based OSD windows through SPI
Support 4/6/7/8 bits per pixel
Support RLE decompression for two window groups
Support overlapping between widows
Support HW animation on WIN 0
Support alpha blending by pixel level or window level
256 LUT (Palette Table) entries shared by WIN1 and WIN2
512 LUT entries shared by all other windows
Support 256Mb SPI Flash
Support 1366 horizontal pixels
No Frame buffer required
TW8836
2
SPI OSD.....................................................................................................................................1
TW8836......................................................................................................................................1
Overview ...................................................................................................................................1
1 Two SPI OSD Layers..............................................................................................................4
2 Decoding Steps ..................................................................................................................... 5
3 SPI Flash ................................................................................................................................ 6
3.1 QUAD IO............................................................................................................................................................6
3.2 SPI FLASH COMMAND SET .................................................................................................................................7
3.3 ENABLE QUAD-IO MODE ...................................................................................................................................8
3.4 24BIT ADDRESSING ............................................................................................................................................8
4 TW8836 SPI............................................................................................................................ 9
4.1 SPI REGISTERS...................................................................................................................................................9
4.2 SPI INPUT CLOCK LATCH..................................................................................................................................10
4.3 SPI FLASH READ TO HW REGISTER BUFFER.....................................................................................................11
4.4 SPIC MONITOR COMMAND...............................................................................................................................12
4.5 SPI FLASH READ TO MCU MEMORY BUFFER....................................................................................................12
5 LUT (Loop Up Table or Palette)........................................................................................... 14
5.1 TW8836 HW PALETTE STRUCTURE .................................................................................................................14
5.2 DMAMODE FOR BYTE POINTER METHOD ......................................................................................................14
5.3 IO MODE FOR ADDR POINTER METHOD ..........................................................................................................15
5.4 PIXELALPHA BLENDING ..................................................................................................................................16
6 Run Length Compress ........................................................................................................ 18
6.1 EXAMPLE RLE FILE .........................................................................................................................................18
6.2 MIPS ISSUE .....................................................................................................................................................19
7 SPI OSD Windows ...............................................................................................................20
7.1 SPI OSD WINDOW REGISTER SUMMARY.........................................................................................................20
7.2 OVERLAPPED WINDOW....................................................................................................................................21
7.3 START POSITION, WIDTH AND HEIGHT...............................................................................................................21
7.4 LINK TO SPI FLASH MEMORY...........................................................................................................................22
7.5 PALETTE ASSIGN ..............................................................................................................................................22
7.6 WINDOW ALPHA BLENDING .............................................................................................................................23
7.7 SPIOSDSETDEVALUE.......................................................................................................................................24
7.8 BUFFER MEMORY BIT STARTING ADDRESS......................................................................................................25
7.9 WIN0 HWANIMATION ....................................................................................................................................25
7.10 SPIOSDWINBASE...........................................................................................................................................26
8 TOOLS..................................................................................................................................27
9 Prepare Images.................................................................................................................... 28
9.1 8BIT 256 COLORS BMP IMAGE........................................................................................................................28
9.2 7BIT, 128 COLORS IMAGE................................................................................................................................29
9.3 RLC (RUN LENGTH COMPRESS)......................................................................................................................29
9.4 .LUT & .LUTS ................................................................................................................................................29
9.5 BUILD MRLE FILE...........................................................................................................................................30
9.6 DOWNLOAD IMAGE TO SPI FLASH...................................................................................................................30
10 SPI OSD Buffer .................................................................................................................. 32
10.1 VBLANK ISSUE ..............................................................................................................................................32
10.2 SPI OSD WINDOW REG BUFFER ..................................................................................................................33
10.3 SPI OSD LUT BUFFER ..................................................................................................................................34
10.4 SPI OSD RLC BUFFER ..................................................................................................................................34
TW8836
3
10.5 DATA STRUCTURE ..........................................................................................................................................34
10.6 INIT & CLEAN................................................................................................................................................35
10.7 SET WINDOW REGISTERS ................................................................................................................................35
10.8 UPDATE..........................................................................................................................................................35
10.9 OTHER ...........................................................................................................................................................36
11 Draw Image ........................................................................................................................ 37
11.1 PREPARE INITIAL STATUS................................................................................................................................37
11.2 READ THE ITEM HEADER INFORMATION..........................................................................................................37
11.3 DRAW A SINGLE IMAGE...................................................................................................................................37
11.4 DRAW MULTI-IMAGE .....................................................................................................................................38
11.5 SWANIMATION .............................................................................................................................................38
12 SPI Flash memory map .....................................................................................................40
13 MRLE & INF format............................................................................................................ 41
13.1 HEADER INFO ................................................................................................................................................41
13.2 INF & MRLE ................................................................................................................................................41
13.3 CUT & PASTE .................................................................................................................................................42
Document Revision History...................................................................................................43
TW8836
4
1 Two SPI OSD Layers
TW8836 SPIOSD layer is between the Video Image and the Font
OSD, and it has two layers. The Group B is normally for the
background, and the Group A is for the focused icon. The alpha
blended Group A image can be overlapped on the Group B SPI
OSD image.
On the same group, each window has its priority level. The high priority level window can be overlapped the low priority level
window. But, the alpha blending on the same group has same priority.
Each groups have a separate LUT, alpha, and RLC module.
TW8836
5
2 Decoding Steps
TW8836 SPIOSD image item is consisted with three areas, header, palette, and the image data. Firmware read the header information
first, and then downloads the palette to LUT. If application needs a pixel alpha blending that does not prepared at the palette data,
Firmware can overwrite the pixel alpha attribute on the LUT.
The next thing is; update the TW8836 window registers that include the RLC controller and the enable flag of window. TW8836 HW
will read the image data from SPI Flash and make a SPI OSD image on the LCD panel. TW8836 do not have a frame buffer and do
not need an image data download step.