From 2b644e89e5fdb29b4e11b5fb0cd397341c72bce7 Mon Sep 17 00:00:00 2001 From: borti4938 Date: Sun, 10 Apr 2016 20:39:46 +0200 Subject: [PATCH] move setting RGB gain out of tvp_set_alc(): miss leading name, gains set are not part of the Automatic Level Control (ALC) --- software/sys_controller/tvp7002/tvp7002.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) mode change 100644 => 100755 software/sys_controller/tvp7002/tvp7002.c 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.