Document
Application Note
AN2356
Graphics Library for OSRAM’s OLED Displays
Author: Valeriy Kyrynyuk Associated Project: Yes Associated Part Family: All PSoC Designer Version: 4.2 Associated Application Notes: AN2348
www.DataSheet4U.com
Abstract
This Application Note describes a graphics library for OLED display operation. Library functions include drawing, text, and bitmap operations.
Introduction
Modern designs often require a low-cost and high quality graphical display. OLED (organic light emitting diode) displays by OSRAM Opto Semiconductors (http://www.pictiva.com) meet these requirements and are the preferred displays for users and designers. This Application Note describes a library of functions to interface with a display that has a resolution of 96 x 48 pixels.
OLED Review
OSRAM OLED displays have the following characteristics:
o o o o o o o o
Consider the display process in detail. An OLED display is a memory-mapped device. Four bits are necessary to display one pixel, because an OLED display has 16 brightness levels of one basic color; a single byte can hold information for two pixels. The columns and rows of the display can serve as the X and Y axes, respectively. One byte in video memory represents two pixels in the X direction. Therefore, to simplify algorithms for the display of images, the X coordinates of function arguments are assigned as one half of the real pixel position in its row. The pixel representation in a video memory byte is shown in Figure 1.
They are monochrome and have 16 brightness levels. The interface supply voltage is 2.4-3.5V. The OLED supply voltage is 12-13V. The operating temperature range is between -30°C and 70°C. They have low power consumption at 220 mW maximum (OLED supply). No additional lighting elements are required. Lifetime at standard brightness is between 10 000 - 40 000 hours. Parallel or serial (SPI) are the standard interface options.
X
X +1
4..7 bits
0..3 bits
Figure 1. Video Memory Byte Format
Interfacing with PSoC®
The demonstration board is implemented using a CY8C29666 PSoC device. The interconnection circuit is shown in Figure 2. The connection is done by parallel interface. For a detailed description of this interface, refer to reference [1] from Solomon Systech Company at the end of this document. The maximum logic supply voltage of the display is 3.5V.
3/16/2006
Revision A
-1-
AN2356
U1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 P0[7] P0[5] P0[3] P0[1] P2[7] P2[5] P2[3] P2[1] P4[7] P4[5] P4[3] P4[1] SMP P3[7] P3[5] P3[3] P3[1] P5[3] P5[1] P1[7] P1[5] P1[3] P1[1] Vss CY 8C29666 Vcc P0[6] P0[4] P0[2] P0[0] P2[6] P2[4] P2[2] P2[0] P4[6] P4[4] P4[2] P4[0] Xres P3[6] P3[4] P3[2] P3[0] P5[2] P5[0] P1[6] P1[4] P1[2] P1[0] 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25
3.3V
C1 0.1uF
PWM_FB
www.DataSheet4U.com
XRes E R/W D/C# RST# CS# D6 D4 D2 D0
PWM D7 D5 D3 D1
CS# RST# D/C# R/W E
J2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 CS# RES# BS1 D/C# R/W E D0 D1 D2 D3 D4 D5 D6 D7 NC Vdd OLED GND
D0 D1 D2 D3 D4 D5 D6 D7
J1 1 2 3 4 5 ISSP
3.3V XRes
OLED
3.3V
L2 10uH
D7 BAV99 Q5 IRLM2502 C58 100uF D6 C55 0,1uF SM6T15A
12V R29 15k PWM_FB R30 3.3k
PWM R51 100k
Figure 2. PSoC-OLED Interconnection Circuit, Vcc = 3.3V
When working with dynamic graphics, the device does not have enough of its own memory to buffer the contents of video memory. This requires about 3 Kbytes (96x64/2) of RAM. The data must be read from the video memory of the display. Therefore, the D0..D7 lines should be bidirectional.
The user can choose other pins for OLED support. In this case, within the Device Editor of PSoC Designer™, the PSoC-OLED signal should be configured to other pins. After that, in the oled.inc file the port numbers and bit template for the interface signals must be assigned. It is important that wires D0..D7 be located on the same port without changing the order in which the pins are numbered.
3/16/2006
Revision A
-2-
AN2356
OLED Driver Library Description
The library functions can be symbolically grouped into two levels: low and high. The low-level APIs implement simple functions for display operation, which include transmitting commands, writing and reading data, and transmitting data arrays from the PSoC memory to display memory. Table 1 lists these functions. For image drawing, a special structure of image data was implemented. The argument Buf of the oledWriteROMSprite function points to the following structure:
www.DataSheet4U.com
struct Sprite{ WORD BYTE BYTE BYTE WORD BYTE BYTE BYTE WORD BYTE } Xpos=0x03; Xcmd=0x15; Xstart; Xend; Ypos=0x03; Ycmd=0x75; Ystart; Yend; DataCount; abDATA [DataCount&0x7FFF];
As we can see, the structure consists of 12header bytes and the data array.
o Xstart and Xend start and end column position of the image. The position is divided by 2. Ystart and Yend start and end row position of the image. DataCount is the image size, 1..7FFFh bytes. The 0x8000 bit ma.