Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: DVB-S 1.6: Grundig 29504-491 with TSA 5522 tuner chip.



On Sun, Jun 20, 2004 at 11:11:11PM +0200, Johannes Stezenbach wrote:
> Dr. Werner Fink wrote:
> > 
> >       some questions for the real experts.
> 
> Not me then, when it comes to frontends. Anyway...
> 
> > Accordingly to
> > 
> > http://www-us2.semiconductors.philips.com/acrobat/datasheets/TSA5522_2.pdf
> > 
> > the function tsa5522_set_tv_freq() in frontends/grundig_29504-491.c,
> > does not use the Charge-Pump bit CP in the third byte:
> > 
> >         u8 buf [4] = { (div >> 8) & 0x7f, div & 0xff, 0x8e, 0x00 };
> >                                                       ^^^^
> > 
> > with the CP bit high the value would be 0xce.  Is this intentional,
> > that means this make no sence on the DVB-S 1.6 tuner layout?
> > Or, which would be more a problem, would it be dangerous for the
> > DVB-S 1.6 hardware to set this bit high?
> 
> AFAIK the charge pump setting has nothing to do with the tuner
> layout. A high setting means that the voltage at the varactor
> can change faster, but due to overshoot it may actually take
> longer to reach a stable frequency. OTOH I think it is usually a good
> idea to set the CP setting low *after* tuning for better stablity.

Just have a look onto the attached patch. It remove the twice
reset of the TSA 5522 and used the CP flag during tuning but
removes it after 30ms. This increase speed for channel changes.

> If the data sheet does not document the best CP setting one can
> only experiment. You cannot damage your hardware by doing so.
> 
> > Also the last byte may have some values for the last three bits
> > enabled because table 6 of the pdf at page 7 does not know all
> > bits low.
> > 
> > Maybe a value 0x04 for 0.4Vcc1 (band B????) or something else
> > has to be set.
> 
> I've no idea how the tsa5522 pins are connected in the
> Grunding frontend. It is well possible that they are unused.

I'd prefer a defined setting even if the pins arn't connected
simply to be sure that no other strange exception may happen.


            Werner

-- 
AC3 loop through sound card http://bitstreamout.sourceforge.net/
Howto http://www.vdr-portal.de/board/thread.php?threadid=1958
------------------------------------------------------------------
 "Having a smoking section in a restaurant is like having
         a  peeing section in a swimming pool." -- Edward Burr
--- driver/frontends/grundig_29504-491.c
+++ driver/frontends/grundig_29504-491.c	Mon Jun 21 13:44:13 2004
@@ -33,6 +33,11 @@
 static int debug = 0;
 #define dprintk	if (debug) printk
 
+static inline void ddelay(int i) 
+{
+        set_current_state(TASK_INTERRUPTIBLE);
+        schedule_timeout((HZ*i)/100);
+}
 
 static
 struct dvb_frontend_info grundig_29504_491_info = {
@@ -133,10 +138,13 @@
  *   reference clock comparision frequency of 125 kHz.
  */
 static
-int tsa5522_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
+int tsa5522_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq, int cphigh)
 {
 	u32 div = freq / 125;
-	u8 buf [4] = { (div >> 8) & 0x7f, div & 0xff, 0x8e, 0x00 };
+	u8 buf [4] = { (div >> 8) & 0x7f, div & 0xff, 0x8e, 0x04 };
+
+	if (cphigh)
+		buf[2] |= 0x40;		// Charge pump high
 
 	return tsa5522_write (i2c, buf);
 }
@@ -227,9 +235,6 @@
 	tda8083_writereg (i2c, 0x03, (ratio >>  8) & 0xff);
 	tda8083_writereg (i2c, 0x04, (ratio      ) & 0xff);
 	
-	tda8083_writereg (i2c, 0x00, 0x3c);
-	tda8083_writereg (i2c, 0x00, 0x04);
-
 	return 1;
 }
 
@@ -380,7 +385,7 @@
         {
 		struct dvb_frontend_parameters *p = arg;
 
-		tsa5522_set_tv_freq (i2c, p->frequency);
+		tsa5522_set_tv_freq (i2c, p->frequency, 1);
 		tda8083_set_inversion (i2c, p->inversion);
 		tda8083_set_fec (i2c, p->u.qpsk.fec_inner);
 		tda8083_set_symbolrate (i2c, p->u.qpsk.symbol_rate);
@@ -388,6 +393,9 @@
 		tda8083_writereg (i2c, 0x00, 0x3c);
 		tda8083_writereg (i2c, 0x00, 0x04);
 
+		ddelay(30);
+
+		tsa5522_set_tv_freq (i2c, p->frequency, 0);
 		break;
         }
 

Home | Main Index | Thread Index