Epson Research and Development Page 31
Vancouver Design Center
Programming Notes and Examples S1D13505
Issue Date: 01/02/05 X23A-G-003-07

5.1.2 Examples

Example 1:Determine the offset value required for 800 pixels at a color depth of 8
bpp.
At 8 bpp each byte contains one pixel, therefore each word contains two pixels.
pixels_per_word = 16 / bpp = 16 / 8 = 2
Using the above formula.
offset = pixels_per_line / pixels_per_word = 800 / 2 = 400 = 190h words
Register [17h] would be set to 01h and register [16h] would be set to 90h.
Example 2:Program the Memory Address Offset Registers to support a 16 color (4
bpp) 640x480 virtual display on a 320x240 LCD panel.
To create a virtual display the offset registers must be programmed t o the horiz ontal size of
the larger “virtual” image. After determining the amount of memory use d b y each line, do
a calculation to see if there is enough memory to support the desired number of lines.
1. Initialize the S1D13505 registers for a 320x240 panel. (See Introduction on page 11).
2. Determine the offset register value.
pixels_per_word = 16 / bpp = 16 / 4 = 4
offset = pixels_per_line / pixels_per_word = 640 / 4 = 160 words = 0A0h words
Register [17h] will be written with 00h and register [16h] will be written with A0h.
3. Check that we have enough memory for the required virtual height.
Each line uses 160 words and we need 480 lines for a total of (160*480) 76,800
words. This display could be done on a system with the minimum supported memory
size of 512 K bytes. It is safe to continue with these values.
5.2 Panning and Scrolling
The terms panning and scrolling refer to the actions used to move the viewport about a
virtual display. Although the image is stored entirely in the display buffer, onl y a portion is
actually visible at any given time.
Panning describes the horizontal (side to side) motion of the viewport. When pannin g to the
right the image in the viewport appears to slide to the left. When panning to the left the
image to appears to slide to the right. Scrolling describes the vertical (up and down) motion
of the viewport. Scrolling down causes the image to appear to slide up and scrolling up
causes the image to appear to slide down.