KR20040078972A - Bidirectional data transmission apparatus and the method thereof for embedded system - Google Patents

Bidirectional data transmission apparatus and the method thereof for embedded system Download PDF

Info

Publication number
KR20040078972A
KR20040078972A KR1020030013820A KR20030013820A KR20040078972A KR 20040078972 A KR20040078972 A KR 20040078972A KR 1020030013820 A KR1020030013820 A KR 1020030013820A KR 20030013820 A KR20030013820 A KR 20030013820A KR 20040078972 A KR20040078972 A KR 20040078972A
Authority
KR
South Korea
Prior art keywords
master
slave
data
bus protocol
embedded system
Prior art date
Application number
KR1020030013820A
Other languages
Korean (ko)
Other versions
KR100962306B1 (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 KR1020030013820A priority Critical patent/KR100962306B1/en
Publication of KR20040078972A publication Critical patent/KR20040078972A/en
Application granted granted Critical
Publication of KR100962306B1 publication Critical patent/KR100962306B1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F13/4286Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a handshaking protocol, e.g. RS232C link
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0016Inter-integrated circuit (I2C)

Abstract

PURPOSE: An interactive data communication system and a method for the same are provided to communicate data between a master IC and a slave IC in an embedded system having two CPUs by using an I2C(Inter-Integrated Circuit) bus protocol. CONSTITUTION: The method comprises several steps. A slave IC outputs a call signal via an output end in a case that the slave IC needs calling a master IC(S310). The master IC, receiving the call signal, generates an interrupt signal(S320). The master IC stops an execution of a driven program temporarily, and calls the slave IC via an interface(S330). The master IC checks whether a data transmission is completed(S340). In a case that the data transmission is completed, the data transmission is stopped. In a case that the data transmission is not completed, the data transmission is continued.

Description

임베디드 시스템의 양방향 데이터 통신장치 및 그 방법{Bidirectional data transmission apparatus and the method thereof for embedded system}Bidirectional data transmission apparatus and the method according to embedded system}

본발명은 두개의 CPU를 사용하는 임베디드(Embedded) 시스템의 양방향 데이터 통신장치에 관한 것으로 상세하게는, I2C 버스 프로토콜을 이용하여 슬레이브 IC와 매스터 IC간에 데이터를 송수신할 수 있는 양방향 데이터 통신장치에 관한 것이다.The present invention relates to a bidirectional data communication device of an embedded system using two CPUs, and more particularly, to a bidirectional data communication device capable of transmitting and receiving data between a slave IC and a master IC using an I2C bus protocol. will be.

최근들어 복잡한 제품의 기능을 제어하기 위하여 제어 프로그램이 내장된 CPU나 IC들을 복수 개 사용하여 시스템을 제어하고 통신을 하는 제품들이 많이 사용되고 있다. 이러한 CPU나 IC들이 효과적으로 통신을 하기 위한 여러가지 방법이 제시되어 있으나 적은 수의 통신라인을 이용하여 여러개의 IC들이 통신을 할 수 있는 I2C버스 프로토콜을 많이 사용하고 있다.Recently, to control the functions of complex products, many products that control and communicate with a system using a plurality of CPUs or ICs in which a control program is embedded are used. There are various ways to communicate effectively with these CPUs and ICs, but I2C bus protocols that use a small number of communication lines to communicate with multiple ICs are widely used.

도 1은 I2C 버스 프로토콜의 일반적인 인터페이스회로로서 I2C 버스 프로토콜은 마스터(Master) IC(10)와 슬레이브(Slave) IC(20~n)들로 구성되며 Master IC(10)의 데이터 라인(SDA;11)과 Slave IC(20~n)의 데이터라인(21~n1)이 상호 연결되어 있다. 또한, Master IC(10)의 클럭 라인(SCL;12)과 Slave IC(20~n)의 클럭라인(22~n2)이 상호 연결되어 있으며 상기 각 라인에는 전원라인에 연결된 저항(30)이 각각 연결되어 있다. 상기 Slave IC(20~n)들은 각각 고유한 주소(Slave Address)를 갖고 있으며 마스터 IC(10)가 특정 슬레이브(Slave) IC와 통신을 하고자 할 때는 상기 해당 슬레이브(Slave) IC의 고유 주소(Slave Address)를 이용하여 송수신을 하게 된다. 즉 도 2에서와 같이 고유주소(Slave Address)가 "88h"인 슬레이브 IC의 데이터 전송 포멧을 이용하여 상세히 설명한다. 도면에는 쓰기모드(Write Mode)와 읽기모드(Read Mode)로 구분되어 있다. 음영친 부분의 대문자들은 I2C버스 프로토콜로 데이터를 송수신하기 위하여 마스터(Master) IC(10)와 슬레이브(Slave) IC(20~n)간에 서로 주고 받는 약속의 신호들이다. 즉, "S"의 표기는 송수신을 하기 위한 스타트 컨디션(Start Condition)으로써 마스터(Master) IC가 클럭라인(SCL)을 "high level"로 유지하면서 데이터라인(SDA)을 "high level"에서 "low level"로 변화시키면 송수신을 시작하자는 의미의 신호가 되는 것이다. 표기 "A"는 데이터를 주고 받을 때 상대측에서 인식(Acknowledgment)했다는 신호이며 "P" 표기는 송수신을 중단하기 위한 스탑 컨디션(Stop Condition)으로써 "Acknowledgment" 와 동시에 Master IC가 클럭라인(SCL)을 "high level"로 유지하면서 데이터라인(SDA)을 "low level"에서 "high level"로 변화시키면 송수신을 종료하자는 의미의 신호가 되는 것이다.1 is a general interface circuit of the I2C bus protocol. The I2C bus protocol is composed of a master IC 10 and slave ICs 20 to n, and a data line SDA of the master IC 10; ) And the data lines 21 to n1 of the slave ICs 20 to n are interconnected. In addition, the clock line (SCL) 12 of the master IC 10 and the clock lines 22 to n2 of the slave ICs 20 to n are connected to each other, and each of the lines 30 includes a resistor 30 connected to the power line. It is connected. The slave ICs 20 to n each have a unique address, and when the master IC 10 wants to communicate with a specific slave IC, a unique address of the corresponding slave IC (Slave). Send / Receive using Address). That is, as shown in Figure 2 will be described in detail by using the data transmission format of the slave IC having a unique address (Slave Address) "88h". The drawing is divided into a write mode and a read mode. The upper case letters in the shaded portion are promise signals that are exchanged between the master IC 10 and the slave ICs 20 to n to transmit and receive data through the I2C bus protocol. In other words, the notation "S" is a start condition for transmitting and receiving. The master IC maintains the clock line SCL at "high level" while the data line SDA is "high level" at " "Low level" is a signal to start transmitting and receiving. The notation "A" is a signal that the other party acknowledged (Acknowledgment) when sending and receiving data. The "P" notation is a stop condition for stopping transmission and reception. If the data line SDA is changed from "low level" to "high level" while maintaining the "high level", it is a signal meaning to end transmission and reception.

또한, 데이터의 전송은 클럭라인(SCL)을 "low level"에서 "high level"로 변화시키면서 데이터라인(SDA)의 값을 유지하면 되는 것이다. 통상 데이터 전송은 9 비트(bits)단위로 수행되며 8 비트의 데이터와 1 비트의 인식신호(Acknowledgment)인 "A"로 구성된다. 즉, 선택된 Slave IC가 데이터의 9 비트째를 수신할 때 데이터라인(SDA)을 "low level"로 유지하여 데이터를 송수신하였다는 인식신호(Acknowledgment)인 "A"를 Master IC로 송신하면 정상적으로 데이타의 송수신이 이루어졌음을 인식하게 되는 것이다.In addition, the data transfer may be performed by changing the clock line SCL from "low level" to "high level" while maintaining the value of the data line SDA. In general, data transmission is performed in units of 9 bits and consists of 8 bits of data and 1 bit of acknowledgment "A". That is, when the selected slave IC receives the ninth bit of data, if it transmits the acknowledgment signal "A" to the master IC to keep the data line SDA at "low level" and transmit and receive data, the data is normally transmitted. It will be recognized that the transmission and reception of.

표기 "W"는 쓰기 모드(Write Mode)신호이며 해당 비트를 "low level"로 표시하며 표기 "R"는 읽기모드(Read Mode)신호로서 통상 해당 비트를 "high level"로 표시하여 송수신하는 것이다.The notation "W" is a write mode signal and the corresponding bit is displayed as "low level", and the notation "R" is a read mode signal and the corresponding bit is marked as "high level" to transmit and receive. .

먼저 쓰기모드(Write Mode)에 대하여 설명한다. 고유주소(Slave Address)가"88h"인 슬레이브 IC를 호출하고 상기 슬레이브 IC의 "5"번지에 "31"이라는 데이터를 저장하는 것을 일례로 설명한다. 먼저 통신을 갯하기 위하여 매스터IC(10)는 스타트 컨디션(Start Condition)을 생성하고 8비트 주소(Slave address)란에 해당되는 "88h"라는 데이터를 입력하여 고유주소가 "88h"인 슬레이브 IC가 선택되도록 하다. 그 다음 데이터를 저장한다는 "low level"의 "W"신호를 입력하여 클럭에 동기하여 전송한다. 고유주소가 "88h"인 슬레이브 IC가 응답을 하게 되며 그 응답은 상기 데이터를 수신하였다는 인식신호(Acknowledge)인 "A"신호를 전송한다. 상기 인식신호(Acknowledge)인 "A"신호를 받은 매스터 IC는 이후 데이터를 저장할 주소인 5번지를 지정하여 송신하게 되고, 상기 슬레이브 IC로부터 인식신호(Acknowledge)인 "A"신호를 확인하여 송신여부를 판단한다. 그런 다음 저장할 데이터에 해당하는 값(31h)을 송신하고 다시 인식신호(Acknowledge)인 "A"신호를 확인하는 것이다. 즉, 송신측과 수신측이 상호 데이터를 송신하면 상대측으로부터 인식신호(Acknowledge)인 "A"신호를 수신하여 정상적으로 신호가 송수신되었음을 확인하는 것이다. 상기 단계에서 데이터를 전송받은 슬레이브 IC는 전송된 데이터값(31h)을 내장된 레지스터의 지정 주소인 5번지 주소에 저장하는 것이다. 모든 데이터의 송수신이 완료되면 스톱 컨디션(Stop Condition)으로 데이터의 전송을 종료하게 된다.First, the write mode will be described. An example will be described in which a slave IC having a slave address of "88h" is called and data "31" is stored at address "5" of the slave IC. First, in order to enable communication, the master IC 10 generates a start condition and inputs data of "88h" corresponding to an 8-bit slave address field so that a slave IC having a unique address of "88h" To be chosen. Next, input the "low level" signal "W" to store data and transmit it in synchronization with the clock. The slave IC with the unique address "88h" responds, and the response transmits an "A" signal, which is an acknowledgment that the data has been received. The master IC receiving the "A" signal, which is the acknowledgment signal, transmits by designating address 5, which is an address to store data thereafter, and checks whether the "A" signal, which is the acknowledgment signal, is transmitted from the slave IC. Judge. Then, the value 31h corresponding to the data to be stored is transmitted, and the acknowledgment signal "A" is confirmed again. That is, when the transmitting side and the receiving side transmit data to each other, it receives the "A" signal, which is an acknowledgment signal, from the other side to confirm that the signal has been normally transmitted and received. The slave IC receiving the data in the above step stores the transmitted data value 31h at address 5 of the designated address of the built-in register. When all data transmission and reception is completed, the data transmission is terminated in a stop condition.

읽기모드(Read Mode)에 대하여 설명한다. 매스터 IC가 다시 슬레이브 IC로부터 지정된 주소에 저장된 데이터를 읽어오는 과정이다. 먼저 매스터 IC가 스타트 컨디션(Start Condition)을 생성하고 고유주소(Slave address)란에 "88h"라는 데이터를 입력하고 "W"신호를 송신한 다음 인식신호(Acknowledge)인 "A"신호를 받고 데이터가 저장되어 있는 주소인 5번지를 지정하게 된다. 매스터 IC는 인식신호(Acknowledge)인 "A"신호를 확인하고 스탑 컨디션(Stop Condition)으로 데이터의 전송을 종료하게 되면 지정된 슬레이브 IC는 해당되는 주소와 함께 그 주소에 저장된 데이터를 읽어 전송한다는 "high level"의 "R"신호를 전송하게 되면 매스터 IC는 주소가 일치한다는 인식신호(Acknowledge)인 "A"신호를 전송하게 된다. 매스터 IC로부터 인식신호(Acknowledge)를 전송받은 슬레이브 IC는 해당 주소에 저장되어 있는 데이터값(31h)을 레지스터에서 독취하여 전송을 하게 되고 스탑 컨디션(Stop Condition)으로 데이터의 전송을 완료하게 되는 것이다.The read mode will be described. The master IC reads back the data stored at the specified address from the slave IC. First, the master IC generates a start condition, inputs the data "88h" into the slave address field, transmits the "W" signal, receives the "A" signal, which is an acknowledgment signal, and the data. Designate address 5 which is stored address. The master IC checks the "A" signal, which is an acknowledgment signal, and terminates data transfer in the stop condition. The designated slave IC reads and transmits the data stored at the address along with the corresponding address. When transmitting the "R" signal of "level", the master IC transmits the "A" signal, which is an acknowledgment that the address matches. The slave IC receiving the acknowledgment signal from the master IC reads the data value 31h stored in the corresponding address from the register and transmits the data, and completes the data transfer in the stop condition.

상기와 같은 I2C버스 프로토콜을 이용한 양방향 통신은 1개의 매스터 IC가 여러개의 슬레이브 IC들과 필요한 통신을 하기에는 편리한 방식이다. 슬레이브 IC를 지정하고 특정한 주소에 데이터를 저장할 수도 있으며 미리 약속된 주소에 저장되어 있는 데이터를 읽어올 수도 있다. 즉, 각 슬레이브 IC들이 수집한 정보들을 매스터 IC가 임의로 호출하여 사용할 수가 있다는 장점때문이다. 또한, 공용의 클럭라인과 데이터라인만을 사용하므로 시스템이 간단해진다는 장점이 있다.Bidirectional communication using the I2C bus protocol as described above is a convenient way for one master IC to communicate with several slave ICs. You can designate a slave IC, store data at a specific address, or read data stored at a pre-defined address. That is, the master IC can arbitrarily call and use the information collected by each slave IC. In addition, there is an advantage that the system is simplified because only the common clock line and data line are used.

그러나 상기의 I2C버스 프로토콜은 매스터 IC만 슬레이브 IC를 호출할 수 있다는 단점을 갖고 있다. 슬레이브 IC들은 필요한 경우 매스터 IC를 호출할 수 없기때문에 진정한 양방향 통신이 될 수가 없는 것이다. 필요한 경우 슬레이브 IC들이 매스터 IC를 호출할 수가 없기때문에 항상 매스터 IC가 동작해 주기를 기다려야만 하는 문제가 발생하는 것이다.However, the I2C bus protocol has a disadvantage in that only the master IC can call the slave IC. Slave ICs cannot call the master IC when needed, so there is no true bidirectional communication. If necessary, the slave ICs cannot call the master IC, which causes a problem of waiting for the master IC to operate.

본 발명은 상기한 문제점을 해결하기 위한 것으로서, 2개의 CPU를 사용하는 임베디드(Embedded) 시스템에서 I2C버스 프로토콜을 이용하여 슬레이브 IC도 매스터로 지정된 CPU나 IC를 호출하여 필요한 정보를 송수신할 수 있는 장치를 제공하고자 하는 것이다.An object of the present invention is to solve the above problems, an apparatus capable of transmitting and receiving necessary information by calling a CPU or IC designated as a master using a I2C bus protocol in an embedded system using two CPUs. Is to provide.

도 1은 I2C 버스 프로토콜의 일반적인 인터페이스회로,1 is a general interface circuit of the I2C bus protocol,

도 2는 고유주소(Slave Address)가 "88h"인 슬레이브 IC의 데이터 전송 포멧,2 is a data transmission format of a slave IC having a slave address of "88h";

도 3은 본발명의 일실시예에 따른 임베디드 시스템의 양방향 데이터 통신장치의 블럭도, 그리고3 is a block diagram of an apparatus for bidirectional data communication in an embedded system according to an embodiment of the present invention; and

도 4는 도 4는 본 발명의 일 실시예에 따른 임베디드 시스템의 양방향 데이터 통신장치를 설명하기 위한 흐름도이다.4 is a flow chart illustrating a bidirectional data communication apparatus of the embedded system according to an embodiment of the present invention.

*도면의 주요 부분에 대한 부호 설명** Description of symbols on the main parts of the drawings *

100 : 매스터 IC 120 : 호출신호입력단자100: master IC 120: call signal input terminal

200 : 슬레이브 IC 220 : 호출신호출력단자200: slave IC 220: call signal output terminal

221 : 호출신호221: call signal

상기와 같은 목적을 달성하기 위한 본 발명에 따른 임베디드 시스템의 양방향 데이터 통신장치의 바람직한 일실시예로는 I2C버스 프로토콜을 이용하여 쌍방간에 데이터 통신을 행하는 직렬데이터 통신장치에 있어서, 매스터 IC, 슬레이브 IC, 상기 매스터 IC와 슬레이브 IC를 I2C버스 프로토콜로 통신이 이루어지게 하는 데이터라인과 클럭라인등으로 구성된 통신라인 및 상기 슬레이브 IC가 상기 매스터 IC를 호출하기 위한 호출신호로 구성하여 상기 매스터IC와 슬레이브IC가 상호 호출을 할 수 있도록 하여 양방향 데이터 통신이 가능하도록 한다.A preferred embodiment of the bidirectional data communication device of the embedded system according to the present invention for achieving the above object is a master IC, a slave IC in the serial data communication device for performing data communication between both sides using the I2C bus protocol The master IC and the slave IC are configured by a communication line including a data line and a clock line for communication between the master IC and the slave IC using an I2C bus protocol, and a call signal for the slave IC to call the master IC. Two-way data communication is possible.

상기 슬레이브IC로부터 상기 호출신호를 수신한 매스터IC는 슬레이브IC를 호출하도록 데이터를 출력하고, 상기 매스터 IC는 I2C버스 프로토콜을 이용하여 슬레이브 IC를 호출하고 상기 슬레이브 IC가 상기 매스터 IC를 호출하고자 하는 경우에는 먼저 상기 슬레이브 IC가 인터럽트신호를 매스터 IC로 전송하고 상기 인터럽트신호를 전송받은 매스터 IC가 I2C버스 프로토콜을 이용하여 슬레이브 IC를 호출하도록 하는 것을 특징으로 하여 이루어지는 것이다.When the master IC receiving the call signal from the slave IC outputs data to call the slave IC, the master IC calls the slave IC using the I2C bus protocol, and the slave IC intends to call the master IC. First, the slave IC transmits an interrupt signal to the master IC, and the master IC receiving the interrupt signal calls the slave IC using the I2C bus protocol.

바람직하게는 상기 슬레이브IC는 매스터IC로 동작되기 위한 프로그램이 추가되어 있으며 상기 매스터 IC는 슬레이브 IC로 동작되기 위한 프로그램이 더 추가되어 있는 것을 특징으로 하며 상기 슬레이브IC로부터 상기 응답요청신호를 수신한 매스터IC는 슬레이브IC로 전환되고 상기 슬레이브IC는 매스터IC로 전환되어 상호 데이터를 송수신하게하여 양방향 통신이 가능하도록 하는 것이다.Preferably, the slave IC has a program for operating as a master IC, and the master IC further includes a program for operating as a slave IC, and the master receiving the response request signal from the slave IC. The IC is switched to the slave IC and the slave IC is converted to the master IC to transmit and receive data to each other to enable bidirectional communication.

또한, 상기와 같은 목적을 달성하기 위한 본 발명에 따른 임베디드 시스템의 양방향 데이터 통신방법으로서는 매스터 IC와 슬레이브 IC간에 I2C버스 프로토콜에 의하여 통신이 이루어지는 임베디드 시스템에 있어서, 슬레이브 IC가 매스터 IC를 호출하는 단계, 매스터 IC가 인터럽트를 발생하는 단계 및 매스터 IC가 I2C버스 프로토콜을 사용하여 슬레이브 IC와 데이터를 송수신하는 단계로 이루어진다.In addition, the bidirectional data communication method of the embedded system according to the present invention for achieving the above object, in the embedded system in which the communication between the master IC and the slave IC by the I2C bus protocol, the slave IC calling the master IC The master IC generates an interrupt and the master IC transmits and receives data to and from the slave IC using the I2C bus protocol.

매스터 IC를 호출하는 단계는 슬레이브 IC가 호출신호를 매스터 IC로 출력하여 이루어지도록 한다.The calling of the master IC is performed by the slave IC outputting the call signal to the master IC.

또한, 상기와 같은 목적을 달성하기 위한 본 발명에 따른 임베디드 시스템의 양방향 데이터 통신방법의 다른 실시예로서는 통상의 매스터 IC의 기능 및 가상의 슬레이브 IC의 기능을 갖는 매스터 IC와 통상의 슬레이브 IC의 기능 및 가상의 매스터 IC의 기능을 갖는 슬레이브 IC간에 I2C버스 프로토콜에 의하여 통신이 이루어지는 임베디드 시스템에 있어서, 슬레이브 IC가 매스터 IC를 호출하는 단계, 상기 매스터 IC가 가상 슬레이브 IC로 그 기능이 전환되고 상기 슬레이브 IC가 가상 매스터 IC로 그 기능을 전환하는 단계 및 상기 전환단계 후 상기 가상 매스터 IC가 I2C버스 프로토콜을 사용하여 상기 가상 슬레이브 IC와 데이터를 송수신하는 단계로 이루어진다.In addition, another embodiment of the bidirectional data communication method of the embedded system according to the present invention for achieving the above object is the function of the master IC and the normal slave IC having the function of the normal master IC and the virtual slave IC and An embedded system in which communication is performed by an I2C bus protocol between slave ICs having a function of a virtual master IC, wherein the slave IC calls a master IC, the master IC switches its function to a virtual slave IC, and the slave IC Switching the function to the virtual master IC, and after the switching, the virtual master IC transmits and receives data to and from the virtual slave IC using an I2C bus protocol.

상기 가상 매스터 IC와 상기 가상 슬레이브 IC간에 데이터 송수신이 완료된 상태에서는 각각 슬레이브 IC와 매스터 IC로 복귀되는 단계를 더 포함하여 이루어진다.The method may further include returning to the slave IC and the master IC in the state where data transmission / reception is completed between the virtual master IC and the virtual slave IC.

이하 첨부한 도면을 참고하여 본 발명의 일실시예에 대하여 상세히 설명하기로 한다.Hereinafter, an embodiment of the present invention will be described in detail with reference to the accompanying drawings.

도 3은 본발명의 일실시예에 따른 임베디드 시스템의 양방향 데이터 통신장치의 블럭도이다. 매스터 IC(100)는 I2C버스 프로토콜로 통신하기 위한 I2C 인터페이스부(I2C I/F;110)와 슬레이브 IC(200)가 매스터IC(100)의 인터럽트를 요청하는 호출신호 입력단자(120)로 구성되어 있으며 슬레이브 IC(200)는 I2C버스 프로토콜로 통신하기 위한 I2C 인터페이스부(I2C I/F;210)와 슬레이브 IC(200)가 매스터IC(100)를 호출하기 위한 호출신호 출력단자(220)로 구성된다. 또한, 매스터 IC(100)와 슬레이브 IC(200)는 I2C 인터페이스부(I2C I/F;110,210)를 통하여 데이타라인(SDA;240)과 클럭라인(SCL;230)이 상호 연결되어 있다.3 is a block diagram of an apparatus for bidirectional data communication in an embedded system according to an embodiment of the present invention. The master IC 100 includes an I2C interface unit (I2C I / F) 110 for communicating with the I2C bus protocol and a call signal input terminal 120 for which the slave IC 200 requests an interrupt of the master IC 100. The slave IC 200 is connected to the I2C interface unit (I2C I / F) 210 for communicating with the I2C bus protocol and the call signal output terminal 220 for the slave IC 200 to call the master IC 100. It is composed. In addition, the master IC 100 and the slave IC 200 have a data line (SDA) 240 and a clock line (SCL) 230 connected to each other through an I 2 C interface unit (I 2 C I / F) 110 and 210.

상기한 구성에서 I2C 버스 프로토콜을 이용한 데이터 송수신방법은 종래의 기술과 동일하므로 그 설명은 생략하고 도 4를 참조하여 본발명의 일실시예에 따른 동작에 대하여 설명한다.Since the data transmission and reception method using the I2C bus protocol in the above configuration is the same as the conventional technology, the description thereof will be omitted and operation according to an embodiment of the present invention will be described with reference to FIG. 4.

도 4는 본 발명의 일 실시예에 따른 임베디드 시스템의 양방향 데이터 통신장치를 설명하기 위한 흐름도이다4 is a flowchart illustrating a bidirectional data communication apparatus of an embedded system according to an exemplary embodiment of the present invention.

먼저 통상의 매스터 IC(100)가 슬레이브 IC(200)를 호출하여 기존의 I2C 버스 프로토콜로 양방향통신을 하다가 슬레이브 IC(200)가 매스터IC(100)를 호출할필요가 발생한 경우 슬레이브 IC(200)는 호출신호 출력단자(220)를 통하여 호출신호(221)를 출력하게 되고(단계 S310) 호출신호 입력단자(120)를 통하여 호출신호(221)를 수신한 매스터 IC(100)는 인터럽트를 발생하여(단계 S320) 슬레이브 IC(200)와 통신을 할 준비를 하기 위하여 실행하던 프로그램을 일시 중지하고 I2C 인터페이스부(I2C I/F;110,210)를 통하여 호출한 슬레이브 IC를 호출하는 것이다(단계 S330). 이하 통상적인 I2C 프로토콜을 사용하여 상기 슬레이브 IC(200)의 모든 어드레스에 데이터를 저장하기 위하여 모든 데이터를 전부 전송하게 되는 것이다. 전송이 완료되었는지를 판단하여(단계 S340) 데이터 전송이 완료되지 않은 경우는 완료될 때까지 전송을 계속하고 데이타 전송이 완료되었거나 상기 단계 S310에서 호출신호가 수신되지 않은 경우는 송수신을 종료하는 것이다. 바람직하게는 슬레이브 IC(200)로 부터 호출신호(221)가 수신된 경우는 매스터 IC가 슬레이브 IC의 일정 어드레스에 데이터를 저장하는 것으로 미리 프로그램되어 있으면 모든 데이터를 전송할 필요없이 간단하고도 신속하게 슬레이브 IC가 필요한 데이터를 얻을 수가 있는 것이다.First, when the master IC 100 calls the slave IC 200 to perform bidirectional communication using the existing I2C bus protocol, the slave IC 200 needs to call the master IC 100. Outputs the call signal 221 through the call signal output terminal 220 (step S310) and the master IC 100 receiving the call signal 221 through the call signal input terminal 120 generates an interrupt; (Step S320) Pause the program that was executed to prepare for communication with the slave IC 200 and call the slave IC called through the I2C interface (I2C I / F) 110,210 (step S330). Hereinafter, all data are transmitted in order to store data at all addresses of the slave IC 200 using a conventional I2C protocol. If it is determined that the transmission is completed (step S340), if the data transmission is not completed, the transmission continues until completion, and if the data transmission is completed or the call signal is not received in the step S310, transmission and reception are terminated. Preferably, when the call signal 221 is received from the slave IC 200, if the master IC is pre-programmed to store data at a predetermined address of the slave IC, the slave simply and quickly does not need to transmit all the data. The IC can get the data it needs.

도 5는 본 발명의 다른 실시예에 따른 임베디드 시스템의 양방향 데이터 통신장치를 설명하기 위한 흐름도이다5 is a flowchart illustrating a bidirectional data communication apparatus of an embedded system according to another exemplary embodiment of the present invention.

먼저 통상의 매스터 IC(100)가 슬레이브 IC(200)를 호출하여 기존의 I2C 버스 프로토콜로 양방향통신을 하다가 슬레이브 IC(200)가 매스터IC(100)를 호출할 필요가 발생한 경우 슬레이브 IC(200)는 호출신호 출력단자(220)를 통하여 호출신호(221)를 출력하게 되면(단계 S410) 호출신호 입력단자(120)를 통하여호출신호(221)를 수신한 매스터 IC(100)는 인터럽트를 발생하고(단계 S420) 슬레이브 IC(200)와 통신을 할 준비를 하기 위하여 매스터 IC(100)는 슬레이브 IC로 전환되고 슬레이브 IC(200)는 매스터 IC로 그 기능을 전환한다(단계 S430). 본실시예에서는 매스터 IC와 슬레이브 IC는 상기 호출신호의 송수신에 의하여 각각 슬레이브 IC와 매스터 IC로 그 기능이 전환될 수 있도록 프로그램되어 있는 경우이다. 상기 단계 430에서 모드가 전환된 경우에는 호출신호를 발송한 슬레이브 IC(200)가 매스터 IC의 기능을 수행하고 종전의 매스터 IC(100)는 슬레이브 IC로 그 기능을 전환하여 I2C 버스 프로토콜을 이용하여 데이터 송수신을 하게 되는 것이다. 데이터 송수신이 완료되었는 지를 판단하여(단계 S440) 완료되지 않은 경우는 계속하여 송수신하고 완료된 경우에는 데이터의 송수신을 종료하게 되는 것이다.First, when the master IC 100 calls the slave IC 200 to perform bidirectional communication using the existing I2C bus protocol, and the slave IC 200 needs to call the master IC 100, the slave IC 200 When the call signal 221 is output through the call signal output terminal 220 (step S410), the master IC 100 receiving the call signal 221 through the call signal input terminal 120 generates an interrupt. (Step S420) In order to prepare for communication with the slave IC 200, the master IC 100 is switched to the slave IC and the slave IC 200 switches its function to the master IC (step S430). In this embodiment, the master IC and the slave IC are programmed so that their functions can be switched to the slave IC and the master IC by the transmission and reception of the call signal, respectively. When the mode is switched in step 430, the slave IC 200 that has sent the call signal performs the function of the master IC, and the previous master IC 100 switches its function to the slave IC by using the I2C bus protocol. You will be sending and receiving data. It is determined whether or not the data transmission and reception is completed (step S440). If it is not completed, the transmission and reception continues, and when it is completed, the transmission and reception of data is terminated.

