本文包含原理图、PCB、源代码、封装库、中英文PDF等资源
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 hpdell 于 2010-6-4 14:46 编辑
//自动搜台方法一如下:
T_ERROR_OP FM_Auto_Seek_Up() //这个自动搜台,当搜到有效电台后,不会停下来,但是当频率达到10800时,会自动退出来
{
unsigned char xdata read_buf[8]=0;
// unsigned short xdata current_freq=0;
uchar k=0;
Channel_Freq_FM = 8750;
lcd_XY(3,0); //自动搜台显示
lcdWriteString("FM_Freq:");
Disp_Radio_Freq(Channel_Freq_FM);
lcdWriteString("MHz");
do
{
Channel_Freq_FM += 10;
Si47xx_Tune(0x20,Channel_Freq_FM);
lcd_XY(3,0);
lcdWriteString("FM_Freq:");
Disp_Radio_Freq(Channel_Freq_FM);
lcdWriteString("MHz");
Si47xx_Tune_Status(0X22,0,0,&read_buf[0]);
//stc=1;intstc=1;rssi>=0x02(uV)范围是1~127uV ; snr>=1(dB)范围是0~127dB
if((read_buf[4]>=0x02)&&(read_buf[5]>=0x1))
{
RX_VOLUME(63); //audio on max
for(k=12;k;k--) //delay 3s
Delay_ms(250);
}
else RX_HARD_MUTE(0); //audio off//
}
while(Channel_Freq_FM < 10800);
menu = 4;
tt = 0;
Operation_Menu();
return OK;
}
//自动搜台方法二如下:
T_ERROR_OP FM_Auto_Seek_UP() //这个自动搜台,当搜到有效的电台后会停下来,但是当频率到达10800时,不会自动退出
{
unsigned char xdata read_buf[8]=0;
unsigned short xdata current_freq=0;
uchar k=0;
Channel_Freq_FM = 8750;
lcd_XY(3,0); //自动搜台显示
lcdWriteString("FM_Freq:");
Disp_Radio_Freq(Channel_Freq_FM);
lcdWriteString("MHz");
while(1)
{
Si47xx_Seek_Start(0X21,SEEKDOWN_WRAP);
Si47xx_Tune_Status(0X22,0,0,&read_buf[0]);
current_freq = ((read_buf[2]<<8) | read_buf[3]);
if(current_freq>=10800) goto end; //判断退出条件
else
{
lcd_XY(3,0);
lcdWriteString("FM_Freq:");
Disp_Radio_Freq(current_freq);
lcdWriteString("MHz");
//stc=1,intstc=1,rssi>=0x3C(uV)范围是1~127uV,snr>=1(dB)范围是0~127dB
if((read_buf[4]>=0x02)&&(read_buf[5]>=0x1))
{
RX_VOLUME(63); //audio on max
for(k=12;k;k--) //delay 3s
Delay_ms(250);
}
else RX_HARD_MUTE(0); //audio off//
}
}
end:
menu = 4;
tt = 0;
Operation_Menu();
return OK;
}
请问以上的该怎么解决啊!!!!!!!!!!!???????????我的QQ:519212866 |