
Page 42
Epson Research and Development
Vancouver Design Center
SED1352
Programming Notes and Examples
X16-BG-007-04
Issue Date: 98/10/08
5.5 Panning and Scrolling
Panning and scrolling are typically used to show an image which is too large to be shown completely on an LCD panel.
Although the image is stored entirely in display memory, only a small portion is actually visible on the LCD panel. This
visible portion is called the viewport; the user moves this viewport over different portions of the image by panning and
scrolling. Panning moves the viewport right or left. Scrolling moves the viewport up or down.
5.5.1 Initialization
To pan and scroll over a large image, the SED1352 registers must first be initialized and the image written to display
memory. To do so, initialize the registers as described in Section 2, “INITIALIZING THE SED1352” on page 8, but with
the following exception: the Address Pitch Adjustment Register in the SED1352 must be set to create a virtual display; see
Section 5.1, “Virtual Displays” on page 28 for more information.
5.5.2 Panning Right and Left
To pan to the right, increase the value in the Screen 1 Display Start Address Register. To pan to the left, decrease the value
in the Screen 1 Display Start Address Register.
Note that the SED1352 can pan right or left by either 2, 4, or 8 pixels. This is because the Screen 1 Display Start Address
Register refers to either bytes or words (see Section 4.2.1, “SDU1352B0x Evaluation Board Display Memory” on page
24), and a byte can represent either 2 or 4 pixels, and so a word can represent 4 or 8 pixels; see Table 5-1 below:
Table 5-1: Smallest Number of Pixels for Panning
5.5.3 Scrolling Up and Down
To scroll up, increase the value in the Screen 1 Display Start Address Register by the number of bytes in one virtual scan
line. To scroll down, decrease the value in the Screen 1 Display Start Address Register by the number of bytes in one virtual
scan line.
A virtual scan line is in reference to a virtual display, in which an image larger than the physical size of the LCD is stored.
The number of bytes in a virtual scan line is the number of bytes required to store one horizontal line of pixels in the virtual
image.
Example 14: Scroll down one line for a 16 gray shade 640x200 virtual image using a 320x240 single
panel LCD. The Memory Interface is 16 bits, and 64k of display memory is available. Also
describe how to scroll in a dual panel LCD.
1.
Calculate the number of bytes in a virtual scan line.
Memory
Interface
Gray Levels
Pixels per Byte
Smallest Number of Pixels
for Panning
8 bits
4
4
4
16
2
2
16 bits
4
4
8
16
2
4
number of horizontal pixels in virtual image
number of pixels per word
----------------------------------------------------------------------------------------------------------
640 pixels per scan line
2 pixels per byte
--------------------------------------------------------
320 bytes per scan line
=
=