[go: up one dir, main page]

TWI703441B - Pin multiplexer and method for controlling pin multiplexer - Google Patents

Pin multiplexer and method for controlling pin multiplexer Download PDF

Info

Publication number
TWI703441B
TWI703441B TW108110484A TW108110484A TWI703441B TW I703441 B TWI703441 B TW I703441B TW 108110484 A TW108110484 A TW 108110484A TW 108110484 A TW108110484 A TW 108110484A TW I703441 B TWI703441 B TW I703441B
Authority
TW
Taiwan
Prior art keywords
port
circuit
pins
mode
multiplexing
Prior art date
Application number
TW108110484A
Other languages
Chinese (zh)
Other versions
TW202036304A (en
Inventor
童力
彭作輝
Original Assignee
瑞昱半導體股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 瑞昱半導體股份有限公司 filed Critical 瑞昱半導體股份有限公司
Priority to TW108110484A priority Critical patent/TWI703441B/en
Priority to US16/812,362 priority patent/US11249931B2/en
Application granted granted Critical
Publication of TWI703441B publication Critical patent/TWI703441B/en
Publication of TW202036304A publication Critical patent/TW202036304A/en

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

The present invention provides a pin multiplexer including a multiplexing circuit, a control circuit and a detecting circuit. The multiplexing circuit includes a first port, a second port and a third port, wherein the first port, the second port and the third port are coupled to a first device, a second device and a third device, respectively. The control circuit is configured to control the multiplexing circuit to operate in a first mode or a second mode, wherein when the multiplexing circuit operates in the first mode, the first port is coupled the second port; and when the multiplexing circuit operates in the second mode, the first port is coupled to the third port. When the multiplexing circuit operates in the second mode, the detecting circuit detects signals corresponding to the first port to generate a detection result, and the detection result is used to dynamically switch the data transmission direction during the data communication between the third device and the first device.

Description

引腳複用裝置以及控制引腳複用裝置的方法 Pin multiplexing device and method for controlling pin multiplexing device

本發明係有關於引腳複用裝置。 The invention relates to a pin multiplexing device.

在晶片設計中,為了讓有限的引腳盡可能有最多的功能,通常會使用引腳複用裝置以切換引腳的功能。然而,目前的引腳複用裝置都是在訊號開始傳輸之前就將引腳的功能切換設定好,但如此一來由於在訊號傳輸過程中無法對引腳功能作切換,因此無法適用於雙向資料傳輸等比較複雜的傳輸行為。此外,若是要適用於雙向資料傳輸等比較複雜的傳輸行為,則可能需要設置一些專用引腳,而增加了製造成本。 In chip design, in order to allow the limited pins to have the most functions as possible, a pin multiplexing device is usually used to switch the functions of the pins. However, the current pin multiplexing device sets the function switch of the pin before the signal transmission starts. However, because the pin function cannot be switched during the signal transmission process, it is not suitable for bidirectional data. Complicated transmission behavior such as transmission. In addition, if it is suitable for more complex transmission behaviors such as two-way data transmission, it may be necessary to set up some dedicated pins, which increases the manufacturing cost.

因此,本發明的目的之一在於提供一種引腳複用裝置,其可以在兩個電子裝置進行資料傳輸的過程中動態地切換引腳功能以改變資料傳輸方向,以解決先前技術中的問題。 Therefore, one of the objectives of the present invention is to provide a pin multiplexing device, which can dynamically switch pin functions to change the data transmission direction during data transmission between two electronic devices, so as to solve the problems in the prior art.

在本發明的一個實施例中,揭露了一種引腳複用裝置,其包含有一多工電路、一控制電路以及一偵測電路。該多工電路,包含了一第一埠、一第 二埠以及一第三埠,其中該第一埠、該第二埠以及該第三埠均包含了多個引腳,且該第一埠、該第二埠以及該第三埠之該多個引腳係用來分別透過多個接點連接到一第一裝置、一第二裝置以及一第三裝置;該控制電路用以控制該多工電路操作在一第一模式或是一第二模式,其中當該多工電路操作在該第一模式時,該第一埠係連接到該第二埠;以及當該多工電路操作在該第二模式時,該第一埠係連接到該第三埠;以及當該多工電路操作在該第二模式時,該偵測電路透過偵測該第一埠之一部分引腳或是所連接之接點上的訊號,以在該第三裝置與該第一裝置進行資料傳輸的過程中動態地切換該第三裝置與該第一裝置的資料傳輸方向。 In an embodiment of the present invention, a pin multiplexing device is disclosed, which includes a multiplexing circuit, a control circuit, and a detection circuit. The multiplex circuit includes a first port, a second Two ports and a third port, wherein the first port, the second port, and the third port all include a plurality of pins, and the plurality of the first port, the second port and the third port The pins are used to connect to a first device, a second device, and a third device through a plurality of contacts; the control circuit is used to control the multiplex circuit to operate in a first mode or a second mode , Wherein when the multiplex circuit is operated in the first mode, the first port is connected to the second port; and when the multiplex circuit is operated in the second mode, the first port is connected to the second port Three ports; and when the multiplex circuit is operating in the second mode, the detection circuit detects signals on a part of the pins of the first port or the connected contacts to connect the third device with During the data transmission process of the first device, the data transmission direction of the third device and the first device is dynamically switched.

在本發明的另一個實施例中,揭露了一種控制一引腳複用裝置的方法,其中該引腳複用裝置包含了一多工電路,該多工電路包含了一第一埠、一第二埠以及一第三埠,其中該第一埠、該第二埠以及該第三埠均包含了多個引腳,且該第一埠、該第二埠以及該第三埠之該多個引腳係用來分別透過多個接點連接到一第一裝置、一第二裝置以及一第三裝置;以及該方法包含有:控制該多工電路操作在一第一模式或是一第二模式,其中當該多工電路操作在該第一模式時,該第一埠係連接到該第二埠;以及當該多工電路操作在該第二模式時,該第一埠係連接到該第三埠;以及當該多工電路操作在該第二模式時,透過偵測該第一埠之一部分引腳或是所連接之接點上的訊號,以在該第三裝置與該第一裝置進行資料傳輸的過程中動態地切換該第三裝置與該第一裝置的資料傳輸方向。 In another embodiment of the present invention, a method of controlling a pin multiplexing device is disclosed, wherein the pin multiplexing device includes a multiplexing circuit, and the multiplexing circuit includes a first port and a second port. Two ports and a third port, wherein the first port, the second port, and the third port all include a plurality of pins, and the plurality of the first port, the second port and the third port The pins are used to respectively connect to a first device, a second device, and a third device through a plurality of contacts; and the method includes: controlling the multiplex circuit to operate in a first mode or a second Mode, wherein when the multiplex circuit is operated in the first mode, the first port is connected to the second port; and when the multiplex circuit is operated in the second mode, the first port is connected to the The third port; and when the multiplex circuit is operating in the second mode, by detecting a part of the pin of the first port or the signal on the connected contact, the third device and the first During the data transmission process of the device, the data transmission direction of the third device and the first device is dynamically switched.

100:引腳複用裝置 100: Pin multiplexing device

110:多工電路 110: Multiplex circuit

111:第一埠 111: First Port

112:第二埠 112: second port

113:第三埠 113: Third Port

114:第四埠 114: Port 4

115_1~115_N、116_1~116_N:引腳 115_1~115_N, 116_1~116_N: pin

120:控制電路 120: control circuit

130:偵測電路 130: detection circuit

140:暫存器 140: register

155_1~155_N、156_1~156_N:介面電路 155_1~155_N, 156_1~156_N: interface circuit

171:第一裝置 171: First Device

172:第二裝置 172: Second Device

173:第三裝置 173: Third Device

174:第四裝置 174: Fourth Device

210、220:緩衝器 210, 220: Buffer

230:接點 230: contact

400~414:步驟 400~414: Step

SPI_CSB:晶片選擇訊號 SPI_CSB: Chip selection signal

SPI_CLK:時脈訊號 SPI_CLK: clock signal

SPI_D0、SPI_D1、SPI_D2、SPI_D3:資料訊號 SPI_D0, SPI_D1, SPI_D2, SPI_D3: data signal

V1、V2:訊號 V1, V2: signal

Vc、Vc’:控制訊號 Vc, Vc’: control signal

V_en:致能訊號 V_en: Enabling signal

V_mode:模式控制訊號 V_mode: Mode control signal

第1圖為根據本發明一實施例之引腳複用裝置的示意圖。 Figure 1 is a schematic diagram of a pin multiplexing device according to an embodiment of the invention.

第2圖繪示了根據本發明一實施例之一介面電路的示意圖。 Figure 2 shows a schematic diagram of an interface circuit according to an embodiment of the invention.

第3圖為時脈訊號、晶片選擇訊號以及四個資料訊號的時序圖。 Figure 3 is a timing diagram of the clock signal, chip selection signal, and four data signals.

第4圖為根據本發明一實施例之控制一引腳複用裝置的方法的流程圖。 Fig. 4 is a flowchart of a method of controlling a pin multiplexing device according to an embodiment of the present invention.

第1圖為根據本發明一實施例之引腳複用裝置100的示意圖。如第1圖所示,引腳複用裝置100包含了一多工電路110、一控制電路120、一偵測電路130以及一暫存器140,其中多工電路110包含了一第一埠111、一第二埠112、一第三埠113以及一第四埠114,且第一埠111、第二埠112、第三埠113以及第四埠114均包含了多個引腳(pin),例如圖示之第一埠111所包含的引腳115_1~115_N,以及第三埠113所包含的引腳116_1~116_N。 FIG. 1 is a schematic diagram of a pin multiplexing device 100 according to an embodiment of the invention. As shown in Figure 1, the pin multiplexing device 100 includes a multiplexing circuit 110, a control circuit 120, a detection circuit 130, and a register 140. The multiplexing circuit 110 includes a first port 111 , A second port 112, a third port 113, and a fourth port 114, and the first port 111, the second port 112, the third port 113, and the fourth port 114 all include multiple pins, For example, the illustrated first port 111 includes pins 115_1 to 115_N, and the third port 113 includes pins 116_1 to 116_N.

引腳複用裝置100中的第一埠111、第二埠112、第三埠113以及第四埠114係分別用來連接至一第一裝置171、一第二裝置172、一第三裝置173以及一第四裝置174,例如第一埠111之引腳115_1~115_N可以透過介面電路155_1~155_N連接到第一裝置171,且第三埠113之引腳116_1~116_N可以透過介面電路156_1~156_N連接到第三裝置173,以供上述裝置之間的資料傳輸,其中介面電路155_1~155_N可以包含了收發電路以及接點(pad)。在一實施例中,多工電路110可以操作在一第一模式以及一第二模式,其中當多工電路110操作在該第一模式時,第一埠111係連接至第二埠112以供第一裝置171與第二裝置172進行通訊,且第三埠113係連接至第四埠114以供第三裝置173與第四裝置174進行通訊;另一方面,當多工電路110操作在該第二模式時,第一埠111係連接至第三埠113以供第一裝置171與第三裝置173進行通訊,而此時第二埠112以及第四埠114 可以不需要進行任何操作,亦即第二裝置172以及第四裝置174此時不會透過引腳複用裝置100進行通訊。 The first port 111, the second port 112, the third port 113, and the fourth port 114 in the pin multiplexing device 100 are used to connect to a first device 171, a second device 172, and a third device 173, respectively. And a fourth device 174, for example, the pins 115_1~115_N of the first port 111 can be connected to the first device 171 through the interface circuit 155_1~155_N, and the pins 116_1~116_N of the third port 113 can be connected to the interface circuit 156_1~156_N It is connected to the third device 173 for data transmission between the above-mentioned devices. The interface circuits 155_1 to 155_N may include transceiver circuits and pads. In one embodiment, the multiplex circuit 110 can operate in a first mode and a second mode. When the multiplex circuit 110 operates in the first mode, the first port 111 is connected to the second port 112 for The first device 171 communicates with the second device 172, and the third port 113 is connected to the fourth port 114 for the third device 173 to communicate with the fourth device 174; on the other hand, when the multiplex circuit 110 operates in the In the second mode, the first port 111 is connected to the third port 113 for the first device 171 to communicate with the third device 173, and at this time the second port 112 and the fourth port 114 No operation is required, that is, the second device 172 and the fourth device 174 will not communicate through the pin multiplexing device 100 at this time.

具體來說,引腳複用裝置100可以透過使用者的控制或是其他控制方式,以使得控制電路120產生一模式控制訊號V_mode至多工電路110,以使得多工電路110操作在該第一模式或是該第二模式。當該多工電路110操作在該第一模式時,由於第一埠111係連接至第二埠112,且第三埠113係連接至第四埠114,故第一裝置171可以透過引腳複用裝置100來與第二裝置172進行資料傳輸,且第三裝置173可以透過引腳複用裝置100來與第四裝置174進行資料傳輸;此外,在該第二模式中,由於第一埠111係連接至第三埠113,故第一裝置171可以透過引腳複用裝置100來與第三裝置173進行資料傳輸;此外,在該第二模式中,多工電路110會產生一致能訊號V_en至偵測電路130以使得偵測電路130自暫存器140載入組態資料並進行組態,且開始偵測第一埠111之至少一部份引腳或是對應之介面電路上的訊號(第1圖僅繪示了偵測引腳115_N的訊號,但此並非是本發明的限制),以在第一裝置171與第三裝置173進行資料傳輸的過程中動態地切換第三裝置173與第一裝置171的資料傳輸方向。舉例來說,假設在該第二模式的一開始時第三裝置173係透過引腳複用裝置100傳送資料至第一裝置171,則此時偵測電路130可以持續偵測第一埠111之至少一部份引腳上的訊號是否符合一特定型樣,並在判斷所偵測到之訊號符合該特定型樣時產生一控制訊號Vc至多工電路110,以控制/改變至少一部份的介面電路155_1~155_N的訊號傳輸方向,來使得第一裝置171可以直接地透過介面電路155_1~155_N以及引腳複用裝置100來將資料傳送至第三裝置173。 Specifically, the pin multiplexing device 100 can be controlled by the user or other control methods, so that the control circuit 120 generates a mode control signal V_mode to the multiplex circuit 110, so that the multiplex circuit 110 operates in the first mode Or the second mode. When the multiplex circuit 110 operates in the first mode, since the first port 111 is connected to the second port 112, and the third port 113 is connected to the fourth port 114, the first device 171 can be replicated through pins The device 100 is used for data transmission with the second device 172, and the third device 173 can transmit data with the fourth device 174 through the pin multiplexing device 100; in addition, in this second mode, since the first port 111 It is connected to the third port 113, so the first device 171 can transmit data with the third device 173 through the pin multiplexing device 100; in addition, in the second mode, the multiplexing circuit 110 will generate the unanimous signal V_en To the detection circuit 130 so that the detection circuit 130 loads the configuration data from the register 140 and performs configuration, and starts to detect at least a part of the pins of the first port 111 or the signal on the corresponding interface circuit (Figure 1 only shows the signal of the detection pin 115_N, but this is not a limitation of the present invention), so as to dynamically switch the third device 173 during data transmission between the first device 171 and the third device 173 Data transmission direction with the first device 171. For example, if the third device 173 transmits data to the first device 171 through the pin multiplexing device 100 at the beginning of the second mode, then the detection circuit 130 can continue to detect the first port 111 at this time. Whether the signal on at least part of the pin conforms to a specific pattern, and when it is determined that the detected signal conforms to the specific pattern, a control signal Vc is generated to the multiplex circuit 110 to control/change at least part of the The signal transmission direction of the interface circuits 155_1 to 155_N enables the first device 171 to directly transmit data to the third device 173 through the interface circuits 155_1 to 155_N and the pin multiplexing device 100.

第2圖繪示了根據本發明一實施例之一介面電路200的示意圖,其中 介面電路200可應用在介面電路155_1~155_N以及介面電路156_1~156_N中的至少一部分。如第2圖所示,介面電路200包含了作為收發電路的兩個緩衝器210、220以及一接點230,其中以介面電路155_N為例,接點230可以連接至第一裝置171,而兩個緩衝器210、220係可由多工電路110根據偵測電路130所輸出之控制訊號Vc來產生。詳細來說,在該第二模式的一開始時,多工電路110可以產生控制訊號Vc’來開啟緩衝器210並關閉緩衝器220,以使得第三裝置173透過引腳複用裝置100以及介面電路155_N中的緩衝器210以及接點230以將一訊號V1傳送至第一裝置171,且在偵測電路130判斷所偵測到之訊號符合該特定型樣而產生控制訊號Vc至多工電路110時,多工電路110可以產生控制訊號Vc’來關閉緩衝器210並開啟緩衝器220,以使得第三裝置173透過引腳複用裝置100以及介面電路155_N中的緩衝器220以及接點230以自第一裝置171接收一訊號V2。 Figure 2 shows a schematic diagram of an interface circuit 200 according to an embodiment of the present invention, where The interface circuit 200 can be applied to at least a part of the interface circuits 155_1 to 155_N and the interface circuits 156_1 to 156_N. As shown in Figure 2, the interface circuit 200 includes two buffers 210 and 220 as a transceiver circuit and a contact 230. Taking the interface circuit 155_N as an example, the contact 230 can be connected to the first device 171, and the two The two buffers 210 and 220 can be generated by the multiplex circuit 110 according to the control signal Vc output by the detection circuit 130. In detail, at the beginning of the second mode, the multiplexing circuit 110 can generate a control signal Vc' to turn on the buffer 210 and turn off the buffer 220, so that the third device 173 can pass through the pin multiplexing device 100 and the interface The buffer 210 and the contact 230 in the circuit 155_N transmit a signal V1 to the first device 171, and the detection circuit 130 determines that the detected signal conforms to the specific pattern and generates a control signal Vc to the multiplexing circuit 110 At this time, the multiplexing circuit 110 can generate a control signal Vc' to turn off the buffer 210 and turn on the buffer 220, so that the third device 173 passes through the pin multiplexing device 100 and the buffer 220 and the contact 230 in the interface circuit 155_N. A signal V2 is received from the first device 171.

透過以上實施例所述,由於引腳複用裝置100可以在訊號傳輸的過程中動態地切換訊號傳輸方向,且由於切換的時機點係由專門的硬體電路(亦即,偵測電路130)來控制,故對於進行訊號傳輸的兩個電子裝置而言可以認會引腳是由彼此所獨佔,因此可以支援傳輸協議比較複雜的訊號傳輸方式,且也有利於減少專用引腳的數量,以最大化地減少晶片引腳的數量並降低成本。 According to the above embodiments, the pin multiplexing device 100 can dynamically switch the signal transmission direction during the signal transmission process, and since the switching timing is determined by a dedicated hardware circuit (that is, the detection circuit 130) For the two electronic devices that perform signal transmission, it can be recognized that the pins are exclusively owned by each other. Therefore, it can support signal transmission methods with more complicated transmission protocols, and it is also helpful to reduce the number of dedicated pins. Minimize the number of chip pins and reduce costs.

在一實施例中,第一裝置171可以是一符合串列周邊介面(Serial Peripheral Interface,SPI)的快閃記憶體,第二裝置172可以是用來控制第一裝置171的一快閃記憶體控制器,第三裝置173係為一可插拔裝置,而第三裝置173可以為一記憶卡或是一編程器,而第四裝置174可以用來控制記憶卡的一記憶卡控制器。在本實施例中,第一埠111包含了對應到六個介面電路155_1~155_6的六個引腳115_1~115_6,且第三埠113包含了對應到六個介面電路156_1~156_6的六 個引腳116_1~116_6。 In one embodiment, the first device 171 may be a flash memory conforming to a serial peripheral interface (Serial Peripheral Interface, SPI), and the second device 172 may be a flash memory used to control the first device 171 For the controller, the third device 173 is a pluggable device, the third device 173 can be a memory card or a programmer, and the fourth device 174 can be used to control a memory card controller of the memory card. In this embodiment, the first port 111 includes six pins 115_1~115_6 corresponding to the six interface circuits 155_1~155_6, and the third port 113 includes six pins corresponding to the six interface circuits 156_1~156_6. One pin 116_1~116_6.

在此實施例中,當第三裝置173為一記憶卡時,控制電路120產生模式控制訊號V_mode(例如V_mode=0)以使得引腳複用裝置100操作在該第一模式,此時快閃記憶體控制器(亦即,第二裝置172)可以透過引腳複用裝置100的第二埠112與第一埠111來存取快閃記憶體(亦即,第一裝置171),且記憶卡控制器(亦即,第四裝置174)可以透過引腳複用裝置100的第四埠114與第三埠113來存取記憶卡(亦即,第三裝置173);在本實施例中,當第三裝置173為記憶卡且引腳複用裝置100操作在該第一模式時,第三埠113的六個引腳116_1~116_6的功能可以分別對應到一時脈訊號SD_CLK、一命令訊號SD_CMD以及四個資料訊號SD_D0、SD_D1、SD_D2、SD_D3,而由於本領域具有通常知識者應能輕易了解到這些訊號在記憶卡相關規格中的功能,故細節在此不再贅述。另外,當第三裝置173為一編程器時,控制電路120產生模式控制訊號V_mode(例如V_mode=1)以使得引腳複用裝置100操作在該第二模式,此時編程器(亦即,第三裝置173)可以透過引腳複用裝置100的第三埠113來存取快閃記憶體(亦即,第一裝置171);在本實施例中,當第三裝置173為編程器且引腳複用裝置100操作在該第二模式時,第三埠113的六個引腳116_1~116_6的功能可以分別對應到SPI協議中的一時脈訊號SPI_CLK、一晶片選擇訊號SPI_CSB以及四個資料訊號SPI_D0、SPI_D1、SPI_D2、SPI_D3,而由於本領域具有通常知識者應能輕易了解到這些訊號在SPI快閃記憶體存取時的功能,故細節在此不再贅述。 In this embodiment, when the third device 173 is a memory card, the control circuit 120 generates the mode control signal V_mode (for example, V_mode=0) to make the pin multiplexing device 100 operate in the first mode, and then flash The memory controller (ie, the second device 172) can access the flash memory (ie, the first device 171) through the second port 112 and the first port 111 of the pin multiplexing device 100, and the memory The card controller (ie, the fourth device 174) can access the memory card (ie, the third device 173) through the fourth port 114 and the third port 113 of the pin multiplexing device 100; in this embodiment When the third device 173 is a memory card and the pin multiplexing device 100 operates in the first mode, the functions of the six pins 116_1~116_6 of the third port 113 can correspond to a clock signal SD_CLK and a command signal respectively SD_CMD and the four data signals SD_D0, SD_D1, SD_D2, SD_D3, and since those with ordinary knowledge in the field should be able to easily understand the functions of these signals in the relevant specifications of the memory card, the details are not repeated here. In addition, when the third device 173 is a programmer, the control circuit 120 generates the mode control signal V_mode (for example, V_mode=1) to make the pin multiplexing device 100 operate in the second mode. At this time, the programmer (ie, The third device 173) can access the flash memory (that is, the first device 171) through the third port 113 of the pin multiplexing device 100; in this embodiment, when the third device 173 is a programmer and When the pin multiplexing device 100 operates in the second mode, the functions of the six pins 116_1 to 116_6 of the third port 113 can correspond to a clock signal SPI_CLK, a chip selection signal SPI_CSB and four data in the SPI protocol. Signals SPI_D0, SPI_D1, SPI_D2, SPI_D3, and since those with ordinary knowledge in the field should be able to easily understand the functions of these signals when accessing SPI flash memory, the details are not repeated here.

在本實施例中,當第三裝置173為編程器時,其可以對快閃記憶體(亦即,第一裝置171)快速地進行抹除、編程、校驗...等操作。 In this embodiment, when the third device 173 is a programmer, it can quickly erase, program, verify, etc., the flash memory (ie, the first device 171).

在本實施例中,當第三裝置173為編程器且引腳複用裝置100操作在該第二模式時,偵測電路130可以根據時脈訊號SPI_CLK以及晶片選擇訊號SPI_CSB來偵測資料訊號SPI_D0的資料型樣,以決定是否要切換編程器與快閃記憶體的傳輸方向。具體來說,參考第3圖所示之時脈訊號SPI_CLK、晶片選擇訊號SPI_CSB以及四個資料訊號SPI_D0、SPI_D1、SPI_D2、SPI_D3的時序圖。同時參考第1圖及第3圖,一開始引腳複用裝置100係控制介面電路155_1~155_6以及介面電路156_1~156_6以使得編程器傳送資料至快閃記憶體,而當偵測電路130偵測到在時脈訊號SPI_CLK的第0~7個週期收到如第3圖所示的快速讀取指令時(亦即,符合特定型樣),因此便可以判斷在時脈訊號SPI_CLK的第8~13個週期以及第14~19個週期分收到位址資訊以及冗餘資訊,且在時脈訊號SPI_CLK的第19個週期之後快閃記憶體會開始傳送資料至編程器。因此,偵測電路130可以在時脈訊號SPI_CLK的第19個週期時傳送控制訊號Vc至多工電路110,以使得多工電路110產生控制訊號Vc’以改變介面電路155_3~155_6以及介面電路156_3~156_6的傳輸方向,以使得快閃記憶體可以透過介面電路155_3~155_6以及第一埠111的引腳115_3~115_6以將資料訊號SPI_D0、SPI_D1、SPI_D2、SPI_D3傳送到編程器。另外,在讀取結束後,編程器可以切換晶片選擇訊號SPI_CSB的準位(例如,由“0”切換為“1”),而偵測電路130偵測到此一動作時便可以傳送控制訊號Vc至多工電路110以恢復原有的傳輸方向。 In this embodiment, when the third device 173 is a programmer and the pin multiplexing device 100 is operating in the second mode, the detection circuit 130 can detect the data signal SPI_D according to the clock signal SPI_CLK and the chip selection signal SPI_CSB. To decide whether to switch the transfer direction of the programmer and flash memory. Specifically, refer to the timing diagram of the clock signal SPI_CLK, the chip selection signal SPI_CSB, and the four data signals SPI_D0, SPI_D1, SPI_D2, and SPI_D3 shown in Figure 3. Referring to Figures 1 and 3 at the same time, the pin multiplexing device 100 initially controls the interface circuits 155_1~155_6 and the interface circuits 156_1~156_6 so that the programmer transmits data to the flash memory, and when the detection circuit 130 detects It is measured that when the fast read command shown in Figure 3 is received during the 0~7 cycle of the clock signal SPI_CLK (that is, it conforms to a specific pattern), it can be determined that the clock signal SPI_CLK is on the 8th ~13 cycles and 14~19 cycles receive address information and redundant information, and the flash memory will start to send data to the programmer after the 19th cycle of the clock signal SPI_CLK. Therefore, the detection circuit 130 can transmit the control signal Vc to the multiplexing circuit 110 in the 19th cycle of the clock signal SPI_CLK, so that the multiplexing circuit 110 generates the control signal Vc' to change the interface circuits 155_3~155_6 and the interface circuits 156_3~ 156_6 transfer direction, so that the flash memory can transmit the data signals SPI_D0, SPI_D1, SPI_D2, SPI_D3 to the programmer through the interface circuit 155_3~155_6 and the pins 115_3~115_6 of the first port 111. In addition, after the reading is completed, the programmer can switch the level of the chip selection signal SPI_CSB (for example, switch from "0" to "1"), and the detection circuit 130 can transmit the control signal when it detects this action Vc is applied to the multiplex circuit 110 to restore the original transmission direction.

在一實施例中,偵測電路130可以在偵測到如第3圖所示的快速讀取指令時便關閉對於資料訊號SPI_D0的偵測,並等到在讀取結束後編程器切換晶片選擇訊號SPI_CSB的準位後再開始偵測資料訊號SPI_D0,以防止SPI_D0上的訊號變化導致偵測電路130的誤動作。 In one embodiment, the detection circuit 130 can turn off the detection of the data signal SPI_D0 when the fast read command as shown in Figure 3 is detected, and wait until the programmer switches the chip selection signal after the read is completed After the level of SPI_CSB is set, the detection of the data signal SPI_D0 is started to prevent the signal change on SPI_D0 from causing the detection circuit 130 to malfunction.

第4圖為根據本發明一實施例之控制一引腳複用裝置的方法的流程圖。參考1~4圖及以上所揭露的內容,流程如下所述。 Fig. 4 is a flowchart of a method of controlling a pin multiplexing device according to an embodiment of the present invention. With reference to the contents disclosed in Figures 1 to 4 and above, the process is as follows.

步驟400:流程開始。 Step 400: The process starts.

步驟402:判斷模式控制訊號V_mode是否為“0”,若是則流程進入步驟404;反之則進入步驟406。 Step 402: Determine whether the mode control signal V_mode is “0”, if it is, then the process goes to step 404; otherwise, it goes to step 406.

步驟404:引腳複用裝置操作在第一模式。 Step 404: The pin multiplexing device operates in the first mode.

步驟406:引腳複用裝置操作在第二模式。 Step 406: The pin multiplexing device operates in the second mode.

步驟408:設定引腳複用裝置。 Step 408: Set the pin multiplexing device.

步驟410:組態偵測電路。 Step 410: Configure the detection circuit.

步驟412:第三裝置透過引腳複用裝置來存取第一裝置。 Step 412: The third device accesses the first device through the pin multiplexing device.

步驟414:結束。 Step 414: End.

簡要歸納本發明,在本發明之引腳複用裝置中,係透過專門的硬體電路來偵測引腳或是介面電路上的訊號是否符合一特定型樣,並據以動態地切換引腳以及介面電路的訊號傳輸方向,因此可以支援傳輸協議比較複雜的訊號傳輸方式,且也有利於減少專用引腳的數量,以最大化地減少晶片引腳的數量並降低成本。 To briefly summarize the present invention, in the pin multiplexing device of the present invention, a dedicated hardware circuit is used to detect whether the signal on the pin or the interface circuit conforms to a specific pattern, and the pin is dynamically switched accordingly As well as the signal transmission direction of the interface circuit, it can support signal transmission methods with more complicated transmission protocols, and it is also beneficial to reduce the number of dedicated pins, so as to minimize the number of chip pins and reduce costs.

以上所述僅為本發明之較佳實施例,凡依本發明申請專利範圍所做之均等變化與修飾,皆應屬本發明之涵蓋範圍。 The foregoing descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made in accordance with the scope of the patent application of the present invention shall fall within the scope of the present invention.

100:引腳複用裝置 100: Pin multiplexing device

110:多工電路 110: Multiplex circuit

111:第一埠 111: First Port

112:第二埠 112: second port

113:第三埠 113: Third Port

114:第四埠 114: Port 4

115_1~115_N、116_1~116_N:引腳 115_1~115_N, 116_1~116_N: pin

120:控制電路 120: control circuit

130:偵測電路 130: detection circuit

140:暫存器 140: register

155_1~155_N、156_1~156_N:介面電路 155_1~155_N, 156_1~156_N: interface circuit

171:第一裝置 171: First Device

172:第二裝置 172: Second Device

173:第三裝置 173: Third Device

174:第四裝置 174: Fourth Device

Vc:控制訊號 Vc: control signal

V_en:致能訊號 V_en: Enabling signal

V_mode:模式控制訊號 V_mode: Mode control signal

Claims (10)

一種引腳複用裝置,包含有:一多工電路,包含了一第一埠、一第二埠以及一第三埠,其中該第一埠、該第二埠以及該第三埠均包含了多個引腳,且該第一埠、該第二埠以及該第三埠之該多個引腳係用來分別透過多個介面電路連接到一第一裝置、一第二裝置以及一第三裝置;一控制電路,用以控制該多工電路操作在一第一模式或是一第二模式,其中當該多工電路操作在該第一模式時,該第一埠係連接到該第二埠;以及當該多工電路操作在該第二模式時,該第一埠係連接到該第三埠;以及一偵測電路,其中當該多工電路操作在該第二模式時,該偵測電路透過偵測該第一埠之一部分引腳或是所連接之介面電路上的訊號,以在該第三裝置與該第一裝置進行資料傳輸的過程中動態地切換該第三裝置與該第一裝置的資料傳輸方向。 A pin multiplexing device includes: a multiplexing circuit including a first port, a second port and a third port, wherein the first port, the second port and the third port all include A plurality of pins, and the pins of the first port, the second port and the third port are used to connect to a first device, a second device, and a third device through a plurality of interface circuits, respectively Device; a control circuit for controlling the multiplex circuit to operate in a first mode or a second mode, wherein when the multiplex circuit is operated in the first mode, the first port is connected to the second Port; and when the multiplex circuit is operated in the second mode, the first port is connected to the third port; and a detection circuit, wherein when the multiplex circuit is operated in the second mode, the detection circuit The test circuit detects a part of the pin of the first port or the signal on the connected interface circuit to dynamically switch between the third device and the first device during the process of data transmission between the third device and the first device. The data transmission direction of the first device. 如申請專利範圍第1項所述之引腳複用裝置,其中當該多工電路操作在該第一模式時,該偵測電路不會偵測該第一埠之該部分引腳或是所連接之介面電路上的訊號。 For the pin multiplexing device described in claim 1, wherein when the multiplexing circuit is operating in the first mode, the detection circuit does not detect the part of the pins or all the pins of the first port The signal on the connected interface circuit. 如申請專利範圍第1項所述之引腳複用裝置,其中當該多工電路操作在該第二模式時,該第三裝置透過該多工電路之該第一埠的該部分引腳傳送資料至該第一裝置;以及當該偵測電路偵測到該第一埠之該部分引腳或是所連接之介面電路上的訊號符合一特定型樣時,該偵測電路產生一控制訊號以使得該第一裝置透過該多工電路之該第一埠的該部分引腳傳送資料 至該第三裝置。 The pin multiplexing device described in the first item of the scope of patent application, wherein when the multiplex circuit is operated in the second mode, the third device transmits through the part of the pins of the first port of the multiplex circuit Data to the first device; and when the detection circuit detects that the part of the pins of the first port or the signal on the connected interface circuit conforms to a specific pattern, the detection circuit generates a control signal So that the first device transmits data through the part of the pins of the first port of the multiplexer circuit To the third device. 如申請專利範圍第3項所述之引腳複用裝置,其中該第一埠的該部分引腳所對應的介面電路包含了一收發電路,且當該偵測電路偵測到該第一埠之該部分引腳或是所連接之介面電路上的訊號符合該特定型樣時,該偵測電路產生該控制訊號以透過該多工電路控制該收發電路,以使得該第一裝置透過該多工電路之該第一埠的該部分引腳傳送資料至該第三裝置。 For the pin multiplexing device described in item 3 of the scope of patent application, the interface circuit corresponding to the part of the pins of the first port includes a transceiver circuit, and when the detection circuit detects the first port When the signal on the part of the pins or the connected interface circuit conforms to the specific pattern, the detection circuit generates the control signal to control the transceiver circuit through the multiplexer circuit, so that the first device can pass through the multiplexer The part of the pins of the first port of the IC transmits data to the third device. 如申請專利範圍第1項所述之引腳複用裝置,其中該多工電路另包含一第四埠,其中該第四埠之該多個引腳係用來分別透過多個接點連接到一第四裝置;以及當該多工電路操作在該第一模式時,該第三埠係連接到該第四埠。 For the pin multiplexing device described in item 1 of the scope of patent application, the multiplexing circuit further includes a fourth port, and the pins of the fourth port are used to connect to each other through a plurality of contacts. A fourth device; and when the multiplex circuit is operated in the first mode, the third port is connected to the fourth port. 如申請專利範圍第5項所述之引腳複用裝置,其中該第一裝置為一快閃記憶體、該第二裝置為一快閃記憶體控制器、該第三裝置為一記憶卡或是一編程器、以及該第四裝置為一記憶卡控制器。 For the pin multiplexing device described in item 5 of the scope of patent application, wherein the first device is a flash memory, the second device is a flash memory controller, the third device is a memory card or It is a programmer, and the fourth device is a memory card controller. 如申請專利範圍第6項所述之引腳複用裝置,其中當該第三裝置為該記憶卡時,該控制電路係控制該多工電路操作在該第一模式,以使得該快閃記憶體控制器透過該多工電路連接至該快閃記憶體,且該記憶卡控制器透過該多工電路連接至該記憶卡;以及當該第三裝置為該編程器時,該控制電路係控制該多工電路操作在該第二模式,以使得該編程器透過該多工電路連接至該快閃記憶體。 The pin multiplexing device described in item 6 of the scope of patent application, wherein when the third device is the memory card, the control circuit controls the multiplexing circuit to operate in the first mode, so that the flash memory The body controller is connected to the flash memory through the multiplexing circuit, and the memory card controller is connected to the memory card through the multiplexing circuit; and when the third device is the programmer, the control circuit controls The multiplexing circuit operates in the second mode, so that the programmer is connected to the flash memory through the multiplexing circuit. 一種控制一引腳複用裝置的方法,其中該引腳複用裝置包含了一多工電路,該多工電路包含了一第一埠、一第二埠以及一第三埠,其中該第一埠、該第二埠以及該第三埠均包含了多個引腳,且該第一埠、該第二埠以及該第三埠之該多個引腳係用來分別透過多個介面電路連接到一第一裝置、一第二裝置以及一第三裝置;以及該方法包含有:控制該多工電路操作在一第一模式或是一第二模式,其中當該多工電路操作在該第一模式時,該第一埠係連接到該第二埠;以及當該多工電路操作在該第二模式時,該第一埠係連接到該第三埠;以及當該多工電路操作在該第二模式時,透過偵測該第一埠之一部分引腳或是所連接之介面電路上的訊號,以在該第三裝置與該第一裝置進行資料傳輸的過程中動態地切換該第三裝置與該第一裝置的資料傳輸方向。 A method of controlling a pin multiplexing device, wherein the pin multiplexing device includes a multiplex circuit, the multiplex circuit includes a first port, a second port and a third port, wherein the first port The port, the second port, and the third port all include multiple pins, and the multiple pins of the first port, the second port, and the third port are used to connect through multiple interface circuits, respectively To a first device, a second device, and a third device; and the method includes: controlling the multiplex circuit to operate in a first mode or a second mode, wherein when the multiplex circuit operates in the first mode In one mode, the first port is connected to the second port; and when the multiplex circuit is operating in the second mode, the first port is connected to the third port; and when the multiplex circuit is operating in In the second mode, by detecting a part of the pin of the first port or the signal on the connected interface circuit, the third device is dynamically switched to the first device during data transmission. The data transmission direction of the three devices and the first device. 如申請專利範圍第8項所述之方法,其中當該多工電路操作在該第二模式時,透過偵測該第一埠之該部分引腳或是所連接之介面電路上的訊號,以在該第三裝置與該第一裝置進行資料傳輸的過程中動態地切換該第三裝置與該第一裝置的資料傳輸方向的步驟包含有:當該多工電路操作在該第二模式時,該第三裝置透過該多工電路之該第一埠的該部分引腳傳送資料至該第一裝置;以及當偵測到該第一埠之該部分引腳或是所連接之介面電路上的訊號符合一特定型樣時,產生一控制訊號以使得該第一裝置透過該多工電路之該第一埠的該部分引腳傳送資料至該第三裝置。 Such as the method described in item 8 of the scope of patent application, wherein when the multiplex circuit is operated in the second mode, by detecting the signal on the part of the pins of the first port or the connected interface circuit, During the process of data transmission between the third device and the first device, the step of dynamically switching the data transmission direction of the third device and the first device includes: when the multiplexing circuit is operating in the second mode, The third device transmits data to the first device through the part of the pins of the first port of the multiplex circuit; and when the part of the pins of the first port or the connected interface circuit is detected When the signal conforms to a specific pattern, a control signal is generated so that the first device transmits data to the third device through the part of the pins of the first port of the multiplex circuit. 如申請專利範圍第9項所述之方法,其中該第一埠的該部分引腳所對應的介面電路包含了一收發電路,且當偵測到該第一埠之該部分引腳或是 所連接之介面電路上的訊號符合該特定型樣時,產生該控制訊號以使得該第一裝置透過該多工電路之該第一埠的該部分引腳傳送資料至該第三裝置的步驟包含有:當偵測到該第一埠之該部分引腳或是所連接之介面電路上的訊號符合該特定型樣時,產生該控制訊號以透過該多工電路控制該收發電路,以使得該第一裝置透過該多工電路之該第一埠的該部分引腳傳送資料至該第三裝置。 For the method described in claim 9, wherein the interface circuit corresponding to the part of the pins of the first port includes a transceiver circuit, and when it is detected that the part of the pins of the first port is When the signal on the connected interface circuit conforms to the specific pattern, the step of generating the control signal so that the first device transmits data to the third device through the part of the pins of the first port of the multiplexer circuit includes Yes: When it is detected that the signal on the part of the pins of the first port or the connected interface circuit conforms to the specific pattern, the control signal is generated to control the transceiver circuit through the multiplex circuit, so that the The first device transmits data to the third device through the part of the pins of the first port of the multiplex circuit.
TW108110484A 2019-03-20 2019-03-26 Pin multiplexer and method for controlling pin multiplexer TWI703441B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW108110484A TWI703441B (en) 2019-03-26 2019-03-26 Pin multiplexer and method for controlling pin multiplexer
US16/812,362 US11249931B2 (en) 2019-03-20 2020-03-08 Pin multiplexer and method for controlling pin multiplexer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108110484A TWI703441B (en) 2019-03-26 2019-03-26 Pin multiplexer and method for controlling pin multiplexer

Publications (2)

Publication Number Publication Date
TWI703441B true TWI703441B (en) 2020-09-01
TW202036304A TW202036304A (en) 2020-10-01

Family

ID=73644071

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108110484A TWI703441B (en) 2019-03-20 2019-03-26 Pin multiplexer and method for controlling pin multiplexer

Country Status (1)

Country Link
TW (1) TWI703441B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7096310B2 (en) * 2004-03-16 2006-08-22 Hewlett-Packard Development, L.P. Switch configurable for a plurality of communication protocols
US20130318271A1 (en) * 2011-01-31 2013-11-28 Hewlett-Packard Development Company, L.P. Cable harness switches
US9756404B2 (en) * 2014-07-03 2017-09-05 Fiber Mountain, Inc. Data center path switch with improved path interconnection architecture
TW201832089A (en) * 2017-02-10 2018-09-01 美商高通公司 Multi-port multi-sideband-gpio consolidation technique over a multi-drop serial bus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7096310B2 (en) * 2004-03-16 2006-08-22 Hewlett-Packard Development, L.P. Switch configurable for a plurality of communication protocols
US20130318271A1 (en) * 2011-01-31 2013-11-28 Hewlett-Packard Development Company, L.P. Cable harness switches
US9756404B2 (en) * 2014-07-03 2017-09-05 Fiber Mountain, Inc. Data center path switch with improved path interconnection architecture
TW201832089A (en) * 2017-02-10 2018-09-01 美商高通公司 Multi-port multi-sideband-gpio consolidation technique over a multi-drop serial bus

Also Published As

Publication number Publication date
TW202036304A (en) 2020-10-01

Similar Documents

Publication Publication Date Title
US7689751B2 (en) PCI-express system
JP4896450B2 (en) Storage device
CN101295255B (en) Firmware updating system and method
KR100462177B1 (en) Embedded controller capable of backing up operating states of a peripheral device in the real time
KR100390058B1 (en) Communication system with a master station and at least one slave station
KR100513820B1 (en) Bus-to-bus bridge circuit with integrated loopback test capability and method of use
US6076160A (en) Hardware-based system for enabling data transfers between a CPU and chip set logic of a computer system on both edges of bus clock signal
US20080270654A1 (en) Bus System for Selectively Controlling a Plurality of Identical Slave Circuits Connected to the Bus and Method Therefore
US9495315B2 (en) Information processing device and data communication method
TWI710911B (en) Electronic system, host device and control method
TWI703441B (en) Pin multiplexer and method for controlling pin multiplexer
CN111797583B (en) Pin multiplexing device and method for controlling pin multiplexing device
JP2000293485A (en) Communication interface
US6052746A (en) Integrated circuit having programmable pull device configured to enable/disable first function in favor of second function according to predetermined scheme before/after reset
US20060095626A1 (en) Multifunction adapter
US11249931B2 (en) Pin multiplexer and method for controlling pin multiplexer
JP4116805B2 (en) Internal bus test device and internal bus test method
JP2001312327A (en) Data processing system provided with controllable clock for partitioned synchronizing interface
US20050240849A1 (en) Method of testing apparatus having master logic unit and slave logic unit
US7093060B2 (en) Access method and architecture of non-volatile random access memory
CN119557246B (en) Data transmission method, device, equipment and medium for memory expansion module
CN119002333A (en) Multiplexing pin control circuit, chip and electronic equipment
JP2003022212A (en) Bi-directional ram
JPH10198524A (en) Hard disk controller
KR20250122710A (en) A memory apparatus, a memory system and an operating method