200928764 九、發明說明: 【發明所屬之技術領域】 本發明係關一種通訊電路,尤指一種主從設備之間之 通訊電路。 【先前技術】 串列介面是電腦設備或其他電子設備中最常應用之一 種通訊介面,其又可分為多種介面標準,如RS232介面、 RS484介面等。 ❹_串列週邊设備之間進行通訊時,要求通訊雙方都採用 同個介面標準,從而使不同之設備可以方便地連接起來 進行通訊。惟,這種通訊方式一次只能實現兩個設備一對 一=串列通訊,若一個主設備要與多個從設備通訊時,則 需刀別進行連接才能實現,而無法實現設備之間一對多之 交替通訊。 【發明内容】 鑒於以上内容,有必要提供一種多通道主從設備通訊 電路,以實現主從設備之間一對多之通訊。 一種多通道主從設備通訊電路,包括一主設備、複數 從設備及-多工器,每一主設備及從設備均包括一串列介 ^ °又備之串列介面之傳輸引腳及接收引腳分別與該 多工器之兩個資料輸入引腳相連,該主設備之串列介面^ 接地引腳與該多工器之接地引腳相連,該主設備之串列介 面之傳輸引腳及傳輸控制引腳中之至少一個引腳與該多工 器之電源引腳相連,該多工器之每兩資料輪出端分別與一 200928764 從設備之串列介面之接收引腳及体輸引腳相連。 相較習知技術,該主設備透過該多工器與該等從設備 - 連接’並輸出對應之選通訊號控制該多工器選通對應之從 .設備與主設備之間進行通訊,從而實現了主從設備之間一 對多之通訊,方便了用戶,提高了工作效率。並且,該多 工器疋直接透過該主設備之引腳k供電源,不需外接甘他 電源,結構簡單,同時也節省了成本。 【實施方式】 ❹ 凊參考圖1’本發明多通道主從設備通訊電路之較佳 實施方式包括一主設備1〇(如一祠服器)、四個從設備2〇、 30、40及50(如不間斷電源系統)、一多工器(111111邱1以% MUX ) 60及一供電電路70。本實施方式以四個從設備舉 例加以說明,也可以根據需要增加或減少從設備之數量。 該主設備10包括一串列介面12,該從設備2〇、3〇、 40及50分別包括一串列介面22、一串列介面32、一串列200928764 IX. Description of the Invention: [Technical Field] The present invention relates to a communication circuit, and more particularly to a communication circuit between a master and slave device. [Prior Art] The serial interface is one of the most commonly used communication interfaces in computer equipment or other electronic devices, and can be divided into various interface standards, such as RS232 interface and RS484 interface. ❹_Communication between serial devices requires that both parties use the same interface standard, so that different devices can be easily connected for communication. However, this communication method can only realize one-to-one communication of two devices at a time = serial communication. If a master device needs to communicate with multiple slave devices, it is necessary to connect the devices to achieve the same, and it is impossible to implement a device between the devices. More than one alternate communication. SUMMARY OF THE INVENTION In view of the above, it is necessary to provide a multi-channel master-slave device communication circuit to realize one-to-many communication between master and slave devices. A multi-channel master-slave device communication circuit includes a master device, a plurality of slave devices, and a multiplexer, each master device and the slave device including a serial port and a serial interface transmission pin and receiving The pins are respectively connected to two data input pins of the multiplexer, and the serial interface of the master device is connected to the ground pin of the multiplexer, and the serial interface of the master device is transmitted. And at least one pin of the transfer control pin is connected to the power pin of the multiplexer, and each of the data wheel outputs of the multiplexer and the receive pin and the body of the serial interface of the 200928764 slave device respectively Pins are connected. Compared with the prior art, the master device communicates with the slave devices through the multiplexer and outputs a corresponding selected communication number to control communication between the device and the master device corresponding to the multiplexer strobe, thereby Achieve one-to-many communication between the master and slave devices, which is convenient for the user and improves work efficiency. Moreover, the multiplexer directly supplies power through the pin k of the main device, and does not need an external power supply, and has a simple structure and also saves cost. [Embodiment] Referring to FIG. 1 'The preferred embodiment of the multi-channel master-slave communication circuit of the present invention includes a master device (such as a server), four slave devices 2, 30, 40, and 50 ( For example, an uninterruptible power supply system, a multiplexer (111111 1st in % MUX) 60 and a power supply circuit 70. This embodiment is described by four slave devices, and the number of slave devices can be increased or decreased as needed. The main device 10 includes a serial interface 12, and the slave devices 2, 3, 40, and 50 respectively include a serial interface 22, a serial interface 32, and a serial array.
引腳RXD,故 30、40及50之串列介面只應用了該傳輸引 引腳RXD,故圖中未示出其他引腳。 200928764 該主設備10之串列介面12之傳輸引腳TXlS及接收引 腳RXD分別與該多工器60之兩個資料輸入引腳Ρ1及Ρ2 - 相連,該串列介面12之兩傳輸控制引腳TDR及RTS分別 .與該多工器60之兩個通道選擇引腳CS1及CS2相連,該 串列介面12之傳輸引腳TXD、兩傳.輸控制引腳TDR及 RTS、接地引腳GND分別連接到該供電電路40之四個輸 入端,該供電電路40之兩輸出端分別與該多工器60之電 源引腳VCC及接地引腳GND相連。該多工器60之兩資 ❹料輸出端Ρ11及Ρ12分別與該從設備20之串列介面22之 接收引腳RXD及傳輸引腳TXD相連,該多工器60之兩資 料輸出端Ρ21及Ρ22分別與該從設備30之串列介面32之 接收引腳RXD及傳輸引腳TXD相連,該多工器60之兩資 料輸出端Ρ31及Ρ32分別與該從設備40之串列介面42之 接收引腳RXD及傳輸引腳TXD相連,該多工器60之兩資 料輸出端Ρ41及Ρ42分別與該從設備50之串列介面52之 接收引腳RXD及傳輸引腳TXD相連。 ® 請繼續參考圖2,該供電電路70包括一蓄電電容C及 三個二極體Dl、D2、D3,該等二極體Dl、D2、D3之陽 極分別連接到該串列介面12之傳輸引腳TXD、兩傳輸控 制引腳TDR及RTS,陰極相連後連接到該多工器60之電 源引腳VCC。該串列介面12之接地引腳GND透過該供電 電路70與該多工器60之接地引腳GND相連,該二極體 Dl、D2、D3之陰極與該串列介面12之接地引腳GND和 該多工器60之接地引腳GND之間之節點之間還串接該蓄 200928764 電電容c。 當該主設備10及從設備20、30、40、50工作時,由 於該串列介面12之傳輸引腳TXD、兩傳輸控制引腳TDR . 及RTS同一時刻有一個或多個引腳輸出高電平且該多工器 60之工作電壓極低,故可透過該供電.電路70提供電壓給 該多工器60使其工作,該供電電路70中之二極體D1、 D2、D3可防止該串列介面12之傳輸引腳TXD、兩傳輸控 制引腳TDR及RTS輸出之訊號之間相互干擾,當該串列 ❹介面12只有一個引腳連接到該供電電路70之輸入端時, 可省掉上述二極體。該供電電路70中之蓄電電容C產生 供電能量緩衝之作用,即使當該串列介面12之傳輸引腳 TXD、兩傳輸控制引腳TDR及RTS同一時刻均輸出低電 平,也可利用上一次產生高電平時儲存之電能為該多工器 60供電,以使該多工器60時刻保持工作狀態。也可應用 該主設備10之串列介面12之一個引腳輸出一始終為高電 平之訊號給該供電電路70,這樣可省掉該蓄電電容C。 當該主設備10需要與從設備20進行通訊時,該主設 備10則透過該串列介面12之兩傳輸控制引腳TDR及RTS 發送一對應之通道選擇訊號給該多工器60之通道選擇引 腳CS1及CS2,此時該多工器60控制該資料輸入引腳P1 及P2分別對應與該兩資料輸出引腳P11及P12導通,使 該主設備10之串列介面12之傳輸引腳TXD及接收引腳 RXD與該從設備20之串列介面22之接收引腳RXD及傳 輸引腳TXD對應相連,從而實現了該主設備10與從設備 200928764 20之間之通訊,同時其他從設備30、40、50不能干擾該 主設備10與從設備20之間之通訊。 , 同理,當該主設備10需要與另一從設備30或40或 .50進行通訊時,該主設備10則透過該串列介面12之兩傳 輸控制引腳TDR及RTS發送一對應之通道選擇訊號給該 多工器60之通道選擇引腳CS1及CS2,即可實現該主設 備10與從設備30或40或50之間之通訊。本實施方式中, 該兩傳輸控制引腳TDR及RTS發送一對應之通道選擇訊 ❹號與該等從設備20、30、40、50之對應關係如下表: 從設備 TDR RTS 從設備20 0 0 從設備30 0 1 從設備40 1 0 從設備50 1 1 其中,“ 0 ”代表低電位,“ 1”代表高電位, “TDR” 、“ RTS”分別表示傳輸控制引腳TDR及RTS所 發送之資料訊號,上述對應關係可根據設計者之思路任意 變換,不拘泥於本實施方式之對應關係。 本發明多通道主從設備通訊電路可實現主從設備之間 一對多之通訊,方便了用戶,提高了工作效率。另外,該 多工器60之供電方式由主設備10直接供電,不需外接其 他電源,結構簡單,同時也節省了成本。 200928764 々上所述,本發明符合發明 利申請。•’以上所述者僅為本發明::二依法“專 凡熟悉本案技藝之人士,在要=之較佳實施方式’舉 .,, 在菱依本發明精神所作$ $ < & ,或變化,皆應涵蓋於以下之申請專利範圍内。> 【圖式簡單說明】 ® π 圖1係本發明多通道主從設備通訊 之電路原理框圖。 住貫鉍方式 ❹ 圖2係圖1中供電電路之電路圖。 【主要元件符號說明】 主設備 10 供電電路 70 從設備 20 % 串列介面 12、 二極體 D1、 多 工器 60 蓄 電電. 容 C 30、 40、 50 22、 32 > 42、52 D2 、D3Pin RXD, so the serial interface of 30, 40 and 50 only applies the transfer pin RXD, so other pins are not shown in the figure. 200928764 The transmission pin TX1S and the receiving pin RXD of the serial interface 12 of the master device 10 are respectively connected to two data input pins Ρ1 and Ρ2 - of the multiplexer 60, and the two transmission control leads of the serial interface 12 The legs TDR and RTS are respectively connected to the two channel selection pins CS1 and CS2 of the multiplexer 60. The transmission pin TXD of the serial interface 12, the two transmission control pins TDR and RTS, and the ground pin GND Connected to the four input terminals of the power supply circuit 40, the two output ends of the power supply circuit 40 are respectively connected to the power pin VCC and the ground pin GND of the multiplexer 60. The two output terminals Ρ11 and Ρ12 of the multiplexer 60 are respectively connected to the receiving pin RXD and the transmission pin TXD of the serial interface 22 of the slave device 20, and the two data output terminals Ρ21 of the multiplexer 60 and The Ρ22 is respectively connected to the receiving pin RXD and the transmitting pin TXD of the serial interface 32 of the slave device 30, and the two data output terminals Ρ31 and Ρ32 of the multiplexer 60 are respectively received from the serial interface 42 of the slave device 40. The pin RXD is connected to the transmission pin TXD. The two data output terminals Ρ41 and Ρ42 of the multiplexer 60 are respectively connected to the receiving pin RXD and the transmission pin TXD of the serial interface 52 of the slave device 50. Continuing to refer to FIG. 2, the power supply circuit 70 includes a storage capacitor C and three diodes D1, D2, and D3. The anodes of the diodes D1, D2, and D3 are respectively connected to the serial interface 12 for transmission. The pin TXD, the two transmission control pins TDR and RTS are connected to the power supply pin VCC of the multiplexer 60 after being connected to the cathode. The grounding pin GND of the serial interface 12 is connected to the grounding pin GND of the multiplexer 60 through the power supply circuit 70. The cathode of the diodes D1, D2, and D3 and the grounding pin GND of the serial interface 12 The capacitor 200928764 is also connected in series with the node between the ground pin GND of the multiplexer 60. When the master device 10 and the slave devices 20, 30, 40, 50 operate, since the transmission pin TXD of the serial interface 12, the two transmission control pins TDR. and the RTS have one or more pin outputs at the same time The level and the operating voltage of the multiplexer 60 are extremely low, so that the power supply can be supplied to the multiplexer 60 through the power supply. The diodes D1, D2, and D3 in the power supply circuit 70 can be prevented. The signal of the transmission pin TXD of the serial interface 12, the signals of the two transmission control pins TDR and the RTS interfere with each other, and when only one pin of the serial port interface 12 is connected to the input end of the power supply circuit 70, The above diodes are eliminated. The storage capacitor C in the power supply circuit 70 generates a power supply energy buffer. Even when the transmission pin TXD of the serial interface 12 and the two transmission control pins TDR and RTS output a low level at the same time, the last time can be utilized. The stored electrical energy when the high level is generated supplies power to the multiplexer 60 to keep the multiplexer 60 in operation at all times. A pin of the serial interface 12 of the master device 10 can also be used to output a signal that is always high to the power supply circuit 70, so that the storage capacitor C can be omitted. When the master device 10 needs to communicate with the slave device 20, the master device 10 sends a corresponding channel selection signal to the channel selection of the multiplexer 60 through the two transmission control pins TDR and RTS of the serial interface 12. Pins CS1 and CS2, at this time, the multiplexer 60 controls the data input pins P1 and P2 to be respectively connected to the two data output pins P11 and P12, so that the serial device 12 of the host device 10 has a transmission pin. The TXD and the receiving pin RXD are connected to the receiving pin RXD and the transmitting pin TXD of the serial interface 22 of the slave device 20, thereby realizing communication between the master device 10 and the slave device 200928764 20, and other slave devices. 30, 40, 50 cannot interfere with communication between the master device 10 and the slave device 20. Similarly, when the master device 10 needs to communicate with another slave device 30 or 40 or .50, the master device 10 transmits a corresponding channel through the two transmission control pins TDR and RTS of the serial interface 12 Communication between the master device 10 and the slave device 30 or 40 or 50 can be accomplished by selecting signals for the channel select pins CS1 and CS2 of the multiplexer 60. In this embodiment, the correspondence between the two transmission control pins TDR and RTS transmitting a corresponding channel selection signal and the slave devices 20, 30, 40, 50 is as follows: slave device TDR RTS slave device 20 0 0 Slave device 30 0 1 Slave device 40 1 0 Slave device 50 1 1 where “0” represents low potential, “1” represents high potential, “TDR” and “RTS” represent transmission control pins TDR and RTS respectively The data signal, the above correspondence can be arbitrarily changed according to the designer's idea, and is not limited to the corresponding relationship of the embodiment. The multi-channel master-slave device communication circuit of the invention can realize one-to-many communication between the master and slave devices, which is convenient for the user and improves the work efficiency. In addition, the power supply mode of the multiplexer 60 is directly powered by the main device 10, and no external power supply is required, and the structure is simple, and the cost is also saved. 200928764 In summary, the present invention is in accordance with the invention. • 'The above is only the invention:: 2 according to the law, "the person who is familiar with the skill of the case, in the preferred embodiment of the method", in the spirit of the spirit of the invention made by $ $ <& Or the changes should be covered in the following patent application. > [Simple description of the diagram] ® π Figure 1 is a circuit block diagram of the communication of the multi-channel master-slave device of the present invention. Circuit diagram of the power supply circuit in 1. [Main component symbol description] Main device 10 Power supply circuit 70 Slave device 20% serial interface 12, diode D1, multiplexer 60 storage power. Capacity C 30, 40, 50 22, 32 > 42, 52 D2, D3