以下是本人设计的TLC549的51单片机程序,仅供参考!!!
/********************************************************
程序:TLC549 AD转换演示程序(基于TLC549的数字电压表设计)
制作:风沙星辰
日期:2009年10月11日
功能:通过TLC549 AD转换芯片进行电压采集,将采集到的信号
以电压的形式通过数码显示出来。
备注:STC89C52RC 11.0592M晶振
说明:学习TLC549 AD转换芯片的和51内部定时器的使用
********************************************************/
/* 头文件和必要声明及数码管的值 */
#include<reg52.h>
#include<intrins.h>
#define led P0
#define uchar unsigned char
#define uint unsigned int
uint Volt; //电压换算并扩大1000倍
uchar num;
uchar code table[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
/** 0 1 2 3 4 5 6 7 8 9 */
uchar code table1[]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10};
/** 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. */
/* TLC549和数码管为选声明 */
sbit CLK = P2^6; //时钟
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载