[go: up one dir, main page]

KR100584583B1 - Serial bus control device and method - Google Patents

Serial bus control device and method Download PDF

Info

Publication number
KR100584583B1
KR100584583B1 KR1020030079166A KR20030079166A KR100584583B1 KR 100584583 B1 KR100584583 B1 KR 100584583B1 KR 1020030079166 A KR1020030079166 A KR 1020030079166A KR 20030079166 A KR20030079166 A KR 20030079166A KR 100584583 B1 KR100584583 B1 KR 100584583B1
Authority
KR
South Korea
Prior art keywords
nth
predetermined
main processor
device data
serial bus
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
KR1020030079166A
Other languages
Korean (ko)
Other versions
KR20050045195A (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 KR1020030079166A priority Critical patent/KR100584583B1/en
Publication of KR20050045195A publication Critical patent/KR20050045195A/en
Application granted granted Critical
Publication of KR100584583B1 publication Critical patent/KR100584583B1/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

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
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • G06F13/1673Details of memory controller using buffers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

직렬 버스 제어 장치 및 방법이 개시된다. 이 장치는 제1 내지 제n 슬레이브 디바이스들에서 각각 생성된 제1 내지 제n 디바이스 데이터들을 수신하여 저장하는 링 버퍼, 제1 내지 제n 슬레이브 디바이스들 중 소정 슬레이브 디바이스에 대한 메인 프로세서의 액세스 요구에 의해, 메인 프로세서로부터 수신된 프로세스 데이터 또는 소정 슬레이브 디바이스에서 수신된 소정 디바이스 데이터를 저장하는 직접 엑세스 버퍼 및 링 버퍼 및 직접 엑세스 버퍼와 제1 내지 제n 슬레이브 디바이스들 사이에서 제1 내지 제n 데이터들 또는 프로세스 데이터를 송수신하는 인터페이스 제어부를 구비하는 것을 특징으로 한다. 따라서, 본 발명에 따르면, 메인 프로세서의 슬레이브 디바이스들에 대한 접근 요구가 없어도, 메인 프로세서와 슬레이브 디바이스들 사이에 위치한 직렬 버스 제어장치에 슬레이브 디바이스들에 대한 데이터를 주기적으로 저장하도록 함으로써, 직렬 버스의 제어에 관련된 메인 프로세서의 작업을 줄이고 소프트웨어의 구조를 단순화 할 수 있다.A serial bus control apparatus and method are disclosed. The apparatus includes a ring buffer for receiving and storing first to nth device data generated by the first to nth slave devices, respectively, and an access request of a main processor to a predetermined slave device among the first to nth slave devices. Thereby, the first to nth data between the direct access buffer and the ring buffer and the direct access buffer and the first to nth slave devices for storing the process data received from the main processor or the predetermined device data received at the predetermined slave device. Or an interface controller for transmitting and receiving process data. Therefore, according to the present invention, even if there is no request for access to the slave devices of the main processor, by periodically storing the data for the slave devices in the serial bus controller located between the main processor and the slave devices, It can reduce the work of the main processor involved in the control and simplify the structure of the software.

Description

직렬 버스 제어 장치 및 방법{Apparatus and method controlling a serial bus}Apparatus and method controlling a serial bus

도 1은 직렬 버스 제어 장치가 메인 프로세서와 복수의 슬레이브 디바이스들 과 함께 연결된 상태를 나타내는 블록도이다. 1 is a block diagram illustrating a state in which a serial bus control apparatus is connected with a main processor and a plurality of slave devices.

도 2는 본 발명에 의한 직렬 버스 제어 장치를 설명하기 위한 일 실시예의 블록도이다.Figure 2 is a block diagram of one embodiment for explaining a serial bus control apparatus according to the present invention.

도 3은 도 2에 도시된 링 버퍼를 설명하기 위한 일 실시예의 블록도이다. 3 is a block diagram of an embodiment for describing the ring buffer shown in FIG. 2.

도 4는 본 발명에 의한 직렬 버스 제어 방법을 설명하기 위한 일 실시예의 플로차트이다. 4 is a flowchart of an embodiment for explaining a serial bus control method according to the present invention.

〈도면의 주요 부호에 대한 간단한 설명〉<Brief description of the major symbols in the drawings>

100: 메인 프로세서 120: 직렬버스 제어 장치100: main processor 120: serial bus control unit

140 내지 146: 제1 내지 제n 슬레이브 디바이스 200: 링 버퍼140 to 146: first to nth slave device 200: ring buffer

220: 직접 액세스 버퍼 240: 인터페이스 제어부220: direct access buffer 240: interface control unit

300 내지 304: 제1 내지 제n 슬롯 320: 링 버퍼 제어부300 to 304: first to n-th slot 320: ring buffer control unit

본 발명은 마스터 장치의 신호선 제어에 따라 버스 동작이 수행되어 데이터를 교환하는 직렬 버스 제어에 관한 것으로, 보다 상세하게는 복수의 슬레이브 디바이스에 대한 데이터들을 메인 프로세서의 제어에 상관없이 자동으로 소정 저장공간에 주기적으로 저장하도록 하여 메인 프로세서의 작업을 줄이는 직렬 버스 제어 장치 및 방법에 관한 것이다.The present invention relates to a serial bus control for exchanging data by performing a bus operation according to a signal line control of a master device. More particularly, the present invention relates to data storage for a plurality of slave devices regardless of the control of the main processor. The present invention relates to a serial bus control apparatus and method for reducing the work of the main processor by periodically storing the data.

도 1은 직렬 버스 제어 장치가 메인 프로세서와 복수의 슬레이브 디바이스들과 함께 연결된 상태를 나타내는 블록도이다. 종래의 직렬 버스 제어 장치(120)는 신호선을 버스 프로토콜(bus protocol)에 맞춰 제어하며, 비트 단위로 전송하는 역할을 담당하는 버스 인터페이스 제어부(미도시)와 메인 프로세서(100)가 전송할 데이터를 저장하거나 버스 인터페이스 제어부가 복수의 슬레이브 디바이스들(140 내지 146)로부터 제공받는 데이터를 저장하는 버퍼(미도시)로 구성된다. 예를 들면, I2C(Inter-Integrated Circuit)버스는 두 개의 신호선을 사용하여 다수의 슬레이브 디바이스들과 통신이 가능한 직렬버스로서 구현이 간단하여 널리 사용되고 있다.1 is a block diagram illustrating a state in which a serial bus control apparatus is connected with a main processor and a plurality of slave devices. The conventional serial bus control apparatus 120 controls a signal line in accordance with a bus protocol, and stores data to be transmitted by a bus interface controller (not shown) and a main processor 100, which are responsible for transmitting bits. Alternatively, the bus interface controller may include a buffer (not shown) that stores data provided from the plurality of slave devices 140 to 146. For example, an I2C (Inter-Integrated Circuit) bus is a serial bus that can communicate with a plurality of slave devices using two signal lines and is widely used due to its simple implementation.

종래의 메인 프로세서(100), 직렬버스 제어장치(120) 및 복수의 슬레이브 디바이스들(140 내지 146) 사이의 동작을 설명하면 다음과 같다. 메인 프로세서(100)가 슬레이브 디바이스들(140 내지 146) 중 소정 슬레이브 디바이스의 데이터를 읽으려면, 먼저 직렬버스 제어장치(120)에 소정 슬레이브 디바이스의 어드레스와 동작 종류 및 길이 등을 설정하고, 읽기 동작을 수행하도록 직렬버스 제어장치(120)에 명령을 내린다. 그 후에, 메인 프로세서(100)는 소정 슬레이브 디바이스로부터 직렬버스를 통해 소정 슬레이브 디바이스의 데이터 전송이 완료되었다는 인터럽트 를 직렬버스 제어장치(120)로부터 제공받으면, 직렬버스 제어장치(120)에 저장된 소정 데이터를 읽어들인다. 반대로, 메인 프로세서(100)가 소정 슬레이브 디바이스에 데이터를 보내려면, 마찬가지로 직렬버스 제어장치(120)에 소정 슬레이브 디바이스의 어드레스와 동작 종류 및 길이 등을 설정하고, 전송할 데이터를 직렬버스 제어장치(120)의 버퍼에 저장하고, 직렬버스 제어장치(120)에 쓰기 명령을 내린다. 그 후에, 직렬버스 제어장치(120)는 저장된 데이터를 소정 슬레이브 디바이스로 전송한다. 데이터가 직렬 버스를 통해 소정 슬레이브 디바이스로의 전송이 완료되면, 직렬버스 제어장치(120)는 데이터가 전송되었다는 인터럽트를 메인 프로세서(100)로 전송한다. 슬레이브 디바이스들(140 내지 146)은 스스로 다른 슬레이브 디바이스로 데이터를 보내거나 다른 슬레이브 디바이스에서 데이터를 읽어 올 수 없다. 따라서, 슬레이브 디바이스들 간의 데이터 전송을 위해 직렬버스 제어장치(120)가 필요하다. 메인 프로세서(100)가 직렬 버스에 연결된 슬레이브 디바이스들에 접근하려 할 때는 마스터 기능을 가진 직렬버스 제어장치(120)를 통하여 접근하여야 한다. 메인 프로세서(100)가 직렬버스 제어장치(120)에 명령을 내린 후 결과를 얻기까지 걸리는 시간은 길다. 즉, 메인 프로세서(100)의 동작속도에 비하여 직렬버스 제어장치(120)의 동작속도가 느리기 때문에, 메인 프로세서(100)는 오랜 시간 동안 직렬버스 제어장치(120)의 동작 완료를 기다려야 하는 문제점이 있다. The operation between the conventional main processor 100, the serial bus controller 120, and the plurality of slave devices 140 to 146 will be described below. In order for the main processor 100 to read data of a predetermined slave device among the slave devices 140 to 146, first, an address, an operation type and a length of the predetermined slave device are set in the serial bus controller 120, and a read operation is performed. Instruct the serial bus controller 120 to perform the operation. Thereafter, when the main processor 100 receives an interrupt from the serial bus controller 120 that the data transmission of the slave device is completed through the serial bus from the slave device, the predetermined data stored in the serial bus controller 120 is received. Read On the contrary, in order for the main processor 100 to send data to a predetermined slave device, the address and operation type and length of the predetermined slave device are similarly set in the serial bus controller 120, and the serial bus controller 120 is transmitted. ), And write command to the serial bus controller 120. Thereafter, the serial bus controller 120 transmits the stored data to the predetermined slave device. When data is completed via the serial bus to the predetermined slave device, the serial bus controller 120 transmits an interrupt to the main processor 100 that the data has been transmitted. The slave devices 140 to 146 cannot send data to or read data from other slave devices by themselves. Therefore, the serial bus controller 120 is required for data transmission between slave devices. When the main processor 100 tries to access slave devices connected to the serial bus, the main processor 100 must access the serial bus controller 120 having a master function. After the main processor 100 issues a command to the serial bus controller 120, it takes a long time to obtain a result. That is, since the operating speed of the serial bus controller 120 is slower than the operating speed of the main processor 100, the main processor 100 has to wait for the operation of the serial bus controller 120 for a long time. have.

