
2 INITIALIZATION
C-2-4
EPSON
SID13705 PROGRAMMING NOTES
AND EXAMPLES
The following are the formulae for determining the frame rate of a panel. The formula for a single
passive or TFT panel is calculated as follows:
for a dual passive panel the formula is:
where : PCLK
= Pixel clock (in Hz)
HDP
= Horizontal Display Period (in pixels)
HNDP
= Horizontal Non-Display Period (in pixels)
VDP
= Vertical Display Period (in lines)
VNDP
= Vertical Non-Display Period (in lines)
In addition to varying the HNDP and VNDP times we can also select divider values which will
reduce CLKi to one half, one quarter up to one eight of the CLKi value. The example below is a
portion of a ’C’ routine to calculate HNDP and VNDP from a desired frame rate.
for (int loop = 0; loop < 2; loop++)
{
for (VNDP = 2; VNDP < 0x3F; VNDP += 3)
{
// Solve for HNDP
HNDP = (PCLK / (FrameRate * (VDP + VNDP))) - HDP;
if ((HNDP >= 32) && (HNDP <= 280))
{
// Solve for VNDP.
VNDP = (PCLK / (FrameRate * (HDP + HNDP))) - VDP;
// If we have satisfied VNDP then we're done.
if ((VNDP >= 0) && (VNDP <= 0x3F))
goto DoneCalc;
}
// Divide ClkI and try again.
// (Reg[02] allows us to dived CLKI by 2)
PCLK /= 2;
}
// If we still can't hit the frame rate - throw an error.
if ((VNDP < 0) || (VNDP > 0x3F) || (HNDP < 32) || (HNDP > 280))
{
sprintf("ERROR: Unable to set the desired frame rate.\n");
exit(1);
}
This routine first performs a formula rearrangement so that HNDP or VNDP can be solved. Start
with VNDP set to a small value. Loop increasing VNDP and solving the equation for HNDP until
satisfactory HNDP and VNDP values are found. If no satisfactory values are found then divide
CLKI and repeat the process. If a satisfactory frame rate still can’t be reached - return an error.
Note: Most passive (STN) panels are tolerant of nearly any combination of HNDP and VNDP val-
ues, however panel specifications generally specify only a few lines of vertical non-display
period. The SID13705 block is capable of generating a vertical non-display period of up to
sixty-three lines. This amount of VNDP is far too great a non-display period and will likely de-
grade display quality. Similarly, setting a large HNDP value may cause a degrade in image
quality.
If possible the system should be designed such that VNDP values of 7 or less lines and
HNDP values of 20 or less characters can be selected.
FrameRate
PCLK
HDP
HNDP
+
()
VDP
VNDP
+
()
×
-----------------------------------------------------------------------------------------
=
FrameRate
PCLK
2
HDP
HNDP
+
()
VDP
2
------------
VNDP
+
×
---------------------------------------------------------------------------------------------------
=