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