Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help! Tuner Programming

kimmerosekimmerose Posts: 2Member
hi,

i need some help on my codes. the situation is as follows:

Initially, the frequency for each channels are the same at 87.5MHz (also it is the lowest FM range). Now the task is to have different freq for each channels.

I modified the original codes to look like below. But obviously it doesnt work, because I am missing the lower freq (freqs below the defined FM_LOW).

Please help me shed some light on other methods!



[code]#define FM_MAX_1 (FM_LMT - FM_LOW_1)*2 // for ch 1
#define FM_MAX_2 (FM_LMT - FM_LOW_2)*2 // for ch 2


#define FM_LMT 1080 // for all ch available


#define FM_LOW_2 879 // for ch 1
#define FM_LOW_3 981 // for ch 2


static uint max (void);
static uint min (void);


static uint max (void)
{
switch (ra_getRaBand())
{
case FM1:
switch (ra_getPCH())
{
case 0:
break;
case 1:
return FM_MAX_1;
case 2:
return FM_MAX_2;
default:
return FM_MAX_1;
}
case FM2:
return FM_MAX_1;
case FM3:
return FM_MAX_1;
default:
return FM_MAX_1;
}
}


static uint min (void)
{
switch (ra_getRaBand())
{
case FM1:
switch (ra_getPCH())
{
case 0:
break;
case 1:
return FM_LOW_1;
case 2:
return FM_LOW_2;
default:
return FM_LOW_1;
}
case FM2:
return FM_LOW_1;
case FM3:
return FM_LOW_1;
default:
return FM_LOW_1;
}
}


/*the FM range must start from 87.5MHz and ends at 108.0MHz, therefore the FM_LMT is the highest fm range and FM_LOW is the lowest fm range.
Initially, the program has #define FM_LOW 875, and will display on LCD as 87.5MHz. Now the task is to change it to have different frequencies on each channels
once the tuner is turned on. By using the method above, I am missing the low frequency (87.5MHz until what is set to be the lowest FM range, in this case,
until 87.9MHz and 98.1MHz*/[/code]
Sign In or Register to comment.