[go: up one dir, main page]

TWI872761B - Sequential transmission method for i2c with low pin count and i2c transmission system using the same - Google Patents

Sequential transmission method for i2c with low pin count and i2c transmission system using the same Download PDF

Info

Publication number
TWI872761B
TWI872761B TW112141400A TW112141400A TWI872761B TW I872761 B TWI872761 B TW I872761B TW 112141400 A TW112141400 A TW 112141400A TW 112141400 A TW112141400 A TW 112141400A TW I872761 B TWI872761 B TW I872761B
Authority
TW
Taiwan
Prior art keywords
serial transmission
pin
slave devices
master device
interrupt request
Prior art date
Application number
TW112141400A
Other languages
Chinese (zh)
Other versions
TW202518280A (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 TW112141400A priority Critical patent/TWI872761B/en
Priority to CN202311715078.7A priority patent/CN119903009A/en
Application granted granted Critical
Publication of TWI872761B publication Critical patent/TWI872761B/en
Publication of TW202518280A publication Critical patent/TW202518280A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Information Transfer Systems (AREA)
  • Small-Scale Networks (AREA)

Abstract

The present invention relates to a sequential transmission method for I2C with low pin count and an I2C transmission system using the same. The method includes: providing a plurality of I2C slave devices and a I2C master device, wherein the plurality of I2C slave devices and the I2C master device is electrically connected to a I2C serial bus; interrupt request (IRQ) pins of the I2C slave devices are coupled to an interrupt input pin of the I2C master device; when a specific I2C slave device of the I2C slave devices asks an IRQ, an IRQ pin of the specific I2C slave device output a voltage level corresponding to the regulation of the specific I2C slave device; determining which one of the plurality of I2C slave devices asks IRQ according to an voltage level of the interrupt input pin of the I2C master device.

Description

低腳位I2C序列傳輸的方法以及使用其之低腳位I2C傳輸系統Low-pin I2C serial transmission method and low-pin I2C transmission system using the same

本發明涉及一種I2C傳輸的技術,且特別是一種低腳位I2C序列傳輸的方法以及使用其之低腳位I2C傳輸系統。The present invention relates to an I2C transmission technology, and in particular to a low-pin I2C serial transmission method and a low-pin I2C transmission system using the same.

I2C(Inter-Integrated Circuit)是一種串列通訊協定,用於連接不同的數位電子元件,例如微控制器、感測器、顯示器等,以實現資料交換。I2C協定由飛利浦(現在的恩智浦)於1982年開發,主要特點是使用兩條線(一條資料線SDA和一條時脈線SCL)來進行通訊,並支援多個從屬設備連接到同一組線路上。I2C (Inter-Integrated Circuit) is a serial communication protocol used to connect different digital electronic components, such as microcontrollers, sensors, displays, etc., to achieve data exchange. The I2C protocol was developed by Philips (now NXP) in 1982. Its main feature is that it uses two lines (a data line SDA and a clock line SCL) for communication and supports multiple slave devices connected to the same set of lines.

圖1繪示為先前技術的I2C傳輸方法之示意圖。請參考圖1,在圖1中,繪示了一I2C序列傳輸主(Master)控制器101以及多個I2C序列傳輸從(Slave)設備102。I2C通訊協定的基本運作方式是由I2C序列傳輸主(Master)控制器101發起通訊,選擇欲和其傳輸之I2C序列傳輸從(Slave)設備102。I2C序列傳輸主(Master)控制器101生成時脈信號,控制資料傳輸的節奏,資料傳輸以位元串的形式進行,I2C序列傳輸從(Slave)設備102在時脈的觸發下讀取或傳送資料。通訊的結束由主控制器產生停止條件(Stop Condition)來表示傳輸結束。FIG1 is a schematic diagram of an I2C transmission method of the prior art. Please refer to FIG1 , in which an I2C serial transmission master controller 101 and a plurality of I2C serial transmission slave devices 102 are shown. The basic operation mode of the I2C communication protocol is that the I2C serial transmission master controller 101 initiates communication and selects the I2C serial transmission slave device 102 to be transmitted with it. The I2C serial transmission master controller 101 generates a clock signal to control the rhythm of data transmission. The data transmission is carried out in the form of a bit string. The I2C serial transmission slave device 102 reads or transmits data under the triggering of the clock. The end of communication is indicated by the master controller generating a stop condition to indicate the end of transmission.

I2C序列傳輸從(Slave)設備102想要向I2C序列傳輸主(Master)控制器101發送中斷時,需要使用一個特定的腳位,通常稱為「中斷輸入腳位」,來通知I2C序列傳輸主(Master)控制器101。然而,這樣的設計存在以下缺點:When the I2C serial transmission slave device 102 wants to send an interrupt to the I2C serial transmission master controller 101, it needs to use a specific pin, usually called an "interrupt input pin", to notify the I2C serial transmission master controller 101. However, such a design has the following disadvantages:

1、額外硬體腳位需求:I2C序列傳輸主(Master)控制器101需要額外的硬體腳位支援,這對於一些有限腳位的應用來說可能會造成不便。1. Additional hardware pin requirements: The I2C serial transmission master controller 101 requires additional hardware pin support, which may cause inconvenience for some applications with limited pins.

2、中斷衝突:在多個從屬設備需要發送中斷時,可能會發生中斷衝突,需要額外的邏輯處理來管理這些中斷的優先順序。2. Interrupt conflicts: When multiple slave devices need to send interrupts, interrupt conflicts may occur, and additional logical processing is required to manage the priority of these interrupts.

本發明提供一種低腳位I2C序列傳輸的方法以及使用其之低腳位I2C傳輸系統,用以改變I2C序列傳輸主設備與I2C序列傳輸從設備之間的中斷設計,讓I2C序列傳輸主設備僅僅需要一個中斷輸入腳位,便可以連接多個I2C序列傳輸從設備。The present invention provides a low-pin I2C serial transmission method and a low-pin I2C transmission system using the method, which are used to change the interrupt design between an I2C serial transmission master device and an I2C serial transmission slave device, so that the I2C serial transmission master device only needs one interrupt input pin to connect multiple I2C serial transmission slave devices.

本發明的實施例提供了一種低腳位I2C傳輸系統,此低腳位I2C傳輸系統包括一I2C序列傳輸資料排線、多數個I2C序列傳輸從設備以及一I2C序列傳輸主設備。I2C序列傳輸資料排線包括一I2C序列傳輸資料線以及I2C序列傳輸時脈線。每一該些I2C序列傳輸從設備包括一I2C序列傳輸資料腳位、I2C序列傳輸時脈腳位以及一中斷要求腳位,其中,每一該些I2C序列傳輸從設備的I2C序列傳輸資料腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸資料線,且每一該些I2C序列傳輸從設備的I2C序列傳輸時脈腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸時脈線。一I2C序列傳輸主設備,包括一I2C序列傳輸資料腳位、I2C序列傳輸時脈腳位以及一中斷輸入腳位,其中,I2C序列傳輸主設備的I2C序列傳輸資料腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸資料線,且I2C序列傳輸主設備的I2C序列傳輸時脈腳位耦接I2C序列傳輸資料排線的I2C序列傳輸時脈線,其中,每一該些I2C序列傳輸從設備的中斷要求腳位耦接該I2C序列傳輸主設備的中斷輸入腳位,其中,每一該些I2C序列傳輸從設備的中斷要求腳位在進行中斷要求時,分別輸出不同的電壓,其中,該I2C序列傳輸主設備根據該I2C序列傳輸主設備的中斷輸入腳位所接收的電壓大小,判斷每一該些I2C序列傳輸從設備是否進行中斷要求。The embodiment of the present invention provides a low-pin I2C transmission system, which includes an I2C serial transmission data cable, a plurality of I2C serial transmission slave devices and an I2C serial transmission master device. The I2C serial transmission data cable includes an I2C serial transmission data line and an I2C serial transmission clock line. Each of the I2C serial transmission slave devices includes an I2C serial transmission data pin, an I2C serial transmission clock pin, and an interrupt request pin, wherein the I2C serial transmission data pin of each of the I2C serial transmission slave devices is coupled to the I2C serial transmission data line of the I2C serial transmission data cable, and the I2C serial transmission clock pin of each of the I2C serial transmission slave devices is coupled to the I2C serial transmission clock line of the I2C serial transmission data cable. An I2C serial transmission master device includes an I2C serial transmission data pin, an I2C serial transmission clock pin, and an interrupt input pin, wherein the I2C serial transmission data pin of the I2C serial transmission master device is coupled to the I2C serial transmission data line of the I2C serial transmission data cable, and the I2C serial transmission clock pin of the I2C serial transmission master device is coupled to the I2C serial transmission clock line of the I2C serial transmission data cable, wherein each The interrupt request pins of the I2C sequence transmission slave devices are coupled to the interrupt input pins of the I2C sequence transmission master device, wherein the interrupt request pins of each of the I2C sequence transmission slave devices respectively output different voltages when making an interrupt request, wherein the I2C sequence transmission master device determines whether each of the I2C sequence transmission slave devices makes an interrupt request according to the voltage size received by the interrupt input pins of the I2C sequence transmission master device.

依照本發明較佳實施例所述的低腳位I2C傳輸系統,更包括第一上拉電阻,第一上拉電阻的第一端耦接一電源電壓,第一上拉電阻的第二端耦接該I2C序列傳輸資料排線的I2C序列傳輸資料線。在另一較佳實施例中,所述之低腳位I2C傳輸系統更包括一第二上拉電阻,第二上拉電阻的第一端耦接一電源電壓,第二上拉電阻的第二端耦接該I2C序列傳輸資料排線的I2C序列傳輸時脈線。在另一較佳實施例中,每一該些I2C序列傳輸從設備在未進行中斷要求時,每一該些I2C序列傳輸從設備的中斷要求腳位為高阻抗狀態。在另一較佳實施例中,I2C序列傳輸主設備的中斷輸入腳位為一類比數位轉換輸入通道(Analog-to-Digital Conversion input Channel Pin)腳位。According to the preferred embodiment of the present invention, the low-pin I2C transmission system further includes a first pull-up resistor, the first end of the first pull-up resistor is coupled to a power voltage, and the second end of the first pull-up resistor is coupled to the I2C sequence transmission data line of the I2C sequence transmission data line. In another preferred embodiment, the low-pin I2C transmission system further includes a second pull-up resistor, the first end of the second pull-up resistor is coupled to a power voltage, and the second end of the second pull-up resistor is coupled to the I2C sequence transmission clock line of the I2C sequence transmission data line. In another preferred embodiment, when each of the I2C sequence transmission slave devices does not make an interrupt request, the interrupt request pin of each of the I2C sequence transmission slave devices is in a high impedance state. In another preferred embodiment, the interrupt input pin of the I2C serial transmission master device is an analog-to-digital conversion input channel pin.

本發明的實施例提供了一種低腳位I2C序列傳輸的方法,此低腳位I2C序列傳輸的方法包括:提供多數個I2C序列傳輸從設備;提供一I2C序列傳輸主設備,其中,該些I2C序列傳輸從設備以及該I2C序列傳輸主設備電性連接至一I2C序列傳輸排線;將每一該些I2C序列傳輸從設備之中斷要求腳位耦接至該I2C序列傳輸主設備的一中斷輸入腳位;當每一該些I2C序列傳輸從設備之中的一特定I2C序列傳輸從設備提出中斷要求時,該特定I2C序列傳輸從設備的中斷要求腳位輸出對應於該特定I2C序列傳輸從設備規範之電壓;根據該I2C序列傳輸主設備的中斷輸入腳位之電壓大小,判斷每一該些I2C序列傳輸從設備是否進行中斷要求。The embodiment of the present invention provides a method for low-pin I2C serial transmission, which includes: providing a plurality of I2C serial transmission slave devices; providing an I2C serial transmission master device, wherein the I2C serial transmission slave devices and the I2C serial transmission master device are electrically connected to an I2C serial transmission cable; coupling the interrupt request pin of each of the I2C serial transmission slave devices to the I2C serial transmission master device; An interrupt input pin of the transmission master device; when a specific I2C serial transmission slave device among each of the I2C serial transmission slave devices makes an interrupt request, the interrupt request pin of the specific I2C serial transmission slave device outputs a voltage corresponding to the specification of the specific I2C serial transmission slave device; according to the voltage size of the interrupt input pin of the I2C serial transmission master device, it is judged whether each of the I2C serial transmission slave devices makes an interrupt request.

綜上所述,本發明之實施例採用讓多個I2C序列傳輸從設備的中斷要求腳位耦接在I2C序列傳輸主設備的同一個中斷輸入腳位,並且,每一個I2C序列傳輸從設備的中斷要求腳位在要求中斷時,都輸出不同的電壓。因此,I2C序列傳輸主設備只要根據中斷輸入腳位所接收的電壓大小,便可以判斷從哪一個I2C序列傳輸從設備發出中斷要求。再者,在另一較佳實施例中,若多個設備同一期間送出中斷請求時,則I2C序列傳輸主設備先行處理較低中斷要求電壓的I2C序列傳輸從設備的中斷。In summary, the embodiment of the present invention allows the interrupt request pins of multiple I2C serial transmission slave devices to be coupled to the same interrupt input pin of the I2C serial transmission master device, and each interrupt request pin of the I2C serial transmission slave device outputs a different voltage when requesting an interrupt. Therefore, the I2C serial transmission master device can determine which I2C serial transmission slave device has issued an interrupt request based on the voltage received by the interrupt input pin. Furthermore, in another preferred embodiment, if multiple devices send interrupt requests at the same time, the I2C serial transmission master device will first process the interrupt of the I2C serial transmission slave device with a lower interrupt request voltage.

為了進一步理解本發明的技術、手段和效果,可以參考以下詳細描述和附圖,從而可以徹底和具體地理解本發明的目的、特徵和概念。然而,以下詳細描述和附圖僅用於參考和說明本發明的實現方式,其並非用於限制本發明。In order to further understand the technology, means and effects of the present invention, reference may be made to the following detailed description and accompanying drawings, so that the purpose, features and concepts of the present invention can be thoroughly and specifically understood. However, the following detailed description and accompanying drawings are only used for reference and explanation of the implementation of the present invention, and are not used to limit the present invention.

現在將詳細參考本發明的示範實施例,其示範實施例會在附圖中被繪示出。在可能的情況下,在附圖和說明書中使用相同的元件符號來指代相同或相似的部件。另外,示範實施例的做法僅是本發明之設計概念的實現方式之一,下述的該等示範皆非用於限定本發明。Reference will now be made in detail to exemplary embodiments of the present invention, which are illustrated in the accompanying drawings. Where possible, the same reference numerals are used in the drawings and the specification to refer to the same or similar components. In addition, the exemplary embodiments are only one of the implementation methods of the design concept of the present invention, and the following examples are not intended to limit the present invention.

圖2繪示為本發明一較佳實施例的低腳位I2C傳輸系統之系統方塊圖。請參考圖2,此低腳位I2C傳輸系統包括一I2C序列傳輸主設備201多數個I2C序列傳輸從設備202、以及一I2C序列傳輸資料排線,I2C序列傳輸資料排線包含了一I2C序列傳輸資料線SDA以及一I2C序列傳輸時脈線SCK。每一個I2C序列傳輸從設備202以及I2C序列傳輸主設備201的I2C序列傳輸資料腳位耦接到I2C序列傳輸資料線SDA,且每一個I2C序列傳輸從設備202以及I2C序列傳輸主設備201的I2C序列傳輸時脈腳位耦接到I2C序列傳輸時脈線SCK。另外,在此實施例中,每一個I2C序列傳輸從設備202皆具有一個中斷要求腳位IRQ。較為特別的是,上述每一個I2C序列傳輸從設備202的中斷要求腳位IRQ皆耦接到I2C序列傳輸主設備201的同一個中斷輸入腳位IRI。另外,在此實施例中,I2C序列傳輸資料線SDA以及I2C序列傳輸時脈線SCK分別被耦接了第一電阻R1以及第二電阻R2,作為上拉電阻,用以將I2C序列傳輸資料線SDA以及I2C序列傳輸時脈線SCK上拉至電源電壓VDD。FIG2 is a system block diagram of a low-pin I2C transmission system of a preferred embodiment of the present invention. Referring to FIG2 , the low-pin I2C transmission system includes an I2C serial transmission master device 201, a plurality of I2C serial transmission slave devices 202, and an I2C serial transmission data cable, wherein the I2C serial transmission data cable includes an I2C serial transmission data line SDA and an I2C serial transmission clock line SCK. The I2C serial transmission data pin of each I2C serial transmission slave device 202 and the I2C serial transmission master device 201 is coupled to the I2C serial transmission data line SDA, and the I2C serial transmission clock pin of each I2C serial transmission slave device 202 and the I2C serial transmission master device 201 is coupled to the I2C serial transmission clock line SCK. In addition, in this embodiment, each I2C serial transmission slave device 202 has an interrupt request pin IRQ. More specifically, the interrupt request pin IRQ of each I2C serial transmission slave device 202 is coupled to the same interrupt input pin IRI of the I2C serial transmission master device 201. In addition, in this embodiment, the I2C serial transmission data line SDA and the I2C serial transmission timing pulse line SCK are respectively coupled to the first resistor R1 and the second resistor R2 as pull-up resistors for pulling the I2C serial transmission data line SDA and the I2C serial transmission timing pulse line SCK to the power voltage VDD.

當進行一般傳輸時,傳輸皆由I2C序列傳輸主設備201發起,並依照I2C的格式,對指定的I2C序列傳輸從設備202輸出或要求資料。另外,由於此實施例中,每一個I2C序列傳輸從設備202的中斷要求腳位IRQ皆耦接到I2C序列傳輸主設備201的同一個中斷輸入腳位IRI。先前技術中,每一個I2C序列傳輸從設備202的中斷要求腳位IRQ都耦接到I2C序列傳輸主設備201的不同腳位,一般是通用型之輸入輸出(General-Purpose Input/Output,GPIO)腳位。原因在於,先前技術中,從I2C序列傳輸從設備202送來的中斷(interrupt)要求皆是邏輯低電壓,若有多個I2C序列傳輸從設備202的中斷要求腳位IRQ都耦接到I2C序列傳輸主設備201的同一個腳位,無法判定是哪一個I2C序列傳輸從設備202發出的中斷要求,故會發生中斷衝突。When performing general transmission, the transmission is initiated by the I2C serial transmission master device 201, and according to the I2C format, the specified I2C serial transmission slave device 202 outputs or requests data. In addition, in this embodiment, the interrupt request pin IRQ of each I2C serial transmission slave device 202 is coupled to the same interrupt input pin IRI of the I2C serial transmission master device 201. In the prior art, the interrupt request pin IRQ of each I2C serial transmission slave device 202 is coupled to a different pin of the I2C serial transmission master device 201, which is generally a general-purpose input/output (GPIO) pin. The reason is that in the prior art, the interrupt requests sent from the I2C serial transmission slave device 202 are all logically low voltage. If the interrupt request pins IRQ of multiple I2C serial transmission slave devices 202 are coupled to the same pin of the I2C serial transmission master device 201, it is impossible to determine which I2C serial transmission slave device 202 issued the interrupt request, so an interrupt conflict will occur.

然而,在此實施例中,每一個I2C序列傳輸從設備202的中斷要求腳位IRQ皆耦接到I2C序列傳輸主設備201的同一個中斷輸入腳位IRI。且每一個I2C序列傳輸從設備202的中斷要求腳位IRQ在進行中斷要求時,會輸出不同的電壓。I2C序列傳輸主設備201的中斷輸入腳位IRI內部具有可以分辨電壓的電路,例如類比數位轉換器(Analog-to-Digital Converter,ADC)。However, in this embodiment, the interrupt request pin IRQ of each I2C serial transmission slave device 202 is coupled to the same interrupt input pin IRI of the I2C serial transmission master device 201. And the interrupt request pin IRQ of each I2C serial transmission slave device 202 will output a different voltage when making an interrupt request. The interrupt input pin IRI of the I2C serial transmission master device 201 has a circuit that can distinguish voltage, such as an analog-to-digital converter (ADC).

大多數I2C序列傳輸主設備201中的微處理器(MCU)都有內建類比數位轉換器,用以轉換類比數位轉換輸入通道腳位(ADC input channel pin)上的類比電壓成數位值,例如12-bit SAR-ADC,通常精確值約為10 bits。為了避免誤判,此10位元的精確值再分成 2^7 = 128的區間。舉例來說,類比數位轉換器的參考電壓是3.3V,分成128個區間,每個區間範圍大小約等於 3.3V/128 = 25.78mV。假設能夠讓輸入的類比數位轉換器電壓約落在每個區間的中間,如此I2C序列傳輸主設備201中的微處理器就容易識別出不同的各個區間的類比數位轉換器之轉換數值。Most microprocessors (MCUs) in the I2C serial transmission master device 201 have built-in analog-to-digital converters to convert the analog voltage on the analog-to-digital converter input channel pin (ADC input channel pin) into digital values, such as 12-bit SAR-ADC, which usually has an accuracy of about 10 bits. In order to avoid misjudgment, this 10-bit accuracy is further divided into 2^7 = 128 intervals. For example, the reference voltage of the analog-to-digital converter is 3.3V, which is divided into 128 intervals, and the range of each interval is approximately equal to 3.3V/128 = 25.78mV. Assuming that the input ADC voltage can be made to fall approximately in the middle of each interval, the microprocessor in the I2C serial transmission master device 201 can easily identify the conversion values of the ADCs in different intervals.

再者,假設每一個 I2C序列傳輸從設備202都有一個可以致能或禁能(Enable or Disable)控制輸出電壓的腳位,並可以輸出固定且唯一的電壓 (每個I2C序列傳輸從設備202的輸出電壓值都不相同,但都約略落在上一段所述每個區間的中間值,例如: 25.78mV/2 * (2N+1),N = 0, 1, 2, …, 127,亦即12.89mV, 38.67mV, 64.45mV, …, 3.287V)。 一般情況下,此I2C序列傳輸從設備202若沒有偵測到任何的變化(例如手觸,方向軸或加減速的改變)而需要I2C序列傳輸主設備201來讀取資料時,此中斷要求腳位IRQ就輸出浮動電壓(floating,或高阻抗)。反之,若I2C序列傳輸從設備202有偵測到有任何的異動時,此中斷要求腳位IRQ就可以輸出此I2C序列傳輸從設備202對應的固定且唯一之電壓,當成特定的中斷需求給I2C序列傳輸主設備201,用以通知I2C序列傳輸主設備201來存取I2C序列傳輸從設備202。Furthermore, it is assumed that each I2C serial transmission slave device 202 has a pin that can enable or disable the output voltage control and can output a fixed and unique voltage (the output voltage value of each I2C serial transmission slave device 202 is different, but all fall roughly in the middle of each range described in the previous paragraph, for example: 25.78mV/2 * (2N+1), N = 0, 1, 2, …, 127, that is, 12.89mV, 38.67mV, 64.45mV, …, 3.287V). In general, if the I2C serial transmission slave device 202 does not detect any changes (such as touch, direction axis or acceleration/deceleration changes) and needs the I2C serial transmission master device 201 to read data, the interrupt request pin IRQ outputs a floating voltage (floating, or high impedance). On the contrary, if the I2C serial transmission slave device 202 detects any abnormality, the interrupt request pin IRQ can output a fixed and unique voltage corresponding to the I2C serial transmission slave device 202 as a specific interrupt request to the I2C serial transmission master device 201, so as to notify the I2C serial transmission master device 201 to access the I2C serial transmission slave device 202.

因此,如圖2所示,只需利用I2C序列傳輸主設備201內的微處理器之一個類比數位轉換輸入通道腳位(ADC input channel pin),把各個I2C序列傳輸從設備202的輸出的電壓腳位共同耦接到I2C序列傳輸主設備201的同一個中斷輸入腳位IRI。當I2C序列傳輸主設備201發現類比數位轉換的數值是對應於某個I2C序列傳輸從設備202輸出的固定電壓值,此I2C序列傳輸主設備201就可以發送I2C的訊號(SCL and SDA)來對此I2C序列傳輸從設備202讀取資料。當此I2C序列傳輸從設備202的資料被讀取後,此I2C序列傳輸從設備202就禁能(Disable)中斷要求腳位IRQ上的電壓輸出,恢復成一般浮動電壓(floating)的輸出狀態。Therefore, as shown in FIG. 2 , it is only necessary to utilize an analog-to-digital conversion input channel pin (ADC input channel pin) of the microprocessor in the I2C serial transmission master device 201 to couple the output voltage pins of each I2C serial transmission slave device 202 to the same interrupt input pin IRI of the I2C serial transmission master device 201. When the I2C serial transmission master device 201 finds that the analog-to-digital conversion value corresponds to a fixed voltage value output by a certain I2C serial transmission slave device 202, the I2C serial transmission master device 201 can send I2C signals (SCL and SDA) to read data from the I2C serial transmission slave device 202. After the data of the I2C serial transmission slave device 202 is read, the I2C serial transmission slave device 202 disables the voltage output on the interrupt request pin IRQ and restores it to a normal floating voltage output state.

在另一較佳實施例中,若同一期間有多個I2C序列傳輸從設備202從中斷要求腳位IRQ送出電壓,此時,由於,低電壓的中斷會被高電壓的中斷的電壓所拉升,I2C序列傳輸主設備201的中斷輸入腳位IRI會接收到輸出最高電壓的I2C序列傳輸從設備202之電壓,故,I2C序列傳輸主設備201會先進行對應於最高電壓的I2C序列傳輸從設備202之中斷存取處理,之後,才依照電壓從大到小,依序進行I2C序列傳輸從設備202的中斷存取處理。藉此,也解決了先前技術中的中斷衝突。In another preferred embodiment, if multiple I2C serial transmission slave devices 202 send voltages from the interrupt request pin IRQ during the same period, at this time, since the low voltage interrupt will be pulled up by the high voltage interrupt voltage, the interrupt input pin IRI of the I2C serial transmission master device 201 will receive the voltage of the I2C serial transmission slave device 202 that outputs the highest voltage. Therefore, the I2C serial transmission master device 201 will first perform the interrupt access processing corresponding to the I2C serial transmission slave device 202 with the highest voltage, and then perform the interrupt access processing of the I2C serial transmission slave device 202 in order from high to low voltage. Thereby, the interruption conflict in the previous technology is also solved.

由上述實施例,可以看出,藉由上述實施例的中斷運作機制,I2C序列傳輸主設備201就不需有多根的通用型之輸入輸出(General-Purpose Input/Output,GPIO)腳位或者中斷輸入腳位來接收各個I2C序列傳輸從設備202發送過來的中斷需求,以節省I2C序列傳輸主設備201的通用型之輸入輸出(General-Purpose Input/Output,GPIO)腳位或中斷輸入腳位數(pin counts)。From the above-mentioned embodiments, it can be seen that, through the interrupt operation mechanism of the above-mentioned embodiments, the I2C serial transmission master device 201 does not need to have multiple general-purpose input/output (GPIO) pins or interrupt input pins to receive the interrupt requirements sent by each I2C serial transmission slave device 202, so as to save the number of general-purpose input/output (GPIO) pins or interrupt input pins (pin counts) of the I2C serial transmission master device 201.

根據上述的低腳位I2C傳輸系統之較佳實施例,可以歸納成一種低腳位I2C序列傳輸的方法。圖3繪示為本發明一較佳實施例的低腳位I2C序列傳輸的方法之流程圖。請參考圖3,此低腳位I2C序列傳輸的方法包括下列步驟:According to the above-mentioned preferred embodiment of the low-pin I2C transmission system, a method of low-pin I2C serial transmission can be summarized. FIG3 is a flow chart of the method of low-pin I2C serial transmission of a preferred embodiment of the present invention. Referring to FIG3, the method of low-pin I2C serial transmission includes the following steps:

步驟S301:開始。Step S301: Start.

步驟S302:提供多數個I2C序列傳輸從設備。Step S302: Provide a plurality of I2C serial transmission slave devices.

步驟S303:提供一I2C序列傳輸主設備,其中,上述I2C序列傳輸從設備以及上述I2C序列傳輸主設備電性連接至一I2C序列傳輸排線。並且,每一該些I2C序列傳輸從設備之中斷要求腳位耦接至該I2C序列傳輸主設備的一中斷輸入腳位。Step S303: Provide an I2C serial transmission master device, wherein the I2C serial transmission slave device and the I2C serial transmission master device are electrically connected to an I2C serial transmission cable, and each of the I2C serial transmission slave devices has an interrupt request pin coupled to an interrupt input pin of the I2C serial transmission master device.

步驟S304:判斷I2C序列傳輸主設備的IRI腳位之電壓大小。藉此,判斷上述多個I2C序列傳輸從設備之中是否發出中斷請求,並根據電壓大小,判斷上述多個I2C序列傳輸從設備之中的何者發出的中斷請求。由於每一個I2C序列傳輸從設備202皆有對應的一組固定電壓,故其中之一特定I2C序列傳輸從設備202的中斷要求腳位IRQ提出中斷要求時,上述特定I2C序列傳輸從設備202的中斷要求腳位IRQ輸出對應於上述特定I2C序列傳輸從設備202規範之電壓。Step S304: Determine the voltage of the IRI pin of the I2C serial transmission master device. In this way, determine whether the above-mentioned multiple I2C serial transmission slave devices have issued an interrupt request, and determine which of the above-mentioned multiple I2C serial transmission slave devices has issued an interrupt request based on the voltage. Since each I2C serial transmission slave device 202 has a corresponding set of fixed voltages, when the interrupt request pin IRQ of one of the specific I2C serial transmission slave devices 202 makes an interrupt request, the interrupt request pin IRQ of the above-mentioned specific I2C serial transmission slave device 202 outputs a voltage corresponding to the specification of the above-mentioned specific I2C serial transmission slave device 202.

步驟S305:根據I2C序列傳輸主設備的中斷輸入腳位之電壓大小,判斷每一該些I2C序列傳輸從設備是否進行中斷要求。Step S305: Determine whether each of the I2C serial transmission slave devices has made an interrupt request according to the voltage level of the interrupt input pin of the I2C serial transmission master device.

綜合以上所述,本發明之實施例採用讓多個I2C序列傳輸從設備的中斷要求腳位耦接在I2C序列傳輸主設備的同一個中斷輸入腳位,並且,每一個I2C序列傳輸從設備的中斷要求腳位在要求中斷時,都輸出不同的電壓。因此,I2C序列傳輸主設備只要根據中斷輸入腳位所接收的電壓大小,便可以判斷從哪一個I2C序列傳輸從設備發出中斷要求。再者,在另一較佳實施例中,若多個設備同一期間送出中斷請求時,則I2C序列傳輸主設備先行處理較高中斷要求電壓的I2C序列傳輸從設備的中斷。In summary, the embodiment of the present invention allows the interrupt request pins of multiple I2C serial transmission slave devices to be coupled to the same interrupt input pin of the I2C serial transmission master device, and each interrupt request pin of the I2C serial transmission slave device outputs a different voltage when requesting an interrupt. Therefore, the I2C serial transmission master device can determine which I2C serial transmission slave device has issued an interrupt request based on the voltage received by the interrupt input pin. Furthermore, in another preferred embodiment, if multiple devices send interrupt requests at the same time, the I2C serial transmission master device first processes the interrupt of the I2C serial transmission slave device with a higher interrupt request voltage.

應當理解,本文描述的示例和實施例僅用於說明目的,並且鑑於其的各種修改或改變將被建議給本領域技術人員,並且將被包括在本申請的精神和範圍以及所附權利要求的範圍之內。It should be understood that the examples and embodiments described herein are for illustrative purposes only and that various modifications or changes thereto will be suggested to those skilled in the art and are to be included within the spirit and scope of the present application and the scope of the appended claims.

101:I2C序列傳輸主(Master)控制器 102:I2C序列傳輸從設備 201:I2C序列傳輸主設備 202:I2C序列傳輸從設備 SDA:I2C序列傳輸資料線 SCK:I2C序列傳輸時脈線 SCK:每一個I2C序列傳輸從設備202以及I2C序列傳輸主設備 IRQ:I2C序列傳輸從設備202的中斷要求腳位 IRI:I2C序列傳輸主設備201的中斷輸入腳位 R1:第一電阻 R2:第二電阻 VDD:電源電壓 S301~S305:本發明一較佳實施例的低腳位I2C序列傳輸的方法之流程步驟 101: I2C serial transmission master controller 102: I2C serial transmission slave device 201: I2C serial transmission master device 202: I2C serial transmission slave device SDA: I2C serial transmission data line SCK: I2C serial transmission clock line SCK: Each I2C serial transmission slave device 202 and I2C serial transmission master device IRQ: I2C serial transmission slave device 202 interrupt request pin IRI: I2C serial transmission master device 201 interrupt input pin R1: first resistor R2: second resistor VDD: power supply voltage S301~S305: process steps of the low-pin I2C serial transmission method of a preferred embodiment of the present invention

提供的附圖用以使本發明所屬技術領域具有通常知識者可以進一步理解本發明,並且被併入與構成本發明之說明書的一部分。附圖示出了本發明的示範實施例,並且用以與本發明之說明書一起用於解釋本發明的原理。The accompanying drawings are provided to enable a person with ordinary knowledge in the art to which the present invention belongs to further understand the present invention, and are incorporated into and constitute a part of the specification of the present invention. The accompanying drawings show exemplary embodiments of the present invention, and are used together with the specification of the present invention to explain the principles of the present invention.

圖1繪示為先前技術的I2C傳輸方法之示意圖。FIG. 1 is a schematic diagram of an I2C transmission method in the prior art.

圖2繪示為本發明一較佳實施例的低腳位I2C傳輸系統之系統方塊圖。FIG. 2 is a system block diagram of a low-pin I2C transmission system according to a preferred embodiment of the present invention.

圖3繪示為本發明一較佳實施例的低腳位I2C序列傳輸的方法之流程圖。FIG. 3 is a flow chart showing a method for low pin I2C serial transmission according to a preferred embodiment of the present invention.

S301~S305:本發明一較佳實施例的低腳位I2C序列傳輸的方法之流程步驟 S301~S305: Process steps of the method of low-pin I2C serial transmission of a preferred embodiment of the present invention

Claims (8)

一種低腳位I2C傳輸系統,包括: 一I2C序列傳輸資料排線,包括一I2C序列傳輸資料線以及I2C序列傳輸時脈線; 多數個I2C序列傳輸從設備,其中,每一該些I2C序列傳輸從設備包括一I2C序列傳輸資料腳位、I2C序列傳輸時脈腳位以及一中斷要求腳位,其中,每一該些I2C序列傳輸從設備的I2C序列傳輸資料腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸資料線,且每一該些I2C序列傳輸從設備的I2C序列傳輸時脈腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸時脈線;以及 一I2C序列傳輸主設備,包括一I2C序列傳輸資料腳位、I2C序列傳輸時脈腳位以及一中斷輸入腳位, 其中,該I2C序列傳輸主設備的I2C序列傳輸資料腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸資料線,且該I2C序列傳輸主設備的I2C序列傳輸時脈腳位耦接該I2C序列傳輸資料排線的I2C序列傳輸時脈線, 其中,每一該些I2C序列傳輸從設備的中斷要求腳位耦接該I2C序列傳輸主設備的中斷輸入腳位, 其中,每一該些I2C序列傳輸從設備的中斷要求腳位在進行中斷要求時,分別輸出不同的電壓, 其中,該I2C序列傳輸主設備根據該I2C序列傳輸主設備的中斷輸入腳位所接收的電壓大小,判斷每一該些I2C序列傳輸從設備是否進行中斷要求。 A low-pin I2C transmission system, comprising: an I2C serial transmission data cable, including an I2C serial transmission data line and an I2C serial transmission clock line; a plurality of I2C serial transmission slave devices, wherein each of the I2C serial transmission slave devices comprises an I2C serial transmission data pin, an I2C serial transmission clock pin and an interrupt request pin, wherein the I2C serial transmission data pin of each of the I2C serial transmission slave devices is coupled to the I2C serial transmission data line of the I2C serial transmission data cable, and the I2C serial transmission clock pin of each of the I2C serial transmission slave devices is coupled to the I2C serial transmission clock line of the I2C serial transmission data cable; and An I2C serial transmission master device includes an I2C serial transmission data pin, an I2C serial transmission clock pin, and an interrupt input pin, wherein the I2C serial transmission data pin of the I2C serial transmission master device is coupled to the I2C serial transmission data line of the I2C serial transmission data cable, and the I2C serial transmission clock pin of the I2C serial transmission master device is coupled to the I2C serial transmission clock line of the I2C serial transmission data cable, wherein the interrupt request pin of each of the I2C serial transmission slave devices is coupled to the interrupt input pin of the I2C serial transmission master device, Wherein, the interrupt request pins of each of the I2C serial transmission slave devices output different voltages when making an interrupt request, Wherein, the I2C serial transmission master device determines whether each of the I2C serial transmission slave devices makes an interrupt request based on the voltage size received by the interrupt input pin of the I2C serial transmission master device. 根據請求項1所述之低腳位I2C傳輸系統,更包括: 一第一上拉電阻,包括一第一端以及一第二端,其中,該第一上拉電阻的第一端耦接一電源電壓,該第一上拉電阻的第二端耦接該I2C序列傳輸資料排線的I2C序列傳輸資料線。 The low-pin I2C transmission system according to claim 1 further includes: A first pull-up resistor including a first end and a second end, wherein the first end of the first pull-up resistor is coupled to a power voltage, and the second end of the first pull-up resistor is coupled to the I2C serial transmission data line of the I2C serial transmission data cable. 根據請求項1所述之低腳位I2C傳輸系統,更包括: 一第二上拉電阻,包括一第一端以及一第二端,其中,該第二上拉電阻的第一端耦接一電源電壓,該第二上拉電阻的第二端耦接該I2C序列傳輸資料排線的I2C序列傳輸時脈線。 The low-pin I2C transmission system according to claim 1 further includes: A second pull-up resistor, including a first end and a second end, wherein the first end of the second pull-up resistor is coupled to a power voltage, and the second end of the second pull-up resistor is coupled to the I2C serial transmission clock line of the I2C serial transmission data cable. 根據請求項1所述之低腳位I2C傳輸系統,其中,每一該些I2C序列傳輸從設備在未進行中斷要求時,每一該些I2C序列傳輸從設備的中斷要求腳位為高阻抗狀態。According to the low-pin I2C transmission system described in claim 1, when each of the I2C serial transmission slave devices does not make an interrupt request, the interrupt request pin of each of the I2C serial transmission slave devices is in a high-impedance state. 根據請求項1所述之低腳位I2C傳輸系統,其中,該I2C序列傳輸主設備的中斷輸入腳位為一類比數位轉換輸入通道(Analog-to-Digital Conversion input Channel Pin)腳位。According to the low-pin I2C transmission system described in claim 1, the interrupt input pin of the I2C serial transmission master device is an analog-to-digital conversion input channel pin. 一種低腳位I2C序列傳輸的方法,包括: 提供多數個I2C序列傳輸從設備; 提供一I2C序列傳輸主設備,其中,該些I2C序列傳輸從設備以及該I2C序列傳輸主設備電性連接至一I2C序列傳輸排線; 將每一該些I2C序列傳輸從設備之中斷要求腳位耦接至該I2C序列傳輸主設備的一中斷輸入腳位; 當每一該些I2C序列傳輸從設備之中的一特定I2C序列傳輸從設備提出中斷要求時,該特定I2C序列傳輸從設備的中斷要求腳位輸出對應於該特定I2C序列傳輸從設備規範之電壓; 根據該I2C序列傳輸主設備的中斷輸入腳位之電壓大小,判斷每一該些I2C序列傳輸從設備是否進行中斷要求。 A method for low-pin I2C serial transmission, comprising: Providing a plurality of I2C serial transmission slave devices; Providing an I2C serial transmission master device, wherein the I2C serial transmission slave devices and the I2C serial transmission master device are electrically connected to an I2C serial transmission cable; Coupling an interrupt request pin of each of the I2C serial transmission slave devices to an interrupt input pin of the I2C serial transmission master device; When a specific I2C serial transmission slave device among each of the I2C serial transmission slave devices makes an interrupt request, the interrupt request pin of the specific I2C serial transmission slave device outputs a voltage corresponding to the specification of the specific I2C serial transmission slave device; According to the voltage level of the interrupt input pin of the I2C serial transmission master device, it is determined whether each of the I2C serial transmission slave devices has made an interrupt request. 根據請求項6所述之低腳位I2C序列傳輸的方法,其中,每一該些I2C序列傳輸從設備在未進行中斷要求時,每一該些I2C序列傳輸從設備的中斷要求腳位為高阻抗狀態。According to the method of low-pin I2C serial transmission described in claim 6, when each of the I2C serial transmission slave devices does not make an interrupt request, the interrupt request pin of each of the I2C serial transmission slave devices is in a high impedance state. 根據請求項6所述之低腳位I2C序列傳輸的方法,其中,該I2C序列傳輸主設備的中斷輸入腳位為一類比數位轉換輸入通道(Analog-to-Digital Conversion input Channel Pin)腳位。According to the method of low-pin I2C serial transmission described in claim 6, the interrupt input pin of the I2C serial transmission master device is an analog-to-digital conversion input channel pin.
TW112141400A 2023-10-27 2023-10-27 Sequential transmission method for i2c with low pin count and i2c transmission system using the same TWI872761B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW112141400A TWI872761B (en) 2023-10-27 2023-10-27 Sequential transmission method for i2c with low pin count and i2c transmission system using the same
CN202311715078.7A CN119903009A (en) 2023-10-27 2023-12-13 Low-pin I2C serial transmission method and low-pin I2C transmission system using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW112141400A TWI872761B (en) 2023-10-27 2023-10-27 Sequential transmission method for i2c with low pin count and i2c transmission system using the same

Publications (2)

Publication Number Publication Date
TWI872761B true TWI872761B (en) 2025-02-11
TW202518280A TW202518280A (en) 2025-05-01

Family

ID=95465606

Family Applications (1)

Application Number Title Priority Date Filing Date
TW112141400A TWI872761B (en) 2023-10-27 2023-10-27 Sequential transmission method for i2c with low pin count and i2c transmission system using the same

Country Status (2)

Country Link
CN (1) CN119903009A (en)
TW (1) TWI872761B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201022948A (en) * 2008-12-12 2010-06-16 Via Tech Inc Methods for preventing transaction collisions on a bus and computer system utilizing the same
TW201717045A (en) * 2015-10-15 2017-05-16 惠普發展公司有限責任合夥企業 Utilizing pins on a universal serial bus (USB) type-C connector for a data signal
US20190236037A1 (en) * 2019-03-27 2019-08-01 Suresh Sugumar Low pin-count architecture with prioritized message arbitration and delivery
CN115145786A (en) * 2022-06-02 2022-10-04 深圳市亿威尔信息技术股份有限公司 BMC chip management method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201022948A (en) * 2008-12-12 2010-06-16 Via Tech Inc Methods for preventing transaction collisions on a bus and computer system utilizing the same
TW201717045A (en) * 2015-10-15 2017-05-16 惠普發展公司有限責任合夥企業 Utilizing pins on a universal serial bus (USB) type-C connector for a data signal
US20190236037A1 (en) * 2019-03-27 2019-08-01 Suresh Sugumar Low pin-count architecture with prioritized message arbitration and delivery
CN115145786A (en) * 2022-06-02 2022-10-04 深圳市亿威尔信息技术股份有限公司 BMC chip management method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN119903009A (en) 2025-04-29
TW202518280A (en) 2025-05-01

Similar Documents

Publication Publication Date Title
US10007637B2 (en) Single wire bus system
Leens An introduction to I 2 C and SPI protocols
TWI421670B (en) Interface unit,interfacing system method and power management controller
JP2016538624A (en) Coexistence of I2C slave device and camera control interface expansion device on shared control data bus
US11308023B2 (en) Method and system for enhanced SPI communication
KR960006506B1 (en) Computer system, system expansion unit, bus combiner and bus access control method
CN107209743B (en) Receive clock calibration for serial bus
KR20160107247A (en) Camera control interface extension with in-band interrupt
US11630796B2 (en) Serial peripheral interface (SPI) automatic register address incrementation across data frames
CN112639753B (en) Aggregated inband interruption
CA2759946A1 (en) Single wire bus system
CN105518637A (en) Method and apparatus to enable multiple masters to operate in a single master bus architecture
US7337382B2 (en) Data transfer control device, electronic instrument, and data transfer control method
CN115328845B (en) Four-wire serial peripheral interface communication protocol design method
TWI872761B (en) Sequential transmission method for i2c with low pin count and i2c transmission system using the same
US20190018818A1 (en) Accelerated i3c stop initiated by a third party
KR20160067222A (en) SLAVE IDENTIFIER SCANNING AND HOT-PLUG CAPABILITY OVER CCIe BUS
KR101350085B1 (en) Power conservation
WO2007030978A1 (en) Method, reset apparatus and equipment for realizing reset of master device in i2c bus
TWI614609B (en) Inter-integrated circuit bus arbitration system
TW202224292A (en) Usb signal transmission device, usb cable and operation method thereof
CN114880270B (en) SPI device and data transmission method thereof
WO2017172269A1 (en) Method and apparatus to enable multiple masters to operate in a single master bus architecture
CN118484415A (en) Sensor adapter and sensor adapter device
TWI427481B (en) A bridge system, a device and a method of the isa bus