TLC2543是TI公司的12位串行模數(shù)轉(zhuǎn)換器,使用開關(guān)電容逐次逼近技術(shù)完成A/D轉(zhuǎn)換過程。由于是串行輸入結(jié)構(gòu),能夠節(jié)省51系列單片機(jī)I/O資源;且價(jià)格適中,分辨率較高,因此在儀器儀表中有較為廣泛的應(yīng)用。 TLC2543的特點(diǎn) (1)12位分辯率A/D轉(zhuǎn)換器; (2)在工作溫度范圍內(nèi)10μs轉(zhuǎn)換時(shí)間; (3)11個(gè)模擬輸入通道; (4)3路內(nèi)置自測(cè)試方式; (5)采樣率為66kbps; (6)線性誤差±1LSBmax; (7)有轉(zhuǎn)換結(jié)束輸出EOC; (8)具有單、雙極性輸出; (9)可編程的MSB或LSB前導(dǎo); (10)可編程輸出數(shù)據(jù)長(zhǎng)度。 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); } }
上傳時(shí)間: 2013-11-19
上傳用戶:shen1230
Arduino 一些資料
標(biāo)簽: Quick-Start Arduino Schmidt Guide
上傳時(shí)間: 2013-11-07
上傳用戶:氣溫達(dá)上千萬的
#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,
標(biāo)簽: AVR 單片機(jī) 數(shù)碼管
上傳時(shí)間: 2013-10-21
上傳用戶:13788529953
a_bit equ 20h ;個(gè)位數(shù)存放處 b_bit equ 21h ;十位數(shù)存放處 temp equ 22h ;計(jì)數(shù)器寄存器 star: mov temp,#0 ;初始化計(jì)數(shù)器 stlop: acall display inc temp mov a,temp cjne a,#100,next ;=100重來 mov temp,#0 next: ljmp stlop ;顯示子程序 display: mov a,temp ;將temp中的十六進(jìn)制數(shù)轉(zhuǎn)換成10進(jìn)制 mov b,#10 ;10進(jìn)制/10=10進(jìn)制 div ab mov b_bit,a ;十位在a mov a_bit,b ;個(gè)位在b mov dptr,#numtab ;指定查表啟始地址 mov r0,#4 dpl1: mov r1,#250 ;顯示1000次 dplop: mov a,a_bit ;取個(gè)位數(shù) MOVC A,@A+DPTR ;查個(gè)位數(shù)的7段代碼 mov p0,a ;送出個(gè)位的7段代碼
標(biāo)簽: 直接驅(qū)動(dòng) 數(shù)碼管 計(jì)數(shù)器 程序
上傳時(shí)間: 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.
上傳時(shí)間: 2014-01-06
上傳用戶:氣溫達(dá)上千萬的
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.
標(biāo)簽: software driver XA-S I2C
上傳時(shí)間: 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.
上傳時(shí)間: 2013-11-10
上傳用戶:liaofamous
工作原理 該裝置電路原理見圖1。由紅外線傳感器、信號(hào)放大電路、電壓比較器、延時(shí)電路和音響報(bào)警電路等組成。紅外線探測(cè)傳感器IC1探測(cè)到前方人體輻射出的紅外線信號(hào)時(shí),由IC1的②腳輸出微弱的電信號(hào),經(jīng)三極管VT1等組成第一級(jí)放大電路放大,再通過C2輸入到運(yùn)算放大器IC2中進(jìn)行高增益、低噪聲放大,此時(shí)由 IC2①腳輸出的信號(hào)已足夠強(qiáng)。IC3作電壓比較器,它的第⑤腳由R10、VD1提供基準(zhǔn)電壓,當(dāng)IC2①腳輸出的信號(hào)電壓到達(dá)IC3的⑥腳時(shí),兩個(gè)輸入端的電壓進(jìn)行比較, 此時(shí)IC3的⑦腳由原來的高電平變?yōu)榈碗娖健C4為報(bào)警延時(shí)電路,R14和C6組成延時(shí)電路,其時(shí)間約為1分鐘。當(dāng)IC3的⑦腳變?yōu)榈碗娖綍r(shí),C6通過VD2放電,此時(shí)IC4的②腳變?yōu)榈碗娖剿cIC4的③腳基準(zhǔn)電壓進(jìn)行比較,當(dāng)它低于其基準(zhǔn)電壓時(shí),IC4的①腳變?yōu)楦唠娖剑琕T2 導(dǎo)通,訊響器BL通電發(fā)出報(bào)警聲。人體的紅外線信號(hào)消失后,IC3的⑦腳又恢復(fù)高電平輸出,此時(shí)VD2截止。由于C6兩端的電壓不能突變, 故通過R14向 C6緩慢充電,當(dāng)C6兩端的電壓高于其基準(zhǔn)電壓時(shí),IC4的①腳才變?yōu)榈碗娖剑瑫r(shí)間約為1分鐘,即持續(xù)1分鐘報(bào)警。
標(biāo)簽: 自己動(dòng)手 紅外線 探測(cè) 防盜器
上傳時(shí)間: 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.
標(biāo)簽: CodeWarrior 開發(fā)套件
上傳時(shí)間: 2014-03-02
上傳用戶:784533221
第八章 labview的編程技巧 本章介紹局部變量、全局變量、屬性節(jié)點(diǎn)和其他一些有助于提高編程技巧的問題,恰當(dāng)?shù)剡\(yùn)用這些技巧可以提高程序的質(zhì)量。 8.1 局部變量 嚴(yán)格的語法盡管可以保證程序語言的嚴(yán)密性,但有時(shí)它也會(huì)帶來一些使用上的不便。在labview這樣的數(shù)據(jù)流式的語言中,將變量嚴(yán)格地分為控制器(Control)和指示器(Indicator),前者只能向外流出數(shù)據(jù),后者只能接受流入的數(shù)據(jù),反過來不行。在一般的代碼式語言中,情況不是這樣的。例如我們有變量a、b和c,只要需要我們可以將a的值賦給b,將b的值賦給c等等。前面所介紹的labview內(nèi)容中,只有移位積存器即可輸入又可輸出。另外,一個(gè)變量在程序中可能要在多處用到,在圖形語言中勢(shì)必帶來過多連線,這也是一件煩人的事。還有其他需要,因此labview引入了局部變量。
上傳時(shí)間: 2013-10-27
上傳用戶:xieguodong1234
蟲蟲下載站版權(quán)所有 京ICP備2021023401號(hào)-1