diff --git a/software/sys_controller/tvp7002/tvp7002.c b/software/sys_controller/tvp7002/tvp7002.c old mode 100644 new mode 100755 index 107685e..2dc5897 --- a/software/sys_controller/tvp7002/tvp7002.c +++ b/software/sys_controller/tvp7002/tvp7002.c @@ -97,14 +97,7 @@ static void tvp_set_alc(video_type type) //tvp_writereg(TVP_ALCEN, 0x00); //tvp_writereg(TVP_ALCEN, 0x80); - //set analog (coarse) gain to max recommended value (-> 91% of the ADC range with 0.7Vpp input) - tvp_writereg(TVP_BG_CGAIN, 0x88); - tvp_writereg(TVP_R_CGAIN, 0x08); - //set rest of the gain digitally (fine) to utilize 100% of the range at the output (0.91*(1+(26/256)) = 1) - tvp_writereg(TVP_R_FGAIN, 26); - tvp_writereg(TVP_G_FGAIN, 26); - tvp_writereg(TVP_B_FGAIN, 26); //select ALC placement switch (type) { @@ -320,6 +313,15 @@ void tvp_source_setup(alt_8 modeid, video_type type, alt_u32 vlines, alt_u8 hz, tvp_set_clamp_position(type); tvp_set_alc(type); + //set analog (coarse) gain to max recommended value (-> 91% of the ADC range with 0.7Vpp input) + tvp_writereg(TVP_BG_CGAIN, 0x88); + tvp_writereg(TVP_R_CGAIN, 0x08); + + //set rest of the gain digitally (fine) to utilize 100% of the range at the output (0.91*(1+(26/256)) = 1) + tvp_writereg(TVP_R_FGAIN, 26); + tvp_writereg(TVP_G_FGAIN, 26); + tvp_writereg(TVP_B_FGAIN, 26); + // Macrovision enable/disable, coast disable for RGBHV. // Coast needs to be enabled when HSYNC is missing during VSYNC. Valid only for RGBHV? // Macrovision should be enabled when serration pulses etc. present, so disable only for RGBHV.