OV2640帧率的计算

 

从时序图看,1帧的时间Tframe=672*Tline, Tline = 1190Tp, Tp与sensor寄存器(FF=1)0x11有关:

Tp = XVCLK/(CLKRC[5:0] + 1), XVCLK为外部输入的频率.

3.1 SVGA Preview, 30fps, 24Mhz input clock
SCCB_salve_Address = 0x60;
write_SCCB(0xff, 0x01);
write_SCCB(0x11, 0x00);
write_SCCB(0x12, 0x40);
write_SCCB(0x2a, 0x00);
write_SCCB(0x2b, 0x00);
write_SCCB(0x46, 0x00);
write_SCCB(0x47, 0x00);
write_SCCB(0x3d, 0x38);

从上面的设置,可算出帧率
Tframe=(1/24000000)*1190*672, 帧率=1/Tframe=30.012

3.2 SVGA Preview, 15fps, 24 Mhz input clock
SCCB_salve_Address = 0x60;
write_SCCB(0xff, 0x01);
write_SCCB(0x11, 0x01); //XVCLK被二分频了
write_SCCB(0x12, 0x40);
write_SCCB(0x2a, 0x00);
write_SCCB(0x2b, 0x00);
write_SCCB(0x46, 0x00);
write_SCCB(0x47, 0x00);
write_SCCB(0x3d, 0x38);

上面的设置,输入频率被二分频了,工作频率为12MHz, 所以帧率减小了一半

3.3 SVGA Preview, 25fps, 24 Mhz input clock
SCCB_salve_Address = 0x60;
write_SCCB(0xff, 0x01);
write_SCCB(0x11, 0x00);
write_SCCB(0x12, 0x40);
write_SCCB(0x2a, 0x00);
write_SCCB(0x2b, 0x00);
write_SCCB(0x46, 0x87);
write_SCCB(0x47, 0x00);
write_SCCB(0x3d, 0x38);

帧率还跟0x2a,0x2b, 0x46,0x47寄存器设置的关.设置0x2a,0x2b,会延长Tline,
如0x2a=1, 0x2b=0, 则Tline=1191Tp, 0x2a=0, 0x2b=1, Tline = (1190+256)Tp.
设置0x46, 0x47会延长Tframe, 如0x46=0, 0x47=1, Tframe=(672+256)*Tline,
0x46=2, 0x47=0, Tframe=(672+2)*Tline.

上面的设置:
Tframe=(1/24000000)*1190*(672+0x87), 帧率=24.99帧

3.4 SVGA Preview, 14.3fps, 24 Mhz input clock
SCCB_salve_Address = 0x60;
write_SCCB(0xff, 0x01);
write_SCCB(0x11, 0x01);
write_SCCB(0x12, 0x40);
write_SCCB(0x2a, 0x00);
write_SCCB(0x2b, 0x00);
write_SCCB(0x46, 0x22);
write_SCCB(0x47, 0x00);
write_SCCB(0x3d, 0x38);

上面的设置:
Tframe=(1/12000000)*1190*(672+0x22), 帧率=14.28帧

UXGA和CIF帧的计算要根据UXGA的时序来算,计算方法类似.

 

你可能感兴趣的:(OV2640帧率的计算)