How are you calculating SPCOUNT, exactly?

I don't quite understand how HCOUNT and VCOUNT are determined.

Based on the default register values (Initial Hex from the Datasheet), I obtained the following:

Datasheet wrote:
H_COUNT = 0x2B3 = 691

V_COUNT = 0x21B = 539

SP_COUNT = 0x400 = 1024

However, the Application Note quotes different numbers:

Application Note wrote:
HCOUNT = H_COUNT (default:713) + 677 = 1390

VCOUNT = V_COUNT (default:539) + 513 = 1052

SPCOUNT = 2 x (H_COUNT + 183)

SPCOUNT = ... (slightly different formula for different sizes)

The application note doesn't say it, but plugging in their H_COUNT into their formula gives 2x(713+183)=1792. This is very different than the number programmed into SP_COUNT=1024. What's going on here?

Needless to say, the only Application Note number that matches the initial register value is V_COUNT.

Here are my calculations, based on what I can piece together...

There are 960H+92H(blank)=1052H in one VBLK.

This is equal to VCOUNT, so V_COUNT=539 (the default value)

**Edited:**
It seems that the HCOUNT calculation is based on counting the clocks in a single row of image data at

**1/2** the DSP clock frequency.

So for the Full Mega size, note that the data output is output at 1 x DSP frequency. This means you divide the number of clocks by two when calculating HCOUNT.

Smaller images are output at 1/4 the DSP clock rate, so you need to *multiply* the number of clocks by 2.

The result is that for every picture size, HCOUNT comes out to be approximately the default value of 713 (after you subtract the offset of 677). (I actually calculate 715.)

Also, is there a difference between:

SPCOUNT and SP_COUNT?

HCOUNT and H_COUNT?

VCOUNT and V_COUNT?

My understanding is that "No Underscore" means the actual value that corresponds to some physical phenomena (like the number of clock periods in a certain region of the image). This is in contrast to "With Underscore," which is the way the value is stored in the register after subtracting some arbitrary offset.

Is this remotely correct?

Thanks,

David