Philips S1D13505 Computer Monitor User Manual


 
Page 34
Epson Research and Development
Vancouver Design Center
S1D13505 Programming Notes and Examples
X23A-G-003-07 Issue Date: 01/02/05
The following pans to the right by one pixel in 4 bpp display mode.
1. This is a pan to the right. Increment pan_value.
pan_value = pan_value + 1
2. Mask off the values from pan_value for the pixel panning and start address register
portions. In this case, 4 bpp, the lower two bits are the pixel panning value and the up-
per bits are the start address.
pixel_pan = pan_value AND 3
start_address = pan_value SHR 3
(the fist two bits of the shift account for the pixel_pan the last bit of the shift converts
the start_address value from bytes to words)
3. Write the pixel panning and start address values to their respective registers using the
procedure outlined in the registers section.
Example 4:Scrolling - Up and Down
To scroll down, increase the value in the Screen 1 Display Start Address Register by the
number of words in one
virtual
scan line. To scroll up, decrease the value in the Screen 1
Display Start Address Register by the number of words in one
virtual
scan line.
Example 5:Scroll down one line for a 16 color 640x480 virtual image using a
320x240 single panel LCD.
1. To scroll down we need to know how many words each line takes up. At 16 colors (4
bpp) each byte contains two pixels so each word contains 4 pixels.
offset_words = pixels_per_line / pixels_per_word = 640 / 4 = 160 = A0h
We now know how much to add to the start address to scroll down one line.
2. Increment the start address by the number of words per virtual line.
start_address = start_address + words
3. Separate the start address value into three bytes. Write the LSB to register [10h] and
the MSB to register [12h].