LIV2 wrote:
I thought the Hsync needed to be after front porch, and before back porch?
* In my last post I said "move all the porch cycles to the back porch", while I meant to say "front porch".
But let's forget about porches, read on....
Porch is effectively just black video in most cases, or the blanking signal if your feeding a proper video
DAC (with a blanking pin) rather than a resistor DAC. The sync is a different signal during which porch
is still black video.You could think of the two porches as one, just with a sync signal happening in the middle.
I'll explain why I suggested thinking about the signals, before moving to optimization.
A video signal is cyclical, what you do first or last doesn't matter. It only matters that the
order is kept, and the relation to other signals is kept.
Is a blinking LED blinking 'on' then 'off', or is it blinking 'off' then 'on'
A full line (or column for Vertical) consists of:
Sync -> Back Porch -> Active Video -> Front Porch
OR
Back Porch -> Active Video -> Front Porch -> Sync
OR
Active Video -> Front Porch -> Sync -> Back Porch *** Optimization Hint: Design for this one.
OR
Front Porch -> Sync -> Back Porch -> Active Video
The optimization is to start with full sized counters for the horizontal and vertical frame dimensions.
Enable video when in the active area, set black when outside of it (no need to think about porches).
Apply the sync pulse when the appropriate counter is in the correct range.
as a bonus, bit(2) of the h-counter will provide you with a clk/8 signal for use in your SR loading function.
You currently have something like this in mind:
https://i.stack.imgur.com/tGTx3.pngWhile designing for this looks a little easier:
https://i.stack.imgur.com/jURiy.jpgThey'll both output the same signal on the VGA port.