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
臺灣光寶光耦全系列產品 LTV-817S-TA1-C LTV-817X-B LTV-817X-C LTV-817X-C-SC LTV-817-D MOC3021 MOC3021S-TA1 MOC-3052 4N28 4N35 4N35S 4N35S-TA1 6N136 6N137 6N138 6N139 LTV-217-A-G LTV-217-B LTV-352T LTV-354T LTV-356T-B LTV-356T-C LTV-814 LTV-816X-B LTV-816X-C LTV-816X-D
標簽: 光耦
上傳時間: 2013-11-12
上傳用戶:199311
本ppt介紹了多層C/S型數據庫應用,多層數據庫應用的結構,典型的三層C/S結構,B/S型數據庫應用,典型的B/S結構(三層),結合三層C/S的B/S結構(四層),使用多層分布式應用結構的優勢,高可靠性的多層分布式結構等方面的內容
上傳時間: 2015-03-15
上傳用戶:songnanhua
RSA算法 :首先, 找出三個數, p, q, r, 其中 p, q 是兩個相異的質數, r 是與 (p-1)(q-1) 互質的數...... p, q, r 這三個數便是 person_key,接著, 找出 m, 使得 r^m == 1 mod (p-1)(q-1)..... 這個 m 一定存在, 因為 r 與 (p-1)(q-1) 互質, 用輾轉相除法就可以得到了..... 再來, 計算 n = pq....... m, n 這兩個數便是 public_key ,編碼過程是, 若資料為 a, 將其看成是一個大整數, 假設 a < n.... 如果 a >= n 的話, 就將 a 表成 s 進位 (s
標簽: person_key RSA 算法
上傳時間: 2013-12-14
上傳用戶:zhuyibin
文檔管理系統 簡介: 本系統由羅松獨立自主開發,其他個人、組織不得非法進行拷貝、應用。違者將對其進行經濟制裁、即法律責任。對于個人應用,在本人網站上提供了免費的服務。對于各機構組織、法人代表則需與本人商議,經本人同意方可應用。 作者:羅松 版權(c)工職軟件開發組 http://cqpps.126.com e_mail:luosong@isofthome.com 實現語言:C 開發環境:Turbo C 系統結構: a:學生檔案管理系統 b:職業檔案管理系統 操作步驟: 1:進入主頁面,按y同意本系統協議方可運行。 2:輸入密碼:666888 3:以下步驟按提示便可完成。
上傳時間: 2014-01-18
上傳用戶:rocketrevenge
本書是久負盛名的C++經典教程,其內容是C++大師Stanley B. Lippman豐富的實踐經驗和C++標準委員會原負責人Josée Lajoie對C++標準深入理解的完美結合,已經幫助全球無數程序員學會了C++。本版對前一版進行了徹底的修訂,內容經過了重新組織,更加入了C++先驅Barbara E.Moo在C++教學方面的真知灼見。既顯著改善了可讀性,又充分體現了C++語言的最新進展和當前的業界最佳實踐。書中不但新增大量教學輔助內容,用于強調重要的知識點,提醒常見的錯誤,推薦優秀的編程實踐,給出使用提示,還包含大量來自實戰的示例和習題。 對C++基本概念和技術全面而且權威的闡述,對現代C++編程風格的強調,使本書成為C++初學者的最佳指南;對于中高級程序員,本書也是不可或缺的參考書。
標簽: 教程
上傳時間: 2014-01-26
上傳用戶:zhangjinzj
三相步進電機的三相六拍工作方式,正轉的繞組通電順序:A、AB、B、BC、C、CA、A,反轉的通電順序:A、AC、C、CB、B、BA、B、A。 由于步進電機轉子有一定的慣性以及所帶負載的慣性,故步進電機的工作過程中不能及時的啟動和停止,在啟動時應慢慢的加速到預定速度,在停止前應逐漸減速到停止,否則,將產生失步現象。 步進電機的控制問題可總結為兩點: 1、產生工作方式需要的時序脈沖; 2、控制步進電機的速度,使它始終遵循加速、勻速、減速的規律工作。
上傳時間: 2015-12-01
上傳用戶:685
UC Library Extensions UnderC comes with a pocket implementation of the standard C++ libraries, which is a reasonably faithful subset. This documentation describes those UnderC functions and classes which are not part of the C++ standard. UC Library Builtin functions: Most of these are standard C functions, but there are a few unique to the UnderC system which give you runtime access to the compiler. You may evaluate expressions, execute commands, compile code, etc. * Expands the text in expr using the UnderC preprocessor, putting the result into buff. void uc_macro_subst(const char* expr, char* buff, int buffsize) * Executes a UC #-command, like #l or #help. uc_cmd() expects the name of the command, _without_ the hash, e.g. uc_cmd("l fred.cpp") or uc_cmd("help"). void uc_cmd(const char* cmd) * Evaluates any C++ expression or statement will return non-zero if unsuccessful.
標簽: implementation Extensions libraries standard
上傳時間: 2013-12-14
上傳用戶:leehom61
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
標簽: represented integers group items
上傳時間: 2016-01-17
上傳用戶:jeffery