新闻中心

EEPW首页>嵌入式系统>设计应用> 51单片机驱动TEA5767调频收音机芯片C程序

51单片机驱动TEA5767调频收音机芯片C程序

作者: 时间:2016-11-30 来源:网络 收藏

完整的源代码下载地址:http://www.51hei.com/bbs/dpj-19294-1.html下面是程序的主要部分:

本文引用地址://m.amcfsurvey.com/article/201611/323741.htm

/*----------- TEA5767 驱动-----------*/
/*------ 外部晶振为 12MHz-------*/
/*--------最后修改2011.02.26-------*/
#include "STC12C5620AD.H"
#include "IIC.H"
#include "delay.h"
#include "Radio.H"
#include "Channel_Handle.H"

#define Max_Freq 108000
#define Min_Freq 87500
/**********************声明外部变量**************************/
extern uchardataDisplay_FM[9]; //From Main.c
/********************** 定义变量**************************/
uchar TEA5767_Write_Data[5]={0x29,0x9e,0x40,0x12,0x40}; //要写入TEA5767的数据
uchar TEA5767_Read_Data[5];

unsignedlongFrequency;
unsigned int PLL=0x299e;
/********************** TEA5767 写入数据**************************/
void TEA5767_Write(void)
{
uchar i;
IIC_Start();
IIC_Write_Byte(0xc0); //TEA5767写地址
if(!IIC_Test_ACK())
{
for(i=0;i<5;i++)
{
IIC_Write_Byte(TEA5767_Write_Data[i]);
IIC_ACK();
}
}
IIC_Stop();
}


上一页 1 2 下一页

评论


技术专区

关闭