文档收集于互联网,已重新整理排版.word版本可编辑,有帮助欢迎下载支持.
收音机检波电路图
图5.5-13是半导体收音机中检波级及有关附加电路的典型实例。R1、R2、RL2组成外加正向偏置电路。通过-6V电源给二极管VD提供一固定的正向偏流(通常在20~50UA左右),用以提高检波效率。R2C3组成低通滤波器,用来滤除RL2两端输出中的低频交流分量,取出其中的直流分量,加到前级中放管的基极,作为自动增益控制电压。检波器的输出滤波电路,接成X型滤波电路,这样不但可以进一步滤除输出电压中的残余高频分量,而且有利避免产生负峰切割失真。 收音机模块TEA5767的C语言控制程序
TEA5767采用I2C或者三线接口控制,我是用的I2C,单片机用STC89C52,带1K EEPROM,可以掉电存台,1602LCD显示.
TEA5767读写数据都是5个字节,其中PLL参数14位,具体数据格式请看datasheet.以下程序中的函数可以直接在主程序中调用. #include \iic.c\
#define max_freq 108000 #define min_freq 87500
unsigned char radio_write_data[5]={0x29,0xc2,0x20,0x11,0x00}; //要写入TEA5767的数据
unsigned char radio_read_data[5]; //TEA5767读出的状态
unsigned int default_pll=0x29c2;//0x29f9; //默认存台的pll,87.8MHz
//unsigned int max_pll=0x339b; //108MHz时的pll, //unsigned int min_pll=9000; //70MHz时的pll void radio_write(void) {
unsigned char i; iic_start();
iic_write8bit(0xc0); //TEA5767写地址 if(!iic_testack()) {
for(i=0;i<5;i++) {
iic_write8bit(radio_write_data[i]); iic_ack(); } }
iic_stop(); }
//读TEA5767状态,并转换成频率 void radio_read(void) {
unsigned char i;
1文档来源为:从网络收集整理.word版本可编辑.
文档收集于互联网,已重新整理排版.word版本可编辑,有帮助欢迎下载支持.
unsigned char temp_l,temp_h; pll=0;
iic_start();
iic_write8bit(0xc1); //TEA5767读地址 if(!iic_testack()) {
for(i=0;i<5;i++) {
radio_read_data[i]=iic_read8bit(); iic_ack(); } }
iic_stop();
temp_l=radio_read_data[1]; temp_h=radio_read_data[0]; temp_h&=0x3f;
pll=temp_h*256+temp_l; get_frequency(); }
//由频率计算PLL void get_pll(void) {
unsigned char hlsi; unsigned int twpll=0;
hlsi=radio_write_data[2]&0x10; if (hlsi)
pll=(unsigned int)((float)((frequency+225)*4)/(float)32.768); //频率单位:k else
pll=(unsigned int)((float)((frequency-225)*4)/(float)32.768); //频率单位:k }
//由PLL计算频率
void get_frequency(void) {
unsigned char hlsi; unsigned int npll=0; npll=pll;
hlsi=radio_write_data[2]&0x10; if (hlsi)
frequency=(unsigned long)((float)(npll)*(float)8.192-225); //频率单位:KHz else
frequency=(unsigned long)((float)(npll)*(float)8.192+225); //频率
1文档来源为:从网络收集整理.word版本可编辑.
文档收集于互联网,已重新整理排版.word版本可编辑,有帮助欢迎下载支持.
单位:KHz }
//手动设置频率,mode=1,+0.1MHz; mode=0:-0.1MHz ,不用考虑TEA5767用于搜台的相关位:SM,SUD void search(bit mode) {
radio_read(); if(mode) {
frequency+=100;
if(frequency>max_freq) frequency=min_freq; } else {
frequency-=100; if(frequency
frequency=max_freq; }
get_pll();
radio_write_data[0]=pll/256; radio_write_data[1]=pll%6; radio_write_data[2]=0x20; radio_write_data[3]=0x11; radio_write_data[4]=0x00; radio_write(); }
//自动搜台,mode=1,频率增加搜台; mode=0:频率减小搜台,不过这个好像不能循环搜台
void auto_search(bit mode) {
radio_read(); get_pll(); if(mode)
radio_write_data[2]=0xa0; else
radio_write_data[2]=0x20;
radio_write_data[0]=pll/256+0x40; radio_write_data[1]=pll%6; radio_write_data[3]=0x11; radio_write_data[4]=0x00; radio_write(); radio_read();
while(!(radio_read_data[0]&0x80)) //搜台成功标志
1文档来源为:从网络收集整理.word版本可编辑.
文档收集于互联网,已重新整理排版.word版本可编辑,有帮助欢迎下载支持.
{
radio_read(); disp_freq(9,1); } }
128*64液晶汉字显示程序(含硬件51单片机与液晶模块接线图) 下面是线路连接图,我自己已经搞了整整一个测试成功了绝对可用
C51源代码
#include
sbit EN=P2^0; sbit RW=P2^1; sbit RS=P2^2; sbit CS1=P2^3; sbit CS2=P2^4; sbit BUSY=P0^0;
1文档来源为:从网络收集整理.word版本可编辑.
文档收集于互联网,已重新整理排版.word版本可编辑,有帮助欢迎下载支持.
void delay(unsigned char a);
unsigned char code ban[16][16]={
{0x00,0x00,0x00,0xf0,0x90,0x90,0x90,0xfe,0x90,0x90,0x90,0xf0,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x07,0x04,0x04,0x04,0x3f,0x24,0x24,0x24,0x27,0x20,0x38,0x00,0x00},//电
{0x00,0x00,0x00,0x00,0x8c,0x88,0x88,0x88,0x88,0xc8,0xa8,0x98,0x00,0x00,0x00,0x00},
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00},//子
{0x00,0x00,0x00,0x00,0x10,0x10,0x30,0x54,0x9c,0x90,0x50,0x00,0x30,0x10,0x00,0x00},
{0x00,0x40,0x30,0x0c,0x03,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00},//产
{0x00,0x00,0x00,0x00,0x7c,0x44,0x44,0x44,0x44,0x44,0x44,0x7c,0x00,0x00,0x00,0x00},
{0x00,0x00,0x3f,0x21,0x21,0x21,0x3f,0x00,0x00,0x3f,0x21,0x21,0x21,0x3f,0x00,0x00},//品
{0x00,0x00,0x00,0x00,0x0c,0x08,0x08,0x08,0xf8,0x08,0x08,0x08,0x08,0x00,0x00,0x00},
{0x00,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x3f,0x20,0x20,0x20,0x20,0x30,0x00,0x00},//工
{0x00,0x90,0x90,0x88,0xf8,0x84,0x86,0x00,0x7c,0x44,0x44,0x44,0x44,0x7c,0x00,0x00},
{0x40,0x30,0x0c,0x02,0x7f,0x02,0x0c,0x10,0x49,0x49,0x49,0x7f,0x49,0x49,0x00,0x00},//程
1文档来源为:从网络收集整理.word版本可编辑.
收音机检波电路图
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)
![](/skin/haowen/images/icon_star.png)