또한, 직렬버스 제어장치(120)는 인터럽트를 사용하여 메인 프로세서(100)에 동작 완료를 알리게 되므로, 한 번의 동작 명령에 의해 한 번의 인터럽트 루틴을 처리해야 하며 두 번 이상의 작업 전환이 필요하게 되므로 메인 프로세서(100)의 작업 부담을 가중시키는 문제점이 있다.In addition, since the serial bus controller 120 notifies the completion of the operation to the main processor 100 by using the interrupt, it is necessary to process one interrupt routine by one operation command and two or more task switching are required. There is a problem that increases the workload of the processor 100.

본 발명이 이루고자 하는 기술적 과제는, 메인 프로세서의 슬레이브 디바이스들에 대한 접근 요구가 없어도, 메인 프로세서와 슬레이브 디바이스들 사이에 위치한 직렬 버스 제어장치에 슬레이브 디바이스들에 대한 데이터를 주기적으로 저장하도록 하는 직렬버스 제어장치를 제공하는데 있다.The technical problem to be achieved by the present invention is to serially store data for the slave devices periodically in the serial bus controller located between the main processor and the slave devices, even if there is no request for access to the slave devices of the main processor. To provide a control device.

본 발명이 이루고자 하는 다른 기술적 과제는, 메인 프로세서의 슬레이브 디바이스들에 대한 접근 요구가 없어도, 메인 프로세서와 슬레이브 디바이스들 사이에 위치한 직렬 버스 제어장치에 슬레이브 디바이스들에 대한 데이터를 주기적으로 저장하도록 하는 직렬버스 제어방법을 제공하는데 있다.Another technical problem to be solved by the present invention is to serially store data for slave devices periodically in a serial bus controller located between the main processor and the slave devices, even without requiring access to slave devices of the main processor. To provide a bus control method.

