|
频率从17MHz开始,调到17.47MHz,就不能往上调了.
频率从16MHz开始,调到16.50MHz,按键调频就调不上去了.
频率从22MHZ开始,也是到22.40MHz左右,就不能上去了.
程序如下:
void Send_PLL_WORD(unsigned long cmd)
{
unsigned char i,j;
PLL_EN=0;
PLL_CLK=0;
for(i=0;i<19;i++)
{
PLL_CLK = 0;
PLL_DATA=(bit)((cmd&0x40000)>>18);
cmd=cmd<<1;
for(j=0;j<4;j++)
{;}
PLL_CLK = 1;
for(j=0;j<4;j++)
{;}
}
PLL_EN=1;
PLL_CLK=0;
for(j=0;j<2;j++)
{;}
PLL_EN = 0;
}
//主程序
command=8728;
Send_PLL_WORD(command);
LCD_Show_Frequence(Fre_num,step);
while(1)
{
if ( ZLG7289_pinINT == 0 ) //有键按下
{
Key = ZLG7289_Key();
if(Key==0x00)//频率增加
{
command=command+step;
if(command>=9600) command=9600;
Send_PLL_WORD(command);
Fre_num=Fre_num+step*100;
if(Fre_num>=240000) Fre_num=240000;
LCD_Show_Frequence(Fre_num,step);
Key=0xFF;
}
if(Key==0x03)//频率减小
{
command=command-step;
if(command<=7948) command=7948;
Send_PLL_WORD(command);
Fre_num=Fre_num-step*100;
if(Fre_num<=200000) Fre_num=200000;
LCD_Show_Frequence(Fre_num,step);
Key=0xFF;
}
if(Key==0x02)//设置步进值
{
count++;
if(count>=4) count=0;
switch(count)
{
case 0:
step=1;
break;
case 1:
step=5;
break;
case 2:
step=10;
break;
case 3:
step=50;
break;
default:
step=1;
break;
}
LCD_Show_Frequence(Fre_num,step);
Key=0xFF;
}
while ( !ZLG7289_pinINT );
}[em07] |
|