beautypg.com

An269 – Cirrus Logic AN269 User Manual

Page 57

background image

AN269

AN269REV1

57

Once the VIDCLKDIV register has been setup, the actual VIDCLK rate can be used for setting up the horizontal
LOAD/HSYNC pulse timing. To do this, we first determine the time spent on a single line. This is done by first de-
termining the line period and then the number:

LinePeriod = 1 / [(refresh rate) * (vertical resolution)] = 1 / (73 Hz * 240) = 57077 ns

NumVideoClocks = LinePeriod/VidClkPeriod = 57077 ns / 172 ns = 331

ActiveVidClks = (VIDCLKs/Pixel) * (horizontal resolution) = 1 VIDCLK/Pixel * 320 Pixels = 320 VIDCLKs

LoadHighVidClks = (tHSYNCH / VidClkPeriod) + 1 = (50 ns / 172 ns) + 1 = 1 VIDCLK

FrameHoldVidClks = (tHVCSYNC / VidClkPeriod) + 1 = (30 ns / 172 ns) + 1 = 1 VIDCLK

LoadCPVidClks = [(tHSYNCSPCLK - tHVCSYNC) / VidClkPeriod] + 1 = [(70 ns - 30 ns) / 172 ns] + 1 = 1 VIDCLK

CPLoadVidClks = (tSPCLKHSYNC / VidClkPeriod) + 1= (0 ns / 172 ns) + 1 = 1 VIDCLK

AvailableVidClks = NumVideoClocks - ActiveVidClks - LoadHighVidClks - FrameHoldVidClks -

LoadCPVidClks - CPLoadVidClks

AvailableVidClks = 331 - 320 - 1 - 1 - 1 - 1 = 7 VIDCLKs

Distribute:

LoadHighVidClks = 3

FrameHoldVidClks = 3

LoadCPVidClks = 3

CPLoadVidClks = 2

HClksTotal = NumVideoClocks - 1 = 331 - 1 = 330

HSyncStart = LoadHighVidClks + FrameHoldVidClks - 1 = 3 + 3 - 1= 5

HSyncStop = FrameHoldVidClks - 1 = 3 - 1 = 2

HActiveStart = HClksTotal - LoadCPVidClks - 1= 330 - 3= 327

HActiveStop = HClksTotal - LoadCPVidClks - ActiveVidClks - 1= 330 - 3 - 320 = 7

HClksStart = HClksTotal - LoadCPVidClks - 6 = 330 - 3 - 6 = 321

HClkStop = HClksTotal - LoadCPVidClks - ActiveVidClks - 6 = 330 - 3 - 320 - 6 = 1

Note that the blank output is not used, so 0 can be assigned to the horizontal blank timing registers:
HBlankStart = 0

HBlankStop = 0

VLinesTotal = (vertical resolution) - 1 = 240 - 1 = 239

VSyncStart = VLinesTotal = 239

VSyncStop = VLinesTotal - 1 = 239 - 1 = 238

VActiveStart = VLinesTotal = 239

VActiveStop = VLinesTotal + 1 = 239 + 1 = 240

VClkStart = VLinesTotal = 239

VClkStop = VLinesTotal + 1 = 239 + 1 = 240

VBlankStart = 0

VBlankStop = 0