상기의 과제를 이루기 위해, 본 발명에 따른 직렬버스 제어장치는 제1 내지 제n 슬레이브 디바이스들에서 각각 생성된 제1 내지 제n 디바이스 데이터들을 수신하여 저장하는 링 버퍼, 제1 내지 제n 슬레이브 디바이스들 중 소정 슬레이브 디바이스에 대한 메인 프로세서의 액세스 요구에 의해, 메인 프로세서로부터 수신된 프로세스 데이터 또는 소정 슬레이브 디바이스에서 수신된 소정 디바이스 데이터를 저장하는 직접 엑세스 버퍼 및 링 버퍼 및 직접 엑세스 버퍼와 제1 내지 제n 슬레이브 디바이스들 사이에서 제1 내지 제n 데이터들 또는 프로세스 데이터를 송수신하는 인터페이스 제어부로 구성됨이 바람직하다.In order to achieve the above object, the serial bus controller according to the present invention is a ring buffer for receiving and storing the first to n-th device data generated in each of the first to n-th slave devices, the first to n-th slave device The direct access buffer and the ring buffer and the direct access buffer and the first to the first to store the process data received from the main processor or the predetermined device data received from the predetermined slave device by the request of the main processor access to the predetermined slave device among these; The interface controller may be configured to transmit and receive the first to nth data or process data between the n slave devices.

상기의 다른 과제를 이루기 위해, 본 발명에 따른 직렬버스 제어방법은 제1 내지 제n 슬레이브 디바이스들에서 각각 생성된 제1 내지 제n 디바이스 데이터들 중 제k(여기서, k는 1 보다 크거나 같고, n보다 작거나 같은 양의 정수) 데이터를 수신하여 링 버퍼에 저장하는 단계, 소정 주기 내에서 제1 내지 제n 디바이스 데이터들이 링 버퍼에 모두 저장되었는가를 판단하는 단계, 소정 주기 내에서 제1 내지 제n 디바이스 데이터들이 링 버퍼에 모두 저장되었다고 판단되면, 소정 주기가 경과하였는가를 판단하는 단계 및 소정 주기가 경과하였다고 판단되면, 링 버퍼에 제1 내지 제n 디바이스 데이터들의 저장이 요구되는가를 판단하는 단계를 구비하고, 메인 프로세서가 링 버퍼에 저장된 제1 내지 제n 디바이스 데이터들을 필요에 따라 액세스하는 것을 특징으로 한다.In order to achieve the above object, the serial bus control method according to the present invention is k of the first to n-th device data generated in the first to n-th slave devices respectively, where k is greater than or equal to 1 receiving a positive integer less than or equal to n) and storing the data in a ring buffer; determining whether all of the first to nth device data are stored in the ring buffer within a predetermined period; If it is determined that all of the n-th device data are stored in the ring buffer, determining whether a predetermined period has elapsed, and if it is determined that the predetermined period has elapsed, determining whether storage of the first to n-th device data is required in the ring buffer. And accessing the first to nth device data stored in the ring buffer as needed by the main processor. Shall be.

이하, 본 발명에 의한 직렬버스 제어장치를 첨부된 도면을 참조하여 다음과 같이 설명한다.Hereinafter, a serial bus control apparatus according to the present invention will be described with reference to the accompanying drawings.

도 2는 본 발명에 의한 직렬 버스 제어장치를 설명하기 위한 일 실시예의 블록도로서, 링 버퍼(200), 직접 액세스 버퍼(220) 및 인터페이스 제어부(240)로 구성된다.2 is a block diagram of an embodiment for explaining a serial bus control apparatus according to the present invention, and includes a ring buffer 200, a direct access buffer 220, and an interface controller 240.

링 버퍼(200)는 제1 내지 제n 슬레이브 디바이스들(140 내지 146)에서 각각 생성된 제1 내지 제n 디바이스 데이터들을 인터페이스 제어부(240)로부터 수신하여 저장한다. 링 버퍼(200)는 수신된 제1 내지 제n 디바이스 데이터들 중 소정 디바이스 데이터에 대한 액세스를 메인 프로세서(100)로부터 입력단자 IN1을 통해 요구받아서, 소정 디바이스 데이터를 출력단자 OUT1을 통해 메인 프로세서(100)로 출력한다.The ring buffer 200 receives and stores the first to nth device data generated by the first to nth slave devices 140 to 146, respectively, from the interface controller 240. The ring buffer 200 receives a request for access to predetermined device data among the first to nth device data received from the main processor 100 through the input terminal IN1, and receives the predetermined device data through the output terminal OUT1. Output to 100).

도 3은 도 2에 도시된 링 버퍼(200)를 설명하기 위한 일 실시예(200A)의 블록도로서, 제1 내지 제n 슬롯들(300 내지 304) 및 링 버퍼 제어부(320)로 구성된다.FIG. 3 is a block diagram of an embodiment 200A for describing the ring buffer 200 illustrated in FIG. 2, and includes first to n-th slots 300 to 304 and a ring buffer controller 320. .

