User`s manual

4: ADVANCED TECHNIQUES
2-14 EPSON S1D13504 PROGRAMMING NOTES
AND EXAMPLES (S19A-G-002-06)
4.1.2 Examples
Example 2
Determine the offset value required for 800 pixels at a color depth of 8 bpp.
A color depth of 8 bpp means each pixel requires one byte therefore each word contains two pixels.
offset = pixels_per_line / pixels_per_word = 800 / 2 = 400 = 0x190 words
Register [17h] would be set to 0x01 and register [16h] would be set to 0x90.
Example 3
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 to the horizontal size of the
larger “virtual” image. After determining the amount of memory used by each line, do a calculation
to see if there is enough memory to support the desired number of lines.
1. Initialize the S1D13504 registers for a 320x240 panel. (See Section 2.2, “Register Initialization”
on page 3.)
2. Determine the number of words required per line (the offset). In this case we want a width of 640
pixels and there are four pixels to every word.
offset = pixels_per_line / pixels_per_word = 640 / 4 = 160 words = 0xA0 words
3. Check that we have enough memory for the required virtual height.
Each line uses 160 words and we need 480 lines (160*480) for a total of 76,800 words, less than
the minimum supported memory size of 512K bytes. It is safe to continue with these values.
4. Program the Memory Address Offset Registers. Register [17h] will be set to 0 and register [16h]
will be set to 0xA0.