版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、<p> RS-232串行接口</p><p> RS-232是在任何時候都常用的接口之一。它不僅已經(jīng)被內(nèi)置于每臺PC,而且已被內(nèi)置于從微控制器到主機的多種類型的電腦和與它們連接的設(shè)備。RS-232的最通常得用處是連接到一個Modem,其他擁有RS-232接口的設(shè)備包括打印機,數(shù)據(jù)采集模塊,測試裝置和控制回路。你也可以將RS-232用在任何類型得計算機之間的簡單連接中。</p><
2、;p> RS-232是設(shè)計來處理兩臺設(shè)備之間的通信的,距離限制為50到100f,這決定于波特率和電纜類型。因為RS-232端口被廣泛應(yīng)用,它的另一個用途是與一個將這個接口轉(zhuǎn)換成另一種類型的適配器相連。例如,一個簡單的回路將一個RS-232端口轉(zhuǎn)換成一個RS-485端口,這個端口可以和多臺設(shè)備相連并且可以使用更長的導(dǎo)線連線。</p><p> RS-232連接使用非平衡導(dǎo)線。盡管一個非平衡的狀態(tài)聽起來像是
3、一些應(yīng)該避免的東西,在這里它僅僅是指導(dǎo)線中的信號的電氣特性。在一條非平衡導(dǎo)線中,信號電壓加到一條導(dǎo)線上,所有的信號電壓都使用一個公共的接地線。這種類型的接口的另一個術(shù)語是單端。</p><p><b> 特性</b></p><p> RS---232有幾個優(yōu)點:</p><p> 它是無處不在的。每一臺PC機都有一個或更多的RS---2
4、32端口。更新的計算機現(xiàn)在支持其他諸如USB這樣的串行接口,但是RS---232可以做很多USB無法做的事情。</p><p> 在微控制器中,接口芯片使得將一個5V串口轉(zhuǎn)換成RS-232變得很容易。</p><p> 連接距離可以達到50到100ft。大多數(shù)的外設(shè)接口都不會用于太長的距離。USB連接最長可以達到16ft,PC機的并口打印機接口與主機的距離可以達到10到15ft,或者利
5、用IEEE-1284B型驅(qū)動器可以達到30ft。但是RS-232可以使用更長的電纜。如果每一個RS-232端口與一個Modem相連,你可以使用電話網(wǎng)在世界范圍內(nèi)發(fā)送數(shù)據(jù)。</p><p> 對于一個雙向連接,你只需要3條導(dǎo)線。一個并行連接一般需要8條數(shù)據(jù)線,兩條或者更多的控制信號線,和幾條接地線。所有的導(dǎo)線和更大的連接器使得價格累計起來就比較高了。</p><p> RS-232的缺點
6、包括以下這些:</p><p> 如果連接的另一頭需要并行數(shù)據(jù),它不得不將這個串口數(shù)據(jù)轉(zhuǎn)換成并行數(shù)據(jù)。但是利用一個UART,這很容易實現(xiàn)。</p><p> 串口是如此的有用,以至于尋找一個未用的串口可能會比較困難。PC機可以有多個串口,但是一個系統(tǒng)可能無法為每一個串口分配一個唯一的中斷請求信號。大多數(shù)的微控制器只有一個硬件串口。</p><p> 在一個連接
7、中不能有超過2臺以上的設(shè)備。</p><p> 指定的最大數(shù)據(jù)傳輸速率是每秒20000位。但是,很多接口芯片可以超過這個數(shù)值,尤其是在短程連接上。</p><p> 很長的連接需要一個不同的接口。</p><p> 雙向RS-232通信的3個基本信號如下:</p><p> TD:將數(shù)據(jù)從DCE傳輸?shù)紻CE也被稱作TX和TXD。<
8、;/p><p> RD:將數(shù)據(jù)從DCE傳輸?shù)紻TE。也被稱作RX和RXD。</p><p> SG:信號地。也被稱作GND和SGND。</p><p><b> 電壓</b></p><p> RS-232的邏輯電平用正負電壓表示,而不是只用5V TTL和CMOS邏輯的正電壓信號表示。在一個RS-232的數(shù)據(jù)輸出(T
9、D),一個邏輯0被定義為等于或者高于+5V,而一個邏輯1被定義為等于-5V或者比低于-5V。換言之,信號使用負邏輯,在這種邏輯中,負的電壓為邏輯1。</p><p> 控制信號使用相同的電壓,但是使用的是正邏輯。一個正的電壓表示這項功能為開,而一個負的電壓表示這個功能為關(guān)。</p><p> RS-232接口芯片反向轉(zhuǎn)換這些信號。在一個UART的輸出引腳,一個邏輯1 數(shù)據(jù)位或者一個關(guān)控
10、制信號接近于5V,它在RS-232的接口產(chǎn)生一個負電壓。一個邏輯0數(shù)據(jù)位或者一個開控制信號接近于0V,它在RS-232接口產(chǎn)生一個正電壓。</p><p> 因為一個RS-232接收器可能位于一條長電線纜的末端,等到信號到達接收者的時候,它的電壓可能已經(jīng)削弱了或者加載了噪聲信號。考慮到這種情況,在接受方最低要求的電壓要比在驅(qū)動器處要低。一個比+3V高得多的輸入在RD處是一個邏輯0,或者在一個控制輸入處是一個開。
11、一個比-3V要低得多的輸入在RD處為一個邏輯1,或者在一個控制輸入處為一個關(guān)。根據(jù)這個標準,在-3V和+3V之間的一個輸入的邏輯電平?jīng)]有定義。</p><p> 噪聲容限,或者電壓容限,是輸出電壓和輸入電壓的區(qū)別所在。RS-232的大電壓波動導(dǎo)致一個比5V TTL邏輯寬得多的噪聲容限。例如,即便一個RS-232驅(qū)動器的輸出為最小的+5V,它也會在接受方削弱或者噪聲峰值大到2V,并且仍舊是一個有效邏輯0。很多RS
12、-232輸出有更寬的電壓波動:±9V和 12V是很平常的事情。這些都導(dǎo)致更寬的噪聲容限。最大允許的電壓波動是 15V,盡管接受方必須不受任何損害地處理高達 25V的電壓。</p><p> 使用的另外兩個與RS-232有關(guān)的術(shù)語是Mark和Space。Space是邏輯0,而Mark是邏輯1。這兩個術(shù)語是多年以前機械記錄儀二進制數(shù)據(jù)的,他們分別代表物理標記和空白。</p><p>
13、;<b> 計時限制</b></p><p> TIA/EIA-232包括最小和最大計時規(guī)定。所有的RS-232接口芯片都符合這個規(guī)定。</p><p> 指定的旋轉(zhuǎn)速度限制了接口的最大比特率。旋轉(zhuǎn)率是當輸出切換時電壓變化的快慢的量度,并且描述了一個輸出的電壓變化的瞬間速度。一個RS-232驅(qū)動器的旋轉(zhuǎn)速度必須是每毫秒30V或者更少。</p>&l
14、t;p> 限制旋轉(zhuǎn)速度的好處是它通過事實上消除由于電壓偏轉(zhuǎn)引發(fā)的問題來改進信號質(zhì)量,電壓偏移發(fā)生在傳輸有著快速上升和下降節(jié)拍的信號的長距離連線上。</p><p> 但是旋轉(zhuǎn)速度也限制了一個連接的最大速度。在30V/us的速度下,一個輸出需要0.3us從+5V切換到-5V。RS-232的規(guī)定的最大波特率為20kbps,這個速度轉(zhuǎn)換成一個比特寬度為50us,或者在允許的最快旋轉(zhuǎn)速度下為166倍的切換時間。
15、</p><p> 事實上,因為UART在位的中間附近讀取輸入數(shù)據(jù),并且還因為大多數(shù)的時間參考時鐘是非常準確的,你可以安全的使用短到5到10倍的切換時間的位的寬度??紤]到這些,有的接口芯片允許115kbps或者更高的波特率,即使這違反了這個標準的建議。</p><p> 除了有一個最大的切換速度之外,RS-232 驅(qū)動器還必須符合最低標準以確保信號不在邏輯狀態(tài)之間的未定義區(qū)域停留。對于
16、控制信號和其他40bps和更低的信號,信號線必須花費不超過1ms的時間在有效的邏輯1和邏輯0之間的</p><p> 傳送區(qū)域,對于其他數(shù)據(jù)和時間信號,這個限制是4%的位寬,或者在20bps下為2us。信號的上升和下降次數(shù)也要盡可能的接近相等。</p><p> 在5V邏輯和RS-232之間轉(zhuǎn)換</p><p> 很多微控制器有異步串口,但是它們的輸出和輸入使
17、用5V邏輯而不是使用RS-232電壓。將5V落連接到一個RS-232端口需要轉(zhuǎn)換到RS-232電平和從RS-232電平轉(zhuǎn)換到5V邏輯。</p><p> 利用5V邏輯,我假定了TTL或者CMOS邏輯芯片使用的邏輯電平,這些芯片是由一個單一的+5V電源供電,信號電平以接地電平作為參考。</p><p> 對于TTL邏輯,一個邏輯低輸入不高于0.8V。一個邏輯高輸出必須至少為2.4V,而一
18、個邏輯高輸入必須至少為2V。利用這些邏輯電平,一個接口可以有0.4V的噪聲信號而不至于產(chǎn)生錯誤。</p><p> 這些邏輯電平應(yīng)用在初期的,標準的7400系列的TTL邏輯和他的派生系列,包括74LS74F和74ALS TTL。較早的利用NMOS技術(shù)制造的微控制器也使用這些邏輯電平。</p><p> 大多數(shù)的CMOS芯片定義了不同的邏輯電平,并且有更寬的噪聲容限。一個邏輯低CMOS輸
19、出不高于0.1V,而一個邏輯低輸入可以高達20%的電源電壓,或者對于5V的電源輸入可以達到1V。一個邏輯高輸出至少為4.9V,而一個邏輯高輸入必須至少達到電源電壓的70%,或者對于5V電源輸入而言達到3.5V。使用這樣的邏輯電平的系列包括4000系列,74HC和74AC。</p><p> 有的CMOS芯片有TTL兼容輸出。這是得他們可以直接和CMOS或者TTL邏輯項鏈。遵循這個慣例的芯片包括74HCT邏輯系列
20、和大多數(shù)的微控制器。</p><p> RS-232 Interface</p><p> RS-232 is one of the normally used interfaces at any time, it not only built in every PC-set, but also built in any types of computers which are fro
21、m microcontroller to host computers, and equipment connected with them. The general usage of RS-232 is to connect a modern, the other arrangements with RS-232 interfaces include printer, data collection module, testing d
22、evice and control loop. RS-232 can be also used in the simple link of any type of computer.</p><p> RS-232 is designed to deal with the communication between two arrangements with distance limitation from 5
23、0 to 100ft, which depend on Potter rate and type of electric cable. Because of wide application of RS-232 port, its other usage is to link another type of adapter converted form the port.</p><p> For exampl
24、e, a simple loop changes a RS-232 into a RS-485 port. The port can be link with several devices by means of a long lead. Non-equilibrium lead is used to linked to RS-232. Although non-equilibrium should something avoidab
25、le, it only refers to the electric property of the signal in lead. In a non-equilibrium lead, signal voltage is applied to another lead, all has another technical term “signal end”.</p><p> Advantages in RS
26、-232</p><p> RS-232 is used everywhere. Every PC-set has one or more RS-232 ports. The renewed computers sustain other serial interfaces like USB. But RS-232 can do many things which USB can’t do.</p>
27、<p> In the micro-controller interface chip can be easily used to change into RS-232.</p><p> The jointing distance can reach 50-100ft. Many external interfaces are not used for too long distance. T
28、he longest distance joint of USB can reach 16ft. The distance between parallel printer interface on the PC-set and the host computer can reach 10 to 15ft, or 30ft by using Type TEEE-1284B driver. But RS-232 can use the l
29、onger electric cable.</p><p> If every RS-232 port is linked with a modern, Telephone network can used to send data in the rage of the world.</p><p> For a double link, 3 leads are needed. A p
30、arallel circuit generally needs 8 data lines, two or more control signal lines and ground wires。It is more expensive if more leads and bigger connectors are used.</p><p> Disadvantages in RS-232</p>
31、<p> If one side of link needs parallel data, it has to transform serial into parallel data. But if it is easily realized a UART is used.</p><p> Because of the serial port so useful, it is maybe hard
32、er to look for a free serial port PC-set may have many serial ports, but a system maybe can’t distribute a sole breaking enquiring signal to every serial port. Most micro-controller only has one hardware serial port.<
33、/p><p> No more than 2 set in one link.</p><p> The biggest designated transmitting rate of data is 2000bits/s.But many interface chip can surpass this numerical value, especially in the short di
34、stance link.</p><p> A longer link needs a different interface.</p><p> 3 basic signals of the double RS-232 communication as follows:</p><p> TD. Transform data DTE to DCE It’s
35、also called TX and TXD.</p><p> RD. Transform data DCE to DTE It’s also called RX and RXD.</p><p> SG. Signal land. It’s also called GND and SGND.</p><p><b> Voltage</b&
36、gt;</p><p> Logic0 is a positive RS-232 voltage, the logic electric level of RS-232 is indicated with positive-negative, and not only use the positive voltage signal of the 5VTTL and CMOS logic to indicate.
37、 In the data logger(TD)of RS-232,a logic0 is defined equal to or higher than +5V, and a Logic1 defined equal to -5V or lower than -5V. In another word, signal use the negative logic, in this logic, the negative voltage i
38、s Logic1.</p><p> Control signal uses the same voltage, but it uses positive logic. A positive voltage indicates this function is on and a negative voltage indicates this function is off.</p><p&g
39、t; RS-232 interface chip transform these signals in reverse. In output pin of one UART, A logic1 datum or a off control signal is close to 5V, it produces negative voltage on the interface of RS-232.A logic0 datum or an
40、 on-control signal is close to 0V, it produces a positive voltage on the interface of RS-232.Because of the RS-232 receptor maybe at the end of a long electrical cable, when the signal reaches the receiver, it’s voltage
41、is probably weaker or with the noise signal. In consideration of</p><p> An input higher than +3V on the RD are a Logic0, or on a control input is open. An input lower than -3V on the RD are a Logic1, or on
42、 a control input is off. According to this standard, input logic electrical level between -3V and +3V have no definition</p><p> Noise tolerable limitation or voltage tolerable limitation is difference outp
43、ut voltage and input voltage. The big voltage undulation from RS-232 lead to a noise tolerable limitation wider than logic5TTL. For example, even thought a output from RS-232 driver is the smallest +5V,it’s also be weake
44、n in the receiver or the noise peak rise to 2V, and still is a effective Logic0.Many outputs from RS-232 have the wider voltage undulation : ±9V and ±12V are very common affairs. All these affairs can le</p&
45、gt;<p> The other two technical terms concern with RS-232 to be used is Mark and Space. Space is Logic0 and Mark is Logic1. These two technical terms which was used by the machine recording instrument to record b
46、inary data in many years ago, each of them are representation physical and blank.</p><p> Clocking Limitation:</p><p> TIA/EIA-232 including smallest and biggest clocking stipulate. All out th
47、e RS-232 interface chips all accord this stipulate.</p><p> Appointed revolving speed limited the biggest Potter rate of interface.</p><p> The revolving rate is measure to the rate of speed c
48、hange when output cut-over voltage, and describe the change of instantaneous velocity in The advantage in limited the revolving is for improve signal quality by in the matter of fact to limited the problem which is due t
49、o voltage deflection, voltage deflection occur the signal in the long distance link which has high-speed rise and descend. There more detailed narrations to this problem are in capter10.</p><p> But revolvi
50、ng velocity also limited to the biggest speed of a link. Under speed of 30V/μs, a output need 0.3 μs to cut-over time in 166 times.</p><p> Actually, because the UART to read input data in near the middle o
51、f the digit, and also because many time’s consult clock in very accurate, usually can may use the digit width for cut-over time as short 5 to 10 time safety. Considered these conditions, some interface chips permitting 1
52、15kbps or more higher Potter rate, even though its infringe the suggestion this standard.</p><p> Except for has a biggest cut-over velocity, RS-232 driver also must according the lowest standard to ensure
53、the signal no stopover in the undefined area between the logical condition. To control signal other 40bps and the lower signal. Signal lines must spend time not surpass 1μs in the transmit area between the effective Logi
54、c1 and Logic0.To other data and time signal this limitation place wide is 4% or under 20 bps is 2μs. Frequencies of signal rise and descend also probably close to be equal.</p><p> Transformation between 5V
55、 logical and RS-232</p><p> Many micro-controllers have asynchronous serial ports, but their input and output rather to use 5V logic than to RS-232 voltage. To link 5V logic to a RS-232 port need to transfo
56、rm into RS-232 electrical level and transform from RS-232 electrical level into 5V logic</p><p> To use of 5V logic, I supposed to the use of electrical level of TTL or CMOS logic chips, these chips are sup
57、ply electricity by a single +5V electrical, signal electrical level refer to grounding electrical level. Tables 6-2 indicate this. I also supposed to positive logic, in here, the logical high electric level is logic1.<
58、;/p><p> To TTL logic, a logical low output must below 0.4V, a logical low input must below 0.8V. A logical high output must be 2.4V at least and a logical high input must be 2V at least. To use of these logic
59、al electrical levels, an interface may have noise signal at 0.4V and not necessarily to make mistake.</p><p> These logical electrical levels are used into TTL logic of early days standard 7400 series and o
60、ther drivers series, including 74LS 74F and 74AL STTL. The NMOS technology early is used to make micro---controllers also use these helical electrical levels.</p><p> Most CMOS chips definite different logi
61、cal electrical levels and have wider noise tolerable. A logical low CMOS output below 0.1V and logical low input may higher to 20% electrical voltage, or to electrical voltage in 5V can reach to 1V. A logical high output
62、 to be 4.9V at least and logical high input must reach to electronically voltage’s 70% at least, or to 5V electrical input reach to 3.5V. To use of this series of logical electrical level, including 4000 series, 74HC and
63、 74AC logic. </p><p> Some of CMOS chips have TTL compatible input and CMOS compatible output. Its make them can link with CMOS or TTL logic directly. The chips of follow to this usual practice including
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 串行通信設(shè)計外文翻譯--基于rs-232的串行通信設(shè)計
- 外文翻譯中英對照--基于rs-232的串行通信
- usb接口與rs-232比較研究
- usb轉(zhuǎn)rs―232串行適配器的設(shè)計
- 實驗二rs-232串口通信實驗
- 12864串行接口程序
- 外文翻譯--- max232-5v的供電,多通道rs-232接口驅(qū)動器接收器
- 基于fpga的rs-232串口通訊邏輯設(shè)計
- RS-232和USB設(shè)備的以太網(wǎng)接口研究.pdf
- can總線與rs-232轉(zhuǎn)換接口電路設(shè)計
- can總線與rs-232轉(zhuǎn)換接口電路設(shè)計
- can總線與rs-232轉(zhuǎn)換接口電路設(shè)計
- can總線與rs-232轉(zhuǎn)換接口電路設(shè)計
- rs232串聯(lián)接口的通訊程序設(shè)計
- rs232串聯(lián)接口的通訊程序論文
- 15.0串行外設(shè)接口(s12spiv5)
- RS-232串口無線通信與旋轉(zhuǎn)刺激臺控制系統(tǒng)設(shè)計.pdf
- 串行通訊原理說明--rs232uart
- RS232串口程序.rar
- RS232串口程序.rar
評論
0/150
提交評論