제1 내지 제n 슬롯들(300 내지 304)은 상태 레지스터(Status Register), 디바이스 어드레스 레지스터(Device Address Register) 및 디바이스 데이터 저장공간 등을 각각 구비한다. 상태 레지스터는 통신상태, 디바이스 데이터 저장공간의 길이 및 슬롯의 업데이트 여부 등을 기록한다. 디바이스 어드레스 레지스터는 슬롯과 통신할 소정 슬레이브 디바이스의 어드레스를 저장한다. 디바이스 데이터 저장공간은소정 슬레이브 디바이스로부터 수신된 디바이스 데이터가 저장되는 저장 공간으로, 디바이스 데이터 저장공간에 저장된 디바이스 데이터가 메인 프로세서(100)로부터 액세스되어 메인 프로세서(100)로 출력된다. 제1 내지 제n 슬롯들(300 내지 304)은 링 버퍼 제어부(320)의 제어에 의해, 주기적으로 제1 내지 제n 슬레이브 디바이스들로부터 제공된 제1 내지 제n 디바이스 데이터들을 순차적으로 저장한다.The first to nth slots 300 to 304 include a status register, a device address register, a device data storage space, and the like. The status register records the communication status, the length of the device data storage space, and whether the slot is updated. The device address register stores the address of a given slave device to communicate with the slot. The device data storage space is a storage space in which device data received from a predetermined slave device is stored, and device data stored in the device data storage space is accessed from the main processor 100 and output to the main processor 100. The first to nth slots 300 to 304 sequentially store the first to nth device data provided from the first to nth slave devices periodically under the control of the ring buffer controller 320.

링 버퍼 제어부(320)는 소정 주기마다 제1 내지 제n 슬롯들(300 내지 304)이 제1 내지 제n 슬레이브 디바이스들(140 내지 146)로부터 순차적으로 제1 내지 제n 디바이스 데이터들을 저장하도록 제어한다. 즉, 링 버퍼 제어부(320)는 설정된 소정 주기마다 제1 내지 제n 슬롯들(300 내지 304)이 제1 내지 제n 슬레이브 디바이스들(140 내지 146)과 순차적으로 통신하여, 제1 내지 제n 디바이스 데이터들을 각각의 슬롯에 저장하도록 제어한다. 소정 주기는 링 버퍼 제어부(320)가 제1 내지 제n 슬롯들(300 내지 304)에 제1 내지 제n 디바이스 데이터들을 각각 저장할 수 있 을 만큼의 상당한 시간 이상이 되도록 설정한다.The ring buffer controller 320 controls the first to nth slots 300 to 304 to sequentially store the first to nth device data from the first to nth slave devices 140 to 146 every predetermined period. do. That is, the ring buffer controller 320 sequentially communicates the first to nth slots 300 to 304 with the first to nth slave devices 140 to 146 at predetermined predetermined periods. Control to store device data in each slot. The predetermined period is set so that the ring buffer control unit 320 may have a substantial time or longer enough to store the first to nth device data in the first to nth slots 300 to 304, respectively.

직접 액세스 버퍼(220)는 제1 내지 제n 슬레이브 디바이스들(140 내지 146) 중 소정 슬레이브 디바이스에 대한 메인 프로세서(100)의 액세스 요구에 의해, 메인 프로세서(100)로부터 수신된 프로세스 데이터 또는 소정 슬레이브 디바이스에서 수신된 소정 디바이스 데이터를 저장한다. 제1 내지 제n 슬레이브 디바이스들 중 소정 슬레이브 디바이스에 대하여 쓰기(write) 명령을 수행하기 위해, 메인 프로세서(100)는 소정 슬레이브 디바이스에 대한 쓰기 명령의 대상이 되는 데이터인 프로세스 데이터를 직접 액세스 버퍼(220)로 전송한다. 전송된 프로세스 데이터는 입력단자 IN1을 통해 입력되어 직접 액세스 버퍼(220)에 저장되었다가 메인 프로세서(100)의 쓰기 명령에 의해 인터페이스 제어부(240)를 통해 소정 슬레이브 디바이스로 전송된다. 제1 내지 제n 슬레이브 디바이스들 중 소정 슬레이브 디바이스에 대하여 읽기(read) 명령을 수행하기 위해, 메인 프로세서(100)는 입력단자 IN1을 통해 직접 액세스 버퍼(220)에 읽기 명령을 내린다. 직접 액세스 버퍼(220)는 소정 슬레이브 디바이스로부터 메인 프로세서(100)가 요구한 소정 디바이스 데이터를 수신하고, 수신이 완료된 소정 디바이스 데이터를 출력단자 OUT1을 통해 메인 프로세서(100)로 전송한다. The direct access buffer 220 is a predetermined slave or process data received from the main processor 100 by an access request of the main processor 100 to a predetermined slave device among the first to nth slave devices 140 to 146. Stores predetermined device data received at the device. In order to perform a write command with respect to a predetermined slave device among the first to nth slave devices, the main processor 100 directly accesses the process data, which is data that is a target of the write command for the predetermined slave device. 220). The transmitted process data is input through the input terminal IN1 and stored in the direct access buffer 220 and then transmitted to the predetermined slave device through the interface controller 240 by a write command of the main processor 100. In order to perform a read command with respect to a predetermined slave device among the first to nth slave devices, the main processor 100 issues a read command to the access buffer 220 directly through the input terminal IN1. The direct access buffer 220 receives the predetermined device data requested by the main processor 100 from the predetermined slave device, and transmits the received predetermined device data to the main processor 100 through the output terminal OUT1.

인터페이스 제어부(240)는 링 버퍼(200) 및 직접 엑세스 버퍼(220)와 제1 내지 제n 슬레이브 디바이스들(140 내지 146) 사이에서 제1 내지 제n 데이터들 또는 프로세스 데이터를 송수신한다. 인터페이스 제어부(240)는 제1 내지 제n 슬레이브 디바이스들(140 내지 146)로부터 입력단자 IN2을 통해 주기적으로 수신된 제1 내지 제n 디바이스 데이터들을 링 버퍼(200)에 저장하도록 인터페이스 한다. 또한, 인터페이스 제어부(240)는 직접 엑세스 버퍼(220)에 저장된 프로세스 데이터를 입력받아서, 프로세스 데이터를 출력단자 OUT2를 통해 소정 슬레이브 디바이스로 전송하도록 인터페이스 한다.The interface controller 240 transmits and receives the first through n-th data or process data between the ring buffer 200 and the direct access buffer 220 and the first through n-th slave devices 140 through 146. The interface controller 240 interfaces the first to nth device data periodically received through the input terminal IN2 from the first to nth slave devices 140 to 146 in the ring buffer 200. In addition, the interface controller 240 directly receives the process data stored in the access buffer 220 and interfaces the process data to the predetermined slave device through the output terminal OUT2.

이하, 본 발명에 의한 직렬버스 제어방법을 첨부된 도면을 참조하여 다음과 같이 설명한다.Hereinafter, a serial bus control method according to the present invention will be described with reference to the accompanying drawings.

도 4는 본 발명에 의한 직렬 버스 제어방법을 설명하기 위한 일 실시예의 플로차트로서, 슬레이브 디바이스들의 디바이스 데이터들을 주기적으로 링 버퍼에 저장하고, 저장된 디바이스 데이터들을 메인 프로세서에서 필요에 따라 액세스하는 단계(제500 ~ 제514 단계들)로 이루어진다.FIG. 4 is a flowchart illustrating an example of a method of controlling a serial bus according to an embodiment of the present invention, in which device data of slave devices are periodically stored in a ring buffer, and the stored device data is accessed in a main processor as needed. 500 to 514 steps).

먼저, 제1 내지 제n 슬레이브 디바이스들에서 각각 생성된 제1 내지 제n 디바이스 데이터들 중 제k(여기서, k는 1 보다 크거나 같고, n보다 작거나 같은 양의 정수) 디바이스 데이터를 수신하여 링 버퍼(200)에 저장한다(제500 단계). First, k-th (where k is a positive integer greater than or equal to 1 and less than or equal to n) of the first to n-th device data generated by the first to n-th slave devices, respectively, The ring buffer 200 is stored in step 500.

제500 단계 후에, 메인 프로세서(100)로부터 제1 내지 제n 슬레이브 디바이스들(140 내지 146) 중 소정 슬레이브 디바이스에 대한 액세스가 요구되는가를 판단한다(제502 단계). 소정 슬레이브 디바이스에 대한 액세스 요구는 메인 프로세서(100)에서 링 버퍼(200)에 저장된 제1 내지 제n 디바이스 데이터들 중 어느 하나에 대해 액세스를 요구하는 것이 아니라, 직접 액세스 버퍼(220)를 통해 소정 슬레이브 디바이스에 대한 현재의 디바이스 데이터에 대해 액세스를 요구하는 것을 의미한다. After operation 500, it is determined whether access to a predetermined slave device among the first to nth slave devices 140 to 146 is required from the main processor 100 (operation 502). The access request for a given slave device does not require access to any one of the first to nth device data stored in the ring buffer 200 in the main processor 100, but rather via the direct access buffer 220. This means requesting access to the current device data for the slave device.

만일, 메인 프로세서(100)로부터 제1 내지 제n 슬레이브 디바이스들(140 내지 146) 중 소정 슬레이브 디바이스에 대한 액세스가 요구되지 않는다고 판단되면, 제506 단계로 진행한다If it is determined from the main processor 100 that access to a predetermined slave device among the first to nth slave devices 140 to 146 is not required, the process proceeds to step 506.

그러나, 메인 프로세서(100)로부터 소정 슬레이브 디바이스에 대한 액세스가 요구된다고 판단되면, 메인 프로세서(100)로부터 수신된 프로세스 데이터 또는 소정 슬레이브 디바이스에서 수신된 소정 디바이스 데이터를 직접 액세스 버퍼(220)에 저장한다(제504 단계). 메인 프로세서(100)로부터 프로세스 데이터가 수신되어 직접 액세스 버퍼(220)에 저장되어 있다가, 메인 프로세서(100)의 쓰기 명령에 의해 프로세스 데이터가 소정 슬레이브 디바이스로 전송된다. 한편, 메인 프로세서(100)의 읽기 명령에 의해 소정 슬레이브 디바이스로부터 수신된 소정 디바이스 데이터가 직접 액세스 버퍼(220)에 저장되어 있다가, 메인 프로세서(100)로 소정 디바이스 데이터가 전송된다. However, when it is determined that access to a predetermined slave device is required from the main processor 100, the processor device directly stores the process data received from the main processor 100 or the predetermined device data received from the predetermined slave device in the access buffer 220. (Step 504). Process data is received from the main processor 100 and directly stored in the access buffer 220, and then the process data is transmitted to a predetermined slave device by a write command of the main processor 100. Meanwhile, predetermined device data received from a predetermined slave device by a read command of the main processor 100 is directly stored in the access buffer 220, and then predetermined device data is transmitted to the main processor 100.

제502 또는 제504 단계 후에, 소정 주기 내에서 제1 내지 제n 디바이스 데이터들이 링 버퍼(200)에 모두 저장되었는가를 판단한다(제506 단계). 소정 주기는 제1 내지 제n 디바이스 데이터들을 링 버퍼(200)에 각각 저장할 수 있을 만큼의 상당한 시간 이상이 되도록 설정한다. 만일, 소정 주기 내에서 제1 내지 제n 디바이스 데이터들 중 어느 하나 이상이 링 버퍼(200)에 저장되지 않았다고 판단되면, 제500 단계로 진행한다. 즉, 소정 주기 내에서 제1 내지 제n 디바이스 데이터들 중 어느 하나 이상이 링 버퍼(200)에 저장되지 않았다고 판단되면, 소정 주기 내에 링 버퍼(200)에 저장되지 아니한 나머지 디바이스 데이터들을 저장하기 위한 단계들( 제500 내지 제504단계)을 반복적으로 수행한다. 즉, 전술한 제500 단계 내지 제504 단계를 n회에 걸쳐서 반복함으로써, 소정 주기 내에 제1 내지 제n 디바이스 데이터들을 링 버퍼(200)에 저장하도록 한다. After operation 502 or 504, it is determined whether all of the first to nth device data are stored in the ring buffer 200 within a predetermined period (operation 506). The predetermined period is set to be equal to or more than a substantial time enough to store the first to nth device data in the ring buffer 200, respectively. If it is determined that at least one of the first to n-th device data is not stored in the ring buffer 200 within a predetermined period, the process proceeds to step 500. That is, when it is determined that at least one of the first to n-th device data is not stored in the ring buffer 200 within a predetermined period, the device for storing the remaining device data that is not stored in the ring buffer 200 within the predetermined period. Steps (steps 500 to 504) are repeatedly performed. That is, by repeating steps 500 to 504 n times, the first to nth device data are stored in the ring buffer 200 within a predetermined period.

그러나, 소정 주기 내에서 제1 내지 제n 디바이스 데이터들이 링 버퍼(200)에 모두 저장되었다고 판단되면, 소정 주기가 경과하였는가를 판단한다(제508 단계). However, if it is determined that all of the first to nth device data are stored in the ring buffer 200 within the predetermined period, it is determined whether the predetermined period has elapsed (step 508).

만일, 소정 주기가 경과하였다고 판단되면, 링 버퍼(200)에 제1 내지 제n 디바이스 데이터들의 저장이 요구되는가를 판단한다(제510 단계). 제1 내지 제n 디바이스 데이터들의 저장 요구는 링 버퍼(200)에 새로운 이전 소정 주기에 저장된 제1 내지 제n 디바이스 데이터들에 대해 업데이트가 요구되는가를 판단함으로써 결정된다. 링 버퍼(200)에 제1 내지 제n 디바이스 데이터들의 저장이 요구되지 않는다면, 즉, 제1 내지 제n 디바이스 데이터들의 업데이트가 요구되지 않는다면 전술한 단계들을 종료한다. 그러나, 링 버퍼(200)에 제1 내지 제n 디바이스 데이터들의 저장이 요구된다면, 제1 내지 제n 디바이스 데이터들의 업데이트를 위해 제500 단계로 진행한다.If it is determined that the predetermined period has elapsed, it is determined whether the ring buffer 200 requires the storage of the first to nth device data (operation 510). The request for storing the first to n-th device data is determined by determining whether an update is required for the first to n-th device data stored in a new previous predetermined period in the ring buffer 200. If the storage of the first to nth device data is not required in the ring buffer 200, that is, the update of the first to nth device data is not required, the above-described steps are terminated. However, if storage of the first to nth device data is required in the ring buffer 200, the process proceeds to step 500 for updating the first to nth device data.

한편, 제508 단계에서 소정 주기가 경과하지 않았다고 판단되면, 메인 프로세서(100)로부터 제1 내지 제n 슬레이브 디바이스들(140 내지 146) 중 소정 슬레이브 디바이스에 대한 액세스가 요구되는가를 판단한다(제512 단계). 제502 단계에서 기술한 바와 같이, 소정 슬레이브 디바이스에 대한 액세스 요구는 메인 프로세서(100)에서 링 버퍼(200)에 저장된 제1 내지 제n 디바이스 데이터들 중 어 느 하나에 대해 액세스를 요구하는 것이 아니라, 직접 액세스 버퍼(220)를 통해 소정 슬레이브 디바이스에 대한 현재의 디바이스 데이터에 대해 액세스를 요구하는 것을 의미한다. On the other hand, if it is determined in step 508 that the predetermined period has not elapsed, it is determined whether access to a predetermined slave device among the first to nth slave devices 140 to 146 is required from the main processor 100 (512). step). As described in step 502, the access request for a given slave device does not request access to any one of the first through n-th device data stored in the ring buffer 200 in the main processor 100. In this case, access to the current device data for a given slave device is requested through the direct access buffer 220.

만일, 메인 프로세서(100)로부터 제1 내지 제n 슬레이브 디바이스들(140 내지 146) 중 소정 슬레이브 디바이스에 대한 액세스가 요구되지 않는다고 판단되면, 제508 단계로 진행하여, 제508 단계 및 이 후의 단계를 수행한다. If it is determined from the main processor 100 that access to a predetermined slave device among the first to n-th slave devices 140 to 146 is not required, the process proceeds to step 508 and steps 508 and subsequent steps. To perform.

그러나, 메인 프로세서(100)로부터 소정 슬레이브 디바이스에 대한 액세스가 요구된다고 판단되면, 메인 프로세서(100)로부터 수신된 프로세스 데이터 또는 소정 슬레이브 디바이스에서 수신된 소정 디바이스 데이터를 직접 액세스 버퍼(220)에 저장하고 제508 단계로 다시 진행한다(제514 단계). 제504 단계에서 기술된 바와 같이, 직접 액세스 버퍼(220)에 저장된 소정 디바이스 데이터는 메인 프로세서(100)로 전송된다. 또한, 직접 액세스 버퍼(220)에 저장된 프로세스 데이터는 소정 슬레이브 디바이스로 전송된다. However, when it is determined that access to a predetermined slave device is required from the main processor 100, the process data received from the main processor 100 or the predetermined device data received from the predetermined slave device are directly stored in the access buffer 220. The flow returns to step 508 (step 514). As described in step 504, certain device data stored in the direct access buffer 220 is transmitted to the main processor 100. In addition, process data stored in the direct access buffer 220 is transmitted to a given slave device.

이상에서 설명한 바와 같이, 본 발명에 의한 직렬 버스 제어장치 및 방법은 메인 프로세서의 슬레이브 디바이스들에 대한 접근 요구가 없어도, 메인 프로세서와 슬레이브 디바이스들 사이에 위치한 직렬 버스 제어장치에 슬레이브 디바이스들에 대한 데이터를 주기적으로 저장하도록 함으로써, 직렬 버스의 제어에 관련된 메인 프로세서의 작업을 줄이고 소프트웨어의 구조를 단순화시키는 효과가 있다.As described above, the serial bus control apparatus and method according to the present invention does not require access to the slave devices of the main processor, but the data for the slave devices in the serial bus controller located between the main processor and the slave devices. By periodically storing the, it is possible to reduce the work of the main processor related to the control of the serial bus and to simplify the structure of the software.

Claims (5)

메인 프로세서와 제1 내지 제n(여기서, n은 1 보다 크거나 같은 양의 정수) 슬레이브 디바이스들 사이에서 직렬 버스의 동작을 제어하는 직렬 버스 제어장치에 있어서,A serial bus controller for controlling the operation of a serial bus between a main processor and first through nth (where n is a positive integer greater than or equal to 1) slave devices, 상기 제1 내지 제n 슬레이브 디바이스들에서 각각 생성된 제1 내지 제n 디바이스 데이터들을 수신하여 저장하는 링 버퍼;A ring buffer configured to receive and store first to nth device data generated by the first to nth slave devices, respectively; 상기 제1 내지 제n 슬레이브 디바이스들 중 소정 슬레이브 디바이스에 대한 상기 메인 프로세서의 액세스 요구에 의해, 상기 메인 프로세서로부터 수신된 프로세스 데이터 또는 상기 소정 슬레이브 디바이스에서 수신된 소정 디바이스 데이터를 저장하는 직접 엑세스 버퍼; 및A direct access buffer for storing process data received from the main processor or predetermined device data received at the predetermined slave device by an access request of the main processor to a predetermined one of the first to nth slave devices; And 상기 링 버퍼 및 상기 직접 엑세스 버퍼와 상기 제1 내지 제n 슬레이브 디바이스들 사이에서 상기 제1 내지 제n 디바이스 데이터들 또는 상기 프로세스 데이터를 송수신하는 인터페이스 제어부를 구비하는 것을 특징으로 하는 직렬 버스 제어장치.And an interface control unit configured to transmit and receive the first through nth device data or the process data between the ring buffer and the direct access buffer and the first through nth slave devices. 제1 항에 있어서, 상기 링 버퍼는The method of claim 1, wherein the ring buffer 상태 레지스터, 디바이스 어드레스 레지스터 및 디바이스 데이터 저장공간을 각각 구비하는 제1 내지 제n 슬롯들; 및 First to nth slots each having a status register, a device address register, and a device data storage space; And 소정 주기마다 상기 제1 내지 제n 슬롯들이 제1 내지 제n 슬레이브 디바이스들로부터 순차적으로 상기 제1 내지 제n 디바이스 데이터들을 저장하도록 제어하는 링 버퍼 제어부를 구비하는 것을 특징으로 하는 직렬 버스 제어장치. And a ring buffer control unit configured to control the first to nth slots to sequentially store the first to nth device data from the first to nth slave devices every predetermined period. 제1 항의 직렬 버스 제어장치에서 수행되는 직렬 버스 제어방법에 있어서,In the serial bus control method performed in the serial bus controller of claim 1, (a) 상기 제1 내지 제n 슬레이브 디바이스들에서 각각 생성된 제1 내지 제n 디바이스 데이터들 중 제k(여기서, k는 1 보다 크거나 같고, n보다 작거나 같은 양의 정수) 디바이스 데이터를 수신하여 상기 링 버퍼에 저장하는 단계;(a) k-th (where k is a positive integer greater than or equal to 1 and less than or equal to n) device data among the first to n-th device data generated in each of the first to nth slave devices, respectively; Receiving and storing in the ring buffer; (b) 상기 소정 주기 내에서 상기 제1 내지 제n 디바이스 데이터들이 상기 링 버퍼에 모두 저장되었는가를 판단하는 단계;(b) determining whether all of the first to nth device data are stored in the ring buffer within the predetermined period; (c) 상기 소정 주기 내에서 상기 제1 내지 제n 디바이스 데이터들이 상기 링 버퍼에 모두 저장되었다고 판단되면, 상기 소정 주기가 경과하였는가를 판단하는 단계; 및(c) if it is determined that all of the first to nth device data are stored in the ring buffer within the predetermined period, determining whether the predetermined period has elapsed; And (d) 상기 소정 주기가 경과하였다고 판단되면, 상기 링 버퍼에 상기 제1 내지 제n 디바이스 데이터들의 저장이 요구되는가를 판단하는 단계를 구비하고, (d) if it is determined that the predetermined period has elapsed, determining whether the first to nth device data are stored in the ring buffer, and 상기 메인 프로세서가 상기 링 버퍼에 저장된 상기 제1 내지 제n 디바이스 데이터들을 필요에 따라 액세스하는 것을 특징으로 하는 직렬 버스 제어 방법.And the main processor accesses the first to nth device data stored in the ring buffer as needed. 제3 항에 있어서, 상기 직렬 버스 제어 방법은4. The method of claim 3, wherein the serial bus control method 상기 (a) 단계 후에, 상기 메인 프로세서로부터 상기 제1 내지 제n 슬레이브 디바이스들 중 상기 소정 슬레이브 디바이스에 대한 액세스가 요구되는가를 판단하는 단계; 및After step (a), determining from the main processor whether access to the predetermined slave device among the first to nth slave devices is required; And 상기 메인 프로세서로부터 상기 소정 슬레이브 디바이스에 대한 액세스가 요구된다고 판단되면, 상기 메인 프로세서로부터 수신된 상기 프로세스 데이터 또는 상기 소정 슬레이브 디바이스에서 수신된 상기 소정 디바이스 데이터를 상기 직접 액세스 버퍼에 저장하고 상기 (b) 단계로 진행하는 단계를 더 구비하고, If it is determined that access to the predetermined slave device is required from the main processor, the process data received from the main processor or the predetermined device data received from the predetermined slave device are stored in the direct access buffer and the (b) Further comprising the step of proceeding to a step, 상기 직접 액세스 버퍼에 저장된, 상기 소정 디바이스 데이터를 상기 메인 프로세서로 전송하거나 상기 프로세스 데이터를 상기 소정 슬레이브 디바이스에 전송하는 것을 특징으로 하는 직렬 버스 제어 방법. Transmitting the predetermined device data stored in the direct access buffer to the main processor or transmitting the process data to the predetermined slave device. 제3 항에 있어서, 상기 직렬 버스 제어 방법은4. The method of claim 3, wherein the serial bus control method 상기 (c) 단계에서 상기 소정 주기가 경과하지 않았다고 판단되면, 상기 메인 프로세서로부터 상기 제1 내지 제n 슬레이브 디바이스들 중 상기 소정 슬레이브 디바이스에 대한 액세스가 요구되는가를 판단하는 단계; 및If it is determined in step (c) that the predetermined period has not elapsed, determining whether access to the predetermined slave device among the first to nth slave devices is required from the main processor; And 상기 메인 프로세서로부터 상기 소정 슬레이브 디바이스에 대한 액세스가 요구된다고 판단되면, 상기 메인 프로세서로부터 수신된 상기 프로세스 데이터 또는 상기 소정 슬레이브 디바이스에서 수신된 상기 소정 디바이스 데이터를 상기 직접 액세스 버퍼에 저장하고 상기 (c) 단계로 다시 진행하는 단계를 더 구비하고, If it is determined that access to the predetermined slave device is required from the main processor, the process data received from the main processor or the predetermined device data received at the predetermined slave device are stored in the direct access buffer and the (c) Further comprising the step of proceeding back to step, 상기 직접 액세스 버퍼에 저장된, 상기 소정 디바이스 데이터를 상기 메인 프로세서로 전송하거나 상기 프로세스 데이터를 상기 소정 슬레이브 디바이스에 전송하는 것을 특징으로 하는 직렬 버스 제어 방법. Transmitting the predetermined device data stored in the direct access buffer to the main processor or transmitting the process data to the predetermined slave device.
KR1020030079166A 2003-11-10 2003-11-10 Serial bus control device and method Expired - Fee Related KR100584583B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030079166A KR100584583B1 (en) 2003-11-10 2003-11-10 Serial bus control device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030079166A KR100584583B1 (en) 2003-11-10 2003-11-10 Serial bus control device and method

Publications (2)

Publication Number Publication Date
KR20050045195A KR20050045195A (en) 2005-05-17
KR100584583B1 true KR100584583B1 (en) 2006-05-30

Family

ID=37244919

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030079166A Expired - Fee Related KR100584583B1 (en) 2003-11-10 2003-11-10 Serial bus control device and method

Country Status (1)

Country Link
KR (1) KR100584583B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101709210B1 (en) * 2011-01-07 2017-02-22 콘티넨탈 오토모티브 시스템 주식회사 Interface method bt means of ring buffer

Also Published As

Publication number Publication date
KR20050045195A (en) 2005-05-17

Similar Documents

Publication Publication Date Title
US7035956B2 (en) Transmission control circuit, reception control circuit, communications control circuit, and communications control unit
KR20060052936A (en) Prefetch Control in Data Processing Systems
KR20070039120A (en) Method and apparatus for accessing data in message memory of communication components
KR100981461B1 (en) Method for controlling access to data in message memory of communication chip by communication chip and message manager
US6275498B1 (en) Extended PHY addressing
JP3651573B2 (en) Control method for factory automation system, central controller for factory automation system
KR100584583B1 (en) Serial bus control device and method
US5404137A (en) High speed transition signalling communication system
KR100229897B1 (en) Timing Mode Selection Device According to Direct Memory Access Transmission Method
JP4119582B2 (en) Transfer control method and information processing apparatus
JP3930990B2 (en) Computer system with interface between memory and peripheral device and method for selecting a communication parameter set
KR100361511B1 (en) Multi-Function Serial Communication Interface Device
JPH10289196A (en) Computer and transfer method for peripheral device control data in computer
JPS60142768A (en) Data transfer device
JPH05334232A (en) Dma transfer controller
KR100295683B1 (en) General call acknowledge apparatus and method for inter-integrated circuit
JP2006304011A (en) Interface circuit
KR100244681B1 (en) Robot multi-motor control system and communication method of the system
JP4854598B2 (en) Data transfer control device
JPH11249713A (en) Master station unit for remote input and output device
JP3505540B2 (en) Data transfer device
KR100962306B1 (en) Bidirectional Data Communication Device of Embedded System and Its Method
KR20050107159A (en) Bus controller for serial interface of system
KR20230119306A (en) Memory access method
JPH11184827A (en) Master slave device

Legal Events

Date Code Title Description
A201 Request for examination
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20031110

PA0201 Request for examination
PG1501 Laying open of application
E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20051114

Patent event code: PE09021S01D

E701 Decision to grant or registration of patent right
PE0701 Decision of registration

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20060428

GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20060523

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20060524

End annual number: 3

Start annual number: 1

PG1601 Publication of registration
PR1001 Payment of annual fee

Payment date: 20090429

Start annual number: 4

End annual number: 4

PR1001 Payment of annual fee

Payment date: 20100429

Start annual number: 5

End annual number: 5

PR1001 Payment of annual fee

Payment date: 20110428

Start annual number: 6

End annual number: 6

PR1001 Payment of annual fee

Payment date: 20120427

Start annual number: 7

End annual number: 7

FPAY Annual fee payment

Payment date: 20130429

Year of fee payment: 8

PR1001 Payment of annual fee

Payment date: 20130429

Start annual number: 8

End annual number: 8

FPAY Annual fee payment

Payment date: 20140429

Year of fee payment: 9

PR1001 Payment of annual fee

Payment date: 20140429

Start annual number: 9

End annual number: 9

LAPS Lapse due to unpaid annual fee
PC1903 Unpaid annual fee

Termination category: Default of registration fee

Termination date: 20160409