void display() //數(shù)碼顯示 { SCON=0; //初始化串行口方式 SBUF=dispcode[ge]; while(!TI); TI=0; led4=0; delay(2); led4=1; SBUF=dispcode[shi]; while(!TI); TI=0; led3=0; delay(2); led3=1;
標(biāo)簽: 164 74 ls 動(dòng)態(tài)
上傳時(shí)間: 2013-11-20
上傳用戶:wtrl
TLC2543是TI公司的12位串行模數(shù)轉(zhuǎn)換器,使用開(kāi)關(guān)電容逐次逼近技術(shù)完成A/D轉(zhuǎn)換過(guò)程。由于是串行輸入結(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的引腳排列及說(shuō)明 TLC2543有兩種封裝形式:DB、DW或N封裝以及FN封裝,這兩種封裝的引腳排列如圖1,引腳說(shuō)明見(jiàn)表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
#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
該文是小生在學(xué)習(xí)51單片機(jī)時(shí)搜集多份網(wǎng)上資料整理而成,要點(diǎn)處有重點(diǎn)標(biāo)注,而且分類詳細(xì),望能給廣大有相關(guān)疑問(wèn)的同志以幫助....
上傳時(shí)間: 2013-10-26
上傳用戶:yulg
對(duì)應(yīng)程序: #include<reg52.h> #define uint unsigned int #define uchar unsigned char uchar code tab[]={ 0x81, 0x42, 0x24, 0x18, }; void delay(uint z) { uint i,j; for(i=z;i>0;i--) for(j=120;j>0;j--); } void init() { P0=0x00; }
上傳時(shí)間: 2014-01-17
上傳用戶:ruan2570406
HIGH SPEED 8051 μC CORE - Pipe-lined Instruction Architecture; Executes 70% of Instructions in 1 or 2 System Clocks - Up to 25MIPS Throughput with 25MHz System Clock - 22 Vectored Interrupt Sources MEMORY - 4352 Bytes Internal Data RAM (256 + 4k) - 64k Bytes In-System Programmable FLASH Program Memory - External Parallel Data Memory Interface – up to 5Mbytes/sec DIGITAL PERIPHERALS - 64 Port I/O; All are 5V tolerant - Hardware SMBusTM (I2CTM Compatible), SPITM, and Two UART Serial Ports Available Concurrently - Programmable 16-bit Counter/Timer Array with 5 Capture/Compare Modules - 5 General Purpose 16-bit Counter/Timers - Dedicated Watch-Dog Timer; Bi-directional Reset CLOCK SOURCES - Internal Programmable Oscillator: 2-to-16MHz - External Oscillator: Crystal, RC, C, or Clock - Real-Time Clock Mode using Timer 3 or PCA SUPPLY VOLTAGE ........................ 2.7V to 3.6V - Typical Operating Current: 10mA @ 25MHz - Multiple Power Saving Sleep and Shutdown Modes 100-Pin TQFP (64-Pin Version Available) Temperature Range: –40°C to +85°C
標(biāo)簽: C8051F020
上傳時(shí)間: 2013-10-12
上傳用戶:lalalal
目錄: 1. Character Type Functions - 字符類型函數(shù) 2. Standard C Input/Output Functions - 標(biāo)準(zhǔn)輸入輸出函數(shù) 3. Standard Library Functions - 標(biāo)準(zhǔn)庫(kù)和內(nèi)存分配函數(shù) 4. Mathematical Functions - 數(shù)學(xué)函數(shù) 5. String Functions - 字符串函數(shù) 6. BCD Conversion Functions - BCD 轉(zhuǎn)換函數(shù) 7. Memory Access Functions - 存儲(chǔ)器訪問(wèn)函數(shù) 8. Delay Functions - 延時(shí)函數(shù) 9. LCD Functions - LCD函數(shù) 10. LCD Functions for displays with 4x40 characters - 4×40 字符型LCD函數(shù) 11. LCD Functions for displays connected in 8 bit memory mapped mode -以8 位外部存儲(chǔ) 器模式接口的LCD顯示函數(shù) 12. I2C Bus Functions - I2C 總線函數(shù) 13. National Semiconductor LM75 Temperature Sensor Functions - LM75 溫度傳感器函數(shù) 14. Dallas Semiconductor DS1621 Thermometer/Thermostat Functions - DS1621 溫度計(jì)函 數(shù) 15. Philips PCF8563 Real Time Clock Functions - PCF8563 實(shí)時(shí)時(shí)鐘函數(shù) 16. Philips PCF8583 Real Time Clock Functions - PCF8583 實(shí)時(shí)時(shí)鐘函數(shù) 17. Dallas Semiconductor DS1302 Real Time Clock Functions - DS1302 實(shí)時(shí)時(shí)鐘函數(shù) 18. Dallas Semiconductor DS1307 Real Time Clock Functions - DS1307 實(shí)時(shí)時(shí)鐘函數(shù) 19. 1 Wire Protocol Functions - 單線通訊協(xié)議函數(shù) 20. Dallas Semiconductor DS1820/DS1822 Temperature Sensors Functions - DS1820/1822 溫度傳感器函數(shù) 21. SPI Functions - SPI 函數(shù) 22. Power Management Functions - 電源管理函數(shù) 23. Gray Code Conversion Functions - 格雷碼轉(zhuǎn)換函數(shù)
標(biāo)簽: AVR 庫(kù)函數(shù)
上傳時(shí)間: 2013-10-22
上傳用戶:歸海惜雪
飛機(jī)電網(wǎng)故障時(shí),機(jī)載電氣盒必須在延遲時(shí)間內(nèi)切斷電網(wǎng),保護(hù)機(jī)載設(shè)備。采用AT89S52設(shè)計(jì)的電氣盒測(cè)試儀能夠測(cè)試電氣盒保護(hù)功能,測(cè)量延遲時(shí)間。實(shí)際應(yīng)用結(jié)果表明,該測(cè)試儀具有測(cè)量準(zhǔn)確、可靠性高、成本低等優(yōu)點(diǎn)。 Abstract: The helicopter-electrical-box must shut off the helicopter power,protect the equipments of the helicopter when the helicopter power is failed.The tester for the helicopter-electrical-box based on AT89S52is used for testing the protect-ing function and measuring the delay time.Application results show this tester has some advantages,such as accurate mea-surement,high dependability,economical cost etc.
上傳時(shí)間: 2014-12-27
上傳用戶:786334970
介紹以P87LPC764型單片機(jī)為核心的延時(shí)型漏電繼電器設(shè)計(jì)方案。該方案可供用戶選擇實(shí)現(xiàn)額定動(dòng)作電流和5倍額定動(dòng)作電流下不同的延時(shí)動(dòng)作時(shí)間,并有重合閘設(shè)定選擇功能。解決了以往傳統(tǒng)分立元件帶來(lái)的延時(shí)時(shí)間離散性大且不易實(shí)現(xiàn)的弊端。 Abstract: In this paper, the delay leakage relay based on P87LPC764 is introduced in detail. This system provides different relay times at rating current and 5× rating current for users and also offers superposition brake set selection function. So that it resolves many traditional problems.
上傳時(shí)間: 2013-11-08
上傳用戶:zhaiye
第一章 序論……………………………………………………………6 1- 1 研究動(dòng)機(jī)…………………………………………………………..7 1- 2 專題目標(biāo)…………………………………………………………..8 1- 3 工作流程…………………………………………………………..9 1- 4 開(kāi)發(fā)環(huán)境與設(shè)備…………………………………………………10 第二章 德州儀器OMAP 開(kāi)發(fā)套件…………………………………10 2- 1 OMAP介紹………………………………………………………10 2-1.1 OMAP是什麼?…….………………………………….…10 2-1.2 DSP的優(yōu)點(diǎn)……………………………………………....11 2- 2 OMAP Architecture介紹………………………………………...12 2-2-1 OMAP1510 硬體架構(gòu)………………………………….…12 2-2.2 OMAP1510軟體架構(gòu)……………………………………...12 2-2.3 DSP / BIOS Bridge簡(jiǎn)述…………………………………...13 2- 3 TI Innovator套件 -- OMAP1510 ……………………………..14 2-2.1 General Purpose processor -- ARM925T………………...14 2-2.2 DSP processor -- TMS320C55x …………………………15 2-2.3 IDE Tool – CCS …………………………………………15 2-2.4 Peripheral ………………………………………………..16 第三章 在OMAP1510上建構(gòu)Embedded Linux System…………….17 3- 1 嵌入式工具………………………………………………………17 3-1.1 嵌入式程式開(kāi)發(fā)與一般程式開(kāi)發(fā)之不同………….….17 3-1.2 Cross Compiling的GNU工具程式……………………18 3-1.3 建立ARM-Linux Cross-Compiling 工具程式………...19 3-1.4 Serial Communication Program………………………...20 3- 2 Porting kernel………………………………………………….…21 3-2.1 Setup CCS ………………………………………….…..21 3-2.2 編譯及上傳Loader…………………………………..…23 3-2.3 編譯及上傳Kernel…………………………………..…24 3- 3 建構(gòu)Root File System………………………………………..…..26 3-3.1 Flash ROM……………………………………………...26 3-3.2 NFS mounting…………………………………………..27 3-3.3 支援NFS Mounting 的kernel…………………………..27 3-3.4 提供NFS Mounting Service……………………………29 3-3.5 DHCP Server……………………………………………31 3-3.6 Linux root 檔案系統(tǒng)……………………………….…..32 3- 4 啟動(dòng)及測(cè)試Innovator音效裝置…………………………..…….33 3- 5 建構(gòu)支援DSP processor的環(huán)境…………………………...……34 3-5.1 Solution -- DSP Gateway簡(jiǎn)介……………………..…34 3-5.2 DSP Gateway運(yùn)作架構(gòu)…………………………..…..35 3- 6 架設(shè)DSP Gateway………………………………………….…36 3-6.1 重編kernel……………………………………………...36 3-6.2 DEVFS driver…………………………………….……..36 3-6.3 編譯DSP tool和API……………………………..…….37 3-6.4 測(cè)試……………………………………………….…….37 第四章 MP3 Player……………………………………………….…..38 4- 1 MP3 介紹………………………………………………….…….38 4- 2 MP3 壓縮原理……………………………………………….….39 4- 3 Linux MP3 player – splay………………………………….…….41 4.3-1 splay介紹…………………………………………….…..41 4.3-2 splay 編譯………………………………………….…….41 4.3-3 splay 的使用說(shuō)明………………………………….……41 第五章 程式改寫(xiě)………………………………………………...…...42 5-1 程式評(píng)估與改寫(xiě)………………………………………………...…42 5-1.1 Inter-Processor Communication Scheme…………….....42 5-1.2 ARM part programming……………………………..…42 5-1.3 DSP part programming………………………………....42 5-2 程式碼………………………………………………………..……43 5-3 雙處理器程式開(kāi)發(fā)注意事項(xiàng)…………………………………...…47 第六章 效能評(píng)估與討論……………………………………………48 6-1 速度……………………………………………………………...48 6-2 CPU負(fù)載………………………………………………………..49 6-3 討論……………………………………………………………...49 6-3.1分工處理的經(jīng)濟(jì)效益………………………………...49 6-3.2音質(zhì)v.s 浮點(diǎn)與定點(diǎn)運(yùn)算………………………..…..49 6-3.3 DSP Gateway架構(gòu)的限制………………………….…50 6-3.4減少IO溝通……………….………………………….50 6-3.5網(wǎng)路掛載File System的Delay…………………..……51 第七章 結(jié)論心得…
上傳時(shí)間: 2013-10-14
上傳用戶:a471778
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1