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
Arduino 一些资料
标签: Quick-Start Arduino Schmidt Guide
上传时间: 2013-11-07
上传用户:气温达上千万的
#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
a_bit equ 20h ;个位数存放处 b_bit equ 21h ;十位数存放处 temp equ 22h ;计数器寄存器 star: mov temp,#0 ;初始化计数器 stlop: acall display inc temp mov a,temp cjne a,#100,next ;=100重来 mov temp,#0 next: ljmp stlop ;显示子程序 display: mov a,temp ;将temp中的十六进制数转换成10进制 mov b,#10 ;10进制/10=10进制 div ab mov b_bit,a ;十位在a mov a_bit,b ;个位在b mov dptr,#numtab ;指定查表启始地址 mov r0,#4 dpl1: mov r1,#250 ;显示1000次 dplop: mov a,a_bit ;取个位数 MOVC A,@A+DPTR ;查个位数的7段代码 mov p0,a ;送出个位的7段代码
上传时间: 2013-11-06
上传用户:lx9076
The P90CL301 is a highly integrated 16/32 bit micro-controller especially suitable for applications requiring lowvoltage and low power consumption. It is fully software compatible with the 68000. Furthermore, it provides bothstandard as well as advanced peripheral functions on-chip.One of these peripheral functions is the I2C bus. This report describes worked-out driver software (written in C) toprogram the P90CL301 I2C interface. It also contains interface software routines offering the user a quick start inwriting a complete I2C system application.
上传时间: 2014-01-06
上传用户:气温达上千万的
This application note demonstrates how to write an Inter Integrated Circuit bus driver (I2C) for the XA-S3 16-bitMicrocontroller from Philips Semiconductors.Not only the driver software is given. This note also contains a set of (example) interface routines and a smalldemo application program. All together it offers the user a quick start in writing a complete I2C system applicationwith the PXAS3x.The driver routines support interrupt driven single master transfers. Furthermore, the routines are suitable foruse in conjunction with real time operating systems.
上传时间: 2013-11-02
上传用户:zw380105939
The XA-S3 is a member of Philips Semiconductors’ XA (eXtended Architecture) family of high performance 16-bit single-chip Microcontrollers. The XA-S3 combines many powerful peripherals on one chip. Therefore, it is suited for general multipurpose high performance embedded control functions.One of the on-chip peripherals is the I2C bus interface. This report describes worked-out driver software (written in C) to program / use the I2C interface of the XA-S3. The driver software, together with a demo program and interface software routines offer the user a quick start in writing a complete I2C - XAS3 system application.
上传时间: 2013-11-10
上传用户:liaofamous
工作原理 该装置电路原理见图1。由红外线传感器、信号放大电路、电压比较器、延时电路和音响报警电路等组成。红外线探测传感器IC1探测到前方人体辐射出的红外线信号时,由IC1的②脚输出微弱的电信号,经三极管VT1等组成第一级放大电路放大,再通过C2输入到运算放大器IC2中进行高增益、低噪声放大,此时由 IC2①脚输出的信号已足够强。IC3作电压比较器,它的第⑤脚由R10、VD1提供基准电压,当IC2①脚输出的信号电压到达IC3的⑥脚时,两个输入端的电压进行比较, 此时IC3的⑦脚由原来的高电平变为低电平。IC4为报警延时电路,R14和C6组成延时电路,其时间约为1分钟。当IC3的⑦脚变为低电平时,C6通过VD2放电,此时IC4的②脚变为低电平它与IC4的③脚基准电压进行比较,当它低于其基准电压时,IC4的①脚变为高电平,VT2 导通,讯响器BL通电发出报警声。人体的红外线信号消失后,IC3的⑦脚又恢复高电平输出,此时VD2截止。由于C6两端的电压不能突变, 故通过R14向 C6缓慢充电,当C6两端的电压高于其基准电压时,IC4的①脚才变为低电平,时间约为1分钟,即持续1分钟报警。
上传时间: 2013-12-19
上传用户:Breathe0125
The CodeWarrior Development Suite provides access and technical support to amultitude of CodeWarrior products. In this quick start guide, Section 1 explains howto register your CodeWarrior Development Suite. Section 2 explains how to activateand install one of your products. Section 3 describes what you are entitled to withthe purchase of your CodeWarrior Development Suite, and Section 4 discusses theavailable purchase options. Section 5 describes the benefits of maintaining a currenttechnical support contract, and Section 6 tells you how to access support.
标签: CodeWarrior 开发套件
上传时间: 2014-03-02
上传用户:784533221
第八章 labview的编程技巧 本章介绍局部变量、全局变量、属性节点和其他一些有助于提高编程技巧的问题,恰当地运用这些技巧可以提高程序的质量。 8.1 局部变量 严格的语法尽管可以保证程序语言的严密性,但有时它也会带来一些使用上的不便。在labview这样的数据流式的语言中,将变量严格地分为控制器(Control)和指示器(Indicator),前者只能向外流出数据,后者只能接受流入的数据,反过来不行。在一般的代码式语言中,情况不是这样的。例如我们有变量a、b和c,只要需要我们可以将a的值赋给b,将b的值赋给c等等。前面所介绍的labview内容中,只有移位积存器即可输入又可输出。另外,一个变量在程序中可能要在多处用到,在图形语言中势必带来过多连线,这也是一件烦人的事。还有其他需要,因此labview引入了局部变量。
上传时间: 2013-10-27
上传用户:xieguodong1234