Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Sanyo LV24020LP Coefficient "A" Constant Calculation

Re: Sanyo LV24020LP Coefficient "A" Constant Calculation

From: Michael Sevakis <jethead71_at_sbcglobal.net>
Date: Sun, 11 Nov 2007 02:58:32 -0500

There's nothing fancy to do. Just tell it the frequency you want to tune to
and it will tune it within the driver.

The endpoints of the curve are initialized by selecting each value of FM_OSC
and FM_CAP at each extreme (four combinations) to find coefficients at four
points. Therefter, any regsiter values are based upon an initial
interpolation between the points and successive approximation until the
measured frequency is within measurement tolerance. Usually it takes 1-4
cycles to achieve tuning.

C=1/(L*4*pi^2) * 1/f^2 <= cap value for L-C oscillator

A=1/(L*4*pi^2) and is constant for any chip (tuning is done by changing C,
not L).

Which becomes:
C=A/f^2
(f=+sqrt(A/C))

The function based on kHz is (and scaled for my convenience to saturate at a
specific minimum f):

static int calculate_coef(unsigned fkhz)
{
    /* Overflow below 66000kHz --
       My tuner tunes down to a min of ~72600kHz but datasheet mentions
       66000kHz as the minimum. ?? Perhaps 76000kHz was intended? */
    return fkhz < 66000 ?
        0x7fffffff : 0x81d1a47efc5cb700ull / ((uint64_t)fkhz*fkhz);
}

The extremes are used as curve endpoints here with no concern for the actual
values and the coefficients for the points calculated based upon the
measurements at tuner init. Thereafter, a coefficient is calculated for the
desired frequency and that coeficient interpolated linearly between the
measured endpoint coefficients to return the cap value to get that f.

How much these chips actually vary in their available frequency range I
don't know...I'm not even sure it's specified other than to say I saw
66000-116000KHz there as the range needed without overflow. Nonetheless
tuning to higher f won't overflow.

----- Original Message -----
From: "Brandon Irwin" <brandon.irwin_at_gmail.com>
To: <rockbox_at_cool.haxx.se>
Sent: Saturday, November 10, 2007 8:21 PM
Subject: Sanyo LV24020LP Coefficient "A" Constant Calculation


> Hello,
>
> In the LV24020Lp application note
> http://www.rockbox.org/twiki/pub/Main/DataSheets/AN2400S04.pdf
> tuning to a frequency relies on knowing a constant, A, that depends on
> the inductor value for the tuner.
> How was this value found/calculated for the lv24020lp.c driver?
>
> -Brandon Irwin
Received on 2007-11-11

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy