
7 HARDWARE ROTATION
C-2-30
EPSON
SID13705 PROGRAMMING NOTES
AND EXAMPLES
Example 7
Enable alternate portrait mode for a 320x240 panel at 2 bpp.
Note: As we have to perform a frame rate calculation for this mode we need to know the following
panel characteristics: 320
× 240 8-bit color to be run at 80 Hz with a 16 MHz input clock.
As in the previous example, before switching to portrait mode, display memory should be cleared.
Images in display memory are not rotated automatically by hardware and the garbled image would
be visible for a short period of time if video memory is not cleared.
1. Calculate and set the Screen 1 Start Word Address register.
OffsetBytes = (Width
× BitsPerPixel / 8) - 1 = (240 × 2 / 8) - 1 = 59 = 003Bh
Set Screen1 Display Start Word Address LSB (REG [0Ch]) to 3Bh and Screen1 Display Start
Word Address MSB (REG[0Dh]) to 00h.
2. Calculate the Line Byte Count.
LineByteCount = Width
× BitsPerPixel / 8 = 240 × 2 / 8 = 60 = 3Ch.
Set the Line Byte Count (REG[1C]) to 3Ch.
3. Enable portrait mode.
This example uses the alternate portrait mode scheme. We will not change the MCLK
Autoswitch or Pixel Clock Select settings.
Write C0h to the Portrait Mode register (REG[1Bh])
4. Recalculate the frame rate dependents.
This example assumes the alternate portrait mode scheme. In this scheme, without touching the
Pixel Clock Select bits the PCLK value will be equal to CLK/2.
These examples don’t use the Pixel Clock Select bits. The ability to divide the PCLK value down
further than the default values was added to the SID13705 block to support hardware portrait
mode on very small panels.
The Pixel Clock value has changed so we must calculate horizontal and vertical non-display times
to reach the desired frame rate. Rather than perform the frame rate calculations here I will refer the
reader to the frame rate calculations in “2.2 Frame Rate Calculation” on page C-2-3 and simply
“arrive” at the following:
Horizontal Non-Display Period = 88h
Vertical Non-Display Period = 03h
Plugging the values into the frame rate calculations yields:
For this example the Horizontal Non-Display register [REG[08h]) needs to be set to 07h and the
Vertical Non-Display register (REG[0Ah]) needs to be set to 03h.
The 16,000,000/2 in the formula above represents the input clock being divided by two when this
alternate portrait mode is selected. With the values given for this example we must ensure the
FrameRate =
(HDP + HNDP)
× (VDP + VNDP)
PCLK
FrameRate =
(320 + 88)
× (240 + 3)
2
16,000,000
= 80.69