이상에서 본 발명은 기재된 구체예에 대해서만 상세히 설명되었지만 본 발명의 기술사상 범위 내에서 다양한 변형 및 수정이 가능함은 당업자에게 있어서 명백한 것이며, 이러한 변형 및 수정이 첨부된 특허 청구범위에 속함은 당연한 것이다.While the invention has been described in detail only with respect to the described embodiments, it will be apparent to those skilled in the art that various modifications and variations are possible within the spirit of the invention, and such modifications and variations belong to the appended claims.

상기에서와 같이 본 발명에 따른 임베디드 시스템의 양방향 데이터 통신장치 및 그 방법에 의하면, 슬레이브 IC들도 필요한 경우 매스터 IC를 호출할 수 있도록 하여 매스터로 지정된 CPU나 IC를 호출하여 필요한 정보를 송수신할 수 있도록 하는 효과가 있는 것이다.As described above, according to the bidirectional data communication apparatus and method of the embedded system according to the present invention, the slave ICs can also call the master IC when necessary so that the CPU or IC designated as the master can be called to transmit and receive necessary information. It is effective to ensure that.

Claims (9)

I2C버스 프로토콜을 이용하여 쌍방간에 데이터 통신을 행하는 직렬데이터 통신장치에 있어서,In the serial data communication apparatus which performs data communication between both sides using I2C bus protocol, 매스터 IC;와Master IC; and 슬레이브 IC;와Slave IC; and 상기 매스터 IC와 슬레이브 IC를 I2C버스 프로토콜로 통신이 이루어지게 하는 데이터라인 및 클럭라인등으로 구성된 통신라인; 및A communication line including a data line and a clock line for communicating the master IC and the slave IC with an I2C bus protocol; And 상기 슬레이브 IC가 상기 매스터 IC를 호출하기 위한 호출신호;로 구성하여 상기 매스터IC와 슬레이브IC가 상호 호출을 할 수 있도록 양방향 데이터 통신이 가능한.And a call signal for calling the master IC by the slave IC; and enabling bidirectional data communication so that the master IC and the slave IC can mutually call each other. 제 1항에 있어서,The method of claim 1, 상기 슬레이브IC로부터 상기 호출신호를 수신한 매스터IC는 슬레이브IC를 호출하도록 데이터를 출력하는 것을 특징으로 하는 임베디드 시스템의 양방향 데이터 통신장치.The master IC receiving the call signal from the slave IC outputs data to call the slave IC. 제 2항에 있어서, 상기 양방향 데이터통신은The method of claim 2, wherein the bidirectional data communication 상기 매스터 IC는 I2C버스 프로토콜을 이용하여 슬레이브 IC를 호출하고 상기 슬레이브 IC가 상기 매스터 IC를 호출하고자 하는 경우에는 먼저 상기 슬레이브 IC가 인터럽트신호를 매스터 IC로 전송하고 상기 인터럽트신호를 전송받은 매스터 IC가 I2C버스 프로토콜을 이용하여 슬레이브 IC를 호출하도록 하는 것을 특징으로하는 임베디드 시스템의 양방향 데이터 통신장치.When the master IC calls the slave IC using the I2C bus protocol and the slave IC wants to call the master IC, the master IC first transmits an interrupt signal to the master IC and then the master IC receives the interrupt signal. A bidirectional data communication device of an embedded system, characterized by calling a slave IC using an I2C bus protocol. 제 1항에 있어서,The method of claim 1, 상기 슬레이브IC는 매스터IC로 동작되기 위한 프로그램이 추가되어 있으며 상기 매스터 IC에는 슬레이브 IC로 동작되기 위한 프로그램이 추가되어 있는 것을 특징으로 하는 임베디드 시스템의 양방향 데이터 통신장치.The slave IC has a program for operating as a master IC is added, the master IC is a bidirectional data communication device of an embedded system, characterized in that a program for operating as a slave IC is added. 제 4항에 있어서,The method of claim 4, wherein 상기 슬레이브IC로부터 상기 호출신호를 수신한 매스터IC는 슬레이브IC로 전환되고 상기 슬레이브IC는 매스터IC로 전환되어 상호 데이터를 송수신하는 것을 특징으로 하는 임베디드 시스템의 양방향 데이터 통신장치.The master IC receiving the call signal from the slave IC is switched to the slave IC and the slave IC is converted to the master IC to transmit and receive data with each other. 매스터 IC와 슬레이브 IC간에 I2C버스 프로토콜에 의하여 통신이 이루어지는 임베디드 시스템에 있어서,In an embedded system in which communication is performed between the master IC and the slave IC by the I2C bus protocol, 슬레이브 IC가 매스터 IC를 호출하는 단계;Calling the master IC by the slave IC; 매스터 IC가 인터럽트를 발생하는 단계; 및The master IC generating an interrupt; And 매스터 IC가 I2C버스 프로토콜을 사용하여 슬레이브 IC와 데이터를 송수신하는 단계;로 이루어지는 임베디드 시스템의 양방향 데이터 통신방법.And a master IC transmitting and receiving data to and from a slave IC using an I2C bus protocol. 2. 제 6항에 있어서, 매스터 IC를 호출하는 단계는7. The method of claim 6, wherein invoking the master IC 슬레이브 IC가 호출신호를 매스터 IC로 출력하여 이루어지는 것을 특징으로 하는 임베디드 시스템의 양방향 데이터 통신방법.Bidirectional data communication method of an embedded system, characterized in that the slave IC outputs the call signal to the master IC. 통상의 매스터 IC의 기능 및 가상의 슬레이브 IC의 기능을 갖는 매스터 IC와 통상의 슬레이브 IC의 기능 및 가상의 매스터 IC의 기능을 갖는 슬레이브 IC간에 I2C버스 프로토콜에 의하여 통신이 이루어지는 임베디드 시스템에 있어서,In an embedded system in which communication is carried out by an I2C bus protocol between a master IC having a function of a normal master IC and a function of a virtual slave IC and a slave IC having a function of a normal master IC and a function of a virtual master IC. 슬레이브 IC가 매스터 IC를 호출하는 단계;Calling the master IC by the slave IC; 상기 매스터 IC가 가상 슬레이브 IC로 그 기능이 전환되고 상기 슬레이브 IC가 가상 매스터 IC로 그 기능을 전환하는 단계;The master IC switching its function to a virtual slave IC and the slave IC switching its function to a virtual master IC; 상기 전환단계 후 상기 가상 매스터 IC가 I2C버스 프로토콜을 사용하여 상기 가상 슬레이브 IC와 데이터를 송수신하는 단계;로 이루어지는 임베디드 시스템의 양방향 데이터 통신방법.And transmitting and receiving data to and from the virtual slave IC by using the I2C bus protocol by the virtual master IC after the switching step. 2. 제 8항에 있어서,The method of claim 8, 상기 가상 매스터 IC와 상기 가상 슬레이브 IC간에 데이터 송수신이 완료된 상태에서는 각각 슬레이브 IC와 매스터 IC로 복귀되는 단계;를 더 포함하는 것을 특징으로 하는 임베디드 시스템의 양방향 데이터 통신방법.And returning to the slave IC and the master IC, respectively, when data transmission / reception is completed between the virtual master IC and the virtual slave IC.
KR1020030013820A 2003-03-05 2003-03-05 Bidirectional data transmission apparatus and the method thereof for embedded system KR100962306B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030013820A KR100962306B1 (en) 2003-03-05 2003-03-05 Bidirectional data transmission apparatus and the method thereof for embedded system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030013820A KR100962306B1 (en) 2003-03-05 2003-03-05 Bidirectional data transmission apparatus and the method thereof for embedded system

