TLC2543是TI公司的12位串行模数转换器,使用开关电容逐次逼近技术完成A/D转换过程。由于是串行输入结构,能够节省51系列单片机I/O资源;且价格适中,分辨率较高,因此在仪器仪表中有较为广泛的应用。 TLC2543的特点 (1)12位分辩率A/D转换器; (2)在工作温度范围内10μs转换时间; (3)11个模拟输入通道; (4)3路内置自测试方式; (5)采样率为66kbps; (6)线性误差±1LSBmax; (7)有转换结束输出EOC; (8)具有单、双极性输出; (9)可编程的MSB或LSB前导; (10)可编程输出数据长度。 TLC2543的引脚排列及说明 TLC2543有两种封装形式:DB、DW或N封装以及FN封装,这两种封装的引脚排列如图1,引脚说明见表1 TLC2543电路图和程序欣赏 #include<reg52.h> #include<intrins.h> #define uchar unsigned char #define uint unsigned int sbit clock=P1^0; sbit d_in=P1^1; sbit d_out=P1^2; sbit _cs=P1^3; uchar a1,b1,c1,d1; float sum,sum1; double sum_final1; double sum_final; uchar duan[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f}; uchar wei[]={0xf7,0xfb,0xfd,0xfe}; void delay(unsigned char b) //50us { unsigned char a; for(;b>0;b--) for(a=22;a>0;a--); } void display(uchar a,uchar b,uchar c,uchar d) { P0=duan[a]|0x80; P2=wei[0]; delay(5); P2=0xff; P0=duan[b]; P2=wei[1]; delay(5); P2=0xff; P0=duan[c]; P2=wei[2]; delay(5); P2=0xff; P0=duan[d]; P2=wei[3]; delay(5); P2=0xff; } uint read(uchar port) { uchar i,al=0,ah=0; unsigned long ad; clock=0; _cs=0; port<<=4; for(i=0;i<4;i++) { d_in=port&0x80; clock=1; clock=0; port<<=1; } d_in=0; for(i=0;i<8;i++) { clock=1; clock=0; } _cs=1; delay(5); _cs=0; for(i=0;i<4;i++) { clock=1; ah<<=1; if(d_out)ah|=0x01; clock=0; } for(i=0;i<8;i++) { clock=1; al<<=1; if(d_out) al|=0x01; clock=0; } _cs=1; ad=(uint)ah; ad<<=8; ad|=al; return(ad); } void main() { uchar j; sum=0;sum1=0; sum_final=0; sum_final1=0; while(1) { for(j=0;j<128;j++) { sum1+=read(1); display(a1,b1,c1,d1); } sum=sum1/128; sum1=0; sum_final1=(sum/4095)*5; sum_final=sum_final1*1000; a1=(int)sum_final/1000; b1=(int)sum_final%1000/100; c1=(int)sum_final%1000%100/10; d1=(int)sum_final%10; display(a1,b1,c1,d1); } }
上传时间: 2013-11-19
上传用户:shen1230
#include<iom16v.h> #include<macros.h> #define uint unsigned int #define uchar unsigned char uint a,b,c,d=0; void delay(c) { for for(a=0;a<c;a++) for(b=0;b<12;b++); }; uchar tab[]={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,
上传时间: 2013-10-21
上传用户:13788529953
为了提高PCB板制作的效率,改变传统的化学腐蚀制板工艺,使用机械仿形铣制作电路板的方法,设计了以ATMEGA16单片机为核心部件的PCB板雕刻机控制系统。其中包括PCB雕刻机的基本功能、主要硬件电路设计和软件的实现流程,并给出了相关设计电路。重点分析了雕刻机步进电机的驱动电路以及主轴电机的驱动电路,该雕刻机经实际运行,系统工作良好,可有效提高PCB板的制作效率。 Abstract: In order to improve the efficiency of production of PCB board and change the traditional chemical etching plates, using of mechanical copying milling method makes circuit boards,this paper introduces the PCB engraving machine control system used ATMEGA16 microcomputer as the core components. It includes basic function, the hardware circuit design and software realization process, and gives the corresponding circuit design.It analyses the drive circuit of engrawing machine stepper motor and spindle motor in detail. This engraving machine by practical operation, the system works well, which can effectively improve the production efficiency of PCB board.
上传时间: 2013-10-17
上传用户:liangliang123
为了有效地提升铅酸蓄电池的使用寿命,同时实现对充电过程的监控,设计出一种用单片机控制的36 V铅酸蓄电池充电电源。本电路采用反激式拓扑,连续电流工作模式,电源管理IC设计在电源的副边,由ELAN公司的EM78P258N单片机模拟,是用可编程器件模拟电源管理IC,实现智能电源低成本化的一次成功尝试,通过对单片机的软件设计实现了充电电源的状态显示、充电时间控制、报警、过温保护、过压保护、过流保护等功能。本充电器真正的实现了铅酸蓄电池的三段式充电过程,其最高输出功率可达90 W,效率约85%,成本不到20元,具有很高的市场竞争力。 Abstract: In order to extend the life of lead-acid battery efficiently and supervise the charging process meanwhile, a 36V lead-acid battery charge powe supply controlled by microcontroller is designed. The charger is flyback switching power supply and works in CCM mode. A EM78P258N microcontroller made by ELAN microelectronics corporation is used as power management IC which is designed at the secondary circuit. The project is a successful attempt to low-cost intelligent power used microcontroller simulating power management IC. The charger also has the functions of the status reveal, charge time control, alarming, thermal protect, current limit and overvoltage protect by the software design. The circuit actually implements the three-step charge process, whose power is up to 90W and whose efficiency can get 85%. The net cost of this charger is less than 20 RMB, so that the charger is of powerful market competitiveness.
上传时间: 2013-11-16
上传用户:cepsypeng
针对目前燃气灶市场的状况,提出一种基于PIC16C711单片机的燃气灶脉冲点火控制器设计,具体包括有系统的组成和功能介绍、硬件电路设计及软件功能实现。 Abstract: Aiming at today’s gas cooker market, a pulse ignition controler design based on PIC16C711 is presented.The specific descriptions of system components and functions,hardware circuit design and software function are given.
上传时间: 2013-10-31
上传用户:zhqzal1014
本系统的设计电路以凌阳单片机SPCE061A作为控制器。主要由显示电路, 功能控制电路、传感器电路、电压转换电路、遥控电路五部分。吸收了硬件软件化的思想,大部分功能通过软件来实现,使电路简单明了,系统稳定性大大提高。本系统不仅成功的实现了要求的基本功能,发挥部分也得到完全的实现,而且有一定的创新功能。
上传时间: 2013-11-21
上传用户:1966640071
摘要:提供两个实用的、能够在单片机上通过软件来实现的CRC快速算法,其中一个适用于51系列等单片机,另一个适用于PIC单片机,这两种算法十分简单快捷。
上传时间: 2014-01-05
上传用户:brain kung
摘要:随着电子技术的发展,镍镉和镍氢等充电电池的使用愈来愈多,购买和使用充电电池时,电池容量(Ah)成为人们关注的指标.本文采用一种基于AT89C2051单片机制作的电池容量测试电路,可对镍镉和镍氢等充电电池的容量进行自动测试,并以数字形式显示其测试结果,测量范围为0.01—9.99Ah.分析了电路硬件与软件设计实现,具有一定的实用价值.关键词:电池容量;单片机;硬件;软件
上传时间: 2013-10-22
上传用户:wsf950131
用单片机制作通用型电视遥控器:本文介绍了一种用MCS-51系列单片机AT89C52代替专用遥控芯片的设计方案,通过软件模拟实现了电视机遥控编码的发射,并且达到“一器多用”。上世纪八十年代初,日本率先在电视产品中使用了红外遥控技术,目前已经在电视机上得到了广泛应用。电视遥控器使用的是专用集成发射芯片来实现遥控码的发射,如东芝TC9012,飞利浦SAA3010T等。这些芯片价格较贵,且相互之间采用的遥控编码格式互不兼容,所以各机型的遥控器通常只能针对各自的遥控对象而无法通用。本文在试验验证的基础上,介绍了如何利用低成本的MCS-51系列单片机来实现遥控码的模拟发射,并实现遥控器的通用化。遥控发射技术的基本原理通常彩电遥控信号的发射,就是将某个按键所对应的控制指令和系统码(由0和1组成的序列),调制在32~56KHz范围内的载波上,然后经放大、驱动红外发射管将信号发射出去。不同公司的遥控芯片,采用的遥控码格式也不一样。在此介绍较普遍的两种,一种是NEC标准,一种是PHILIPS 标准。
上传时间: 2013-11-17
上传用户:jiangfire
在D/A转换电路中,针对双极性电压基准输出要求,使用运算放大器MCP606和MCP1525产生±2.5 V高精度电压基准,在打标软件中将图形打标和字符打标分开,能精确体现字号大小及字体变化的效果。给出了硬件电路设计方案及控制系统软件的实现方法。
上传时间: 2013-10-27
上传用户:牧羊人8920