Publications (2)

Publication Number Publication Date
KR20040078972A true KR20040078972A (en) 2004-09-14
KR100962306B1 KR100962306B1 (en) 2010-06-10

Family

ID=37364044

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030013820A KR100962306B1 (en) 2003-03-05 2003-03-05 Bidirectional data transmission apparatus and the method thereof for embedded system

Country Status (1)

Country Link
KR (1) KR100962306B1 (en)

Also Published As

Publication number Publication date
KR100962306B1 (en) 2010-06-10

Similar Documents

Publication Publication Date Title
US20020108011A1 (en) Dual interface serial bus
US5958024A (en) System having a receive data register for storing at least nine data bits of frame and status bits indicating the status of asynchronous serial receiver
KR20040076730A (en) Serial communication interface apparatus of hybrid type adaptable to high peformance wireless lan and method of the same
US5896549A (en) System for selecting between internal and external DMA request where ASP generates internal request is determined by at least one bit position within configuration register
KR100229897B1 (en) The timing mode selecting apparatus for dma transferring method
KR100962306B1 (en) Bidirectional data transmission apparatus and the method thereof for embedded system
KR20070102823A (en) Device for controlling address in a i2c protocol
KR100361511B1 (en) Multi-Function Serial Communication Interface Device
JP3134821B2 (en) Communications system
US6105081A (en) UART character matching used for address matching on a register-by-register basis
JP2004334551A (en) Serial communication system and local terminal for serial communication
KR100584583B1 (en) Apparatus and method controlling a serial bus
KR100295683B1 (en) General call acknowledge apparatus and method for inter-integrated circuit
JP2639248B2 (en) Communication interface device
JPH10207834A (en) Serial input/output circuit
US6311235B1 (en) UART support for address bit on seven bit frames
CN114880270A (en) SPI equipment and data transmission method thereof
JPH0879225A (en) Data communication system and data communication method
JP2005251095A (en) Usb device
JPH04107595A (en) Display system
JPH07319841A (en) Serial control device
JP2002024168A (en) Serial data transfer device
KR20050107159A (en) Bus controller for serial interface of system
JPH08265393A (en) Serial communication method and serial communication controller
KR20010106988A (en) Clock signal controling method of inter integrated circuit control device

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
N231 Notification of change of applicant
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20130530

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20140522

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20150526

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee