KR20080013548A - Interface module and method for data communication by synchronizing clock - Google Patents

Interface module and method for data communication by synchronizing clock Download PDF

Info

Publication number
KR20080013548A
KR20080013548A KR1020060075219A KR20060075219A KR20080013548A KR 20080013548 A KR20080013548 A KR 20080013548A KR 1020060075219 A KR1020060075219 A KR 1020060075219A KR 20060075219 A KR20060075219 A KR 20060075219A KR 20080013548 A KR20080013548 A KR 20080013548A
Authority
KR
South Korea
Prior art keywords
unit
clock
data
peripheral device
input
Prior art date
Application number
KR1020060075219A
Other languages
Korean (ko)
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 KR1020060075219A priority Critical patent/KR20080013548A/en
Publication of KR20080013548A publication Critical patent/KR20080013548A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/12Synchronisation of different clock signals provided by a plurality of clock generators
    • 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
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K5/00Manipulating of pulses not covered by one of the other main groups of this subclass
    • H03K5/13Arrangements having a single output and transforming input signals into pulses delivered at desired time intervals
    • H03K5/135Arrangements having a single output and transforming input signals into pulses delivered at desired time intervals by the use of time reference signals, e.g. clock signals

Abstract

An interface module and a method for synchronizing clock signals and transmitting and receiving data are provided to transmit and receive a control signal between components of the interface module in synchronization with operating clock signals of the components and stabilize data signals when the interface module exchanges the data signals in a slave mode. An interface module includes a transmission controller(211) and a transfer unit(240). The transmission controller operates in response to a first clock signal and outputs data inputted from a central processing unit. The transfer unit operates in response to a second clock signal and sequentially outputs data inputted from the transmission controller to a peripheral device. The transmission controller and the transfer unit respectively include synchronization units(411,241) for converting a control signal transmitted and received between the transmission controller and the transfer unit according to operating clock signals of the transmission controller and the transfer unit.

Description

클럭을 동기화하여 데이터를 송수신하는 인터페이스 모듈 및 방법{Interface module and method for data communication by synchronizing clock}Interface module and method for synchronizing clock to transmit and receive data

도 1은 종래기술에 따른 SPI의 내부 블록 구성도.1 is an internal block diagram of an SPI according to the prior art.

도 2는 슬레이브 모드에서 데이터를 교환하는 SPI를 재구성한 블록도.2 is a block diagram reconstructing SPI exchanging data in slave mode.

도 3은 일반적인 두개의 디-플립플롭(D-flip-flop)을 사용한 동기부.3 is a synchronization unit using two general D-flip-flops.

도 4는 본 발명의 바람직한 일 실시예에 따른 SPI의 슬레이브 모드에서 데이터를 송신하는 구성을 도시한 도면,4 is a diagram illustrating a configuration for transmitting data in a slave mode of an SPI according to an embodiment of the present invention;

도 5는 본 발명의 바람직한 일 실시예에 따른 슬레이브 모드에서 SPI의 데이터 송신방법에 대한 흐름도.5 is a flowchart illustrating a data transmission method of an SPI in a slave mode according to an exemplary embodiment of the present invention.

도 6은 본 발명의 바람직한 일 실시예에 따라 SPI의 슬레이브 모드에서 데이터를 송신하는 구성을 도시한 도면.6 is a diagram illustrating a configuration for transmitting data in a slave mode of an SPI according to an embodiment of the present invention.

도 7은 본 발명의 바람직한 일 실시예에 따른 슬레이브 모드에서 SPI의 데이터 수신방법에 대한 흐름도. 7 is a flowchart illustrating a data receiving method of an SPI in a slave mode according to an exemplary embodiment of the present invention.

본 발명은 인터페이스 모듈에 관한 것으로서, 보다 상세하게는 시스템 클럭과 인터페이스 모듈의 시리얼클럭(Serial Clock, 이하 'SCK'라 칭함)을 동기화하여 사용하는 인터페이스 모듈에 관한 것이다.The present invention relates to an interface module, and more particularly, to an interface module for synchronizing a system clock and a serial clock (hereinafter, referred to as 'SCK') of an interface module.

일반적으로, 에스피아이(Serial Perphal Interface; 이하 'SPI'라 稱함)는 주변장치간에 직렬(Serial) 통신으로 데이터를 교환할 수 있게 해주는 인터페이스로서, 그 중 하나가 마스터(master)가 되고 다른 하나가 슬레이브(slave)가 되어 동작한다. SPI는 전이중 방식으로 동작하는데, 이는 데이터가 양방향으로 동시에 전달될 수 있음을 의미한다. SPI는 대부분 중앙처리장치(CPU)와 주변장치간에 통신을 하는 시스템에 주로 채용되지만, 두 개의 마이크로프로세서들 사이를 SPI의 형태로 연결하는 것도 가능하다. 이 용어는 원래 모토롤라에서 만들어졌으며, 기타 다른 종류가 이름은 다르지만 유사한 기능을 수행하고 있음은 이미 잘 알려진 사실이다. Generally, Serial Perphal Interface (hereinafter referred to as 'SPI') is an interface that allows data to be exchanged between peripherals by serial communication, one of which becomes a master and the other of which is a master. Operates as a slave. SPI operates in full duplex, which means that data can be delivered in both directions simultaneously. Most SPIs are used in systems that communicate between a central processing unit (CPU) and peripherals, but it is also possible to connect two microprocessors in the form of SPIs. The term was originally coined by Motorola, and it is well known that other types perform similar but different names.

도 1은 종래기술에 따른 SPI의 내부 블록 구성도이다. 1 is an internal block diagram of an SPI according to the prior art.

도 1을 참조하면, SPI가 사용하는 클럭은 크게 두가지로 나뉘어진다. 첫번째는 첫번째는 SPI가 시스템 클럭을 분주해서 사용하는 시리얼 클럭(Serial clock, 이하에서는 시스템 클럭과 구별하기 위해 '내부클럭'칭함)이고, 두번째는 콘트롤 로직 핀(106)에서 주변장치로부터 SCK핀으로 입력받는 클럭(이하에서 주변장치로부터 입력받는 클럭을 '주변 클럭')이라 칭한다.Referring to FIG. 1, the clock used by the SPI is largely divided into two types. The first is the serial clock (Serial Clock, hereinafter referred to as 'internal clock' to distinguish it from the system clock) by which the SPI divides the system clock. The second is from the peripheral to the SCK pin on the control logic pin 106. An incoming clock (hereinafter referred to as a clock received from a peripheral device) is referred to as a peripheral clock.

SPI는 두가지 모드를 지원하는 데, 하나는 마스터 모드(Master mode)이고, 다른 하나는 슬레이브 모드(slave mode)이다.SPI supports two modes, one in master mode and the other in slave mode.

마스터 모드는 시스템 클럭을 이용하여 내부클럭을 생성하고, 외부 주변장치와 내부클럭을 이용하여 데이터를 교환한다.Master mode uses the system clock to generate internal clocks, and exchanges data with external peripherals using internal clocks.

그러나 슬레이브 모드는 클럭을 생성하지 못하고, 주변장치로부터 콘트롤 로직 핀(106)의 SCK핀을 통하여 주변장치로부터 입력되는 주변 클럭을 이용하여 데이터를 교환한다.However, the slave mode does not generate a clock and exchanges data using a peripheral clock input from the peripheral device through the SCK pin of the control logic pin 106 from the peripheral device.

따라서, SPI가 전이중 방식으로 데이터를 양방향으로 교환하는 과정에서, 마스터 모드가 이용하는 내부클럭과 슬레이브 모드에서 이용하는 주변클럭이 비동기 (asynchronous)가 될 수 있다는 문제점이 있다. Accordingly, in the process of SPI exchanging data bidirectionally, there is a problem that the internal clock used by the master mode and the peripheral clock used in the slave mode may be asynchronous.

예를 들어 시스템 클럭이 100hz인 경우, 마스터 모드에서 시스템 클럭을 분주하여 내부 클럭을 생성하는 과정에서 딜레이(delay, 시간지연)가 발생할 수 있으며, 여러가지 요인으로 내부클럭은 99hz일 수 있다.For example, if the system clock is 100hz, a delay may occur during the process of generating the internal clock by dividing the system clock in the master mode, and the internal clock may be 99hz due to various factors.

또한, 주변장치도 시스템 클럭인 100hz로 동작을 하는 것이 원칙이나, 현실적으로는 주변장치 내부 처리과정에서 여러가지 딜레이가 발생할 수 있으며, 시간 축상에서 여러가지 깨짐, 뒤틀어짐 현상등이 발생할 수 있다. 따라서 슬레이브 모드에서 SPI가 콘트롤 로직 핀(106)중 SCK 핀으로 입력받는 주변 클럭은 97hz 일 수 있다. 따라서 현실적으로 내부 클럭과 주변클럭이 비동기(asynchronous)인 경우가 발생 할 수 있다.In addition, the peripheral device also operates at a system clock of 100 hz, but in reality, various delays may occur in the internal processing of the peripheral device, and various cracks and distortions may occur on the time axis. Therefore, in the slave mode, the peripheral clock of which the SPI is input to the SCK pin of the control logic pin 106 may be 97hz. As a result, the internal clock and the peripheral clock may be asynchronous.

SPI가 중앙처리 장치와 주변장치간에 데이터를 교환하는 과정에서 내부클럭 과 주변클럭이 비동기(asynchronous) 되는 경우, 데이터 자체가 불안정(metastable state) 해질 수 있다는 문제점이 있다. When the internal clock and the peripheral clock are asynchronous while the SPI exchanges data between the central processing unit and the peripheral device, there is a problem that the data itself may become unstable.

상기한 바와 같은 종래의 문제점을 해결하기 위해, 본 발명은 슬레이브 모드(Slave mode)에서 주변장치간에 데이터를 송수신하는 과정에서, 인터페이스 모듈의 구성요소간에 송수신되어지는 제어 신호를 각각의 동작 클럭에 따라 동기화되어 송수신되어지는 인터페이스 모듈을 제안하는 것이다. In order to solve the conventional problems as described above, the present invention, in the slave mode (Slave mode) in the process of transmitting and receiving data between the peripheral device, the control signal transmitted and received between the components of the interface module according to each operation clock It proposes an interface module that is synchronized and transmitted and received.

또한, 슬레이브 모드에서 데이터를 교환하는 과정에서 데이터의 안정화를 도모하는 인터페이스 모듈을 제안하는 것이다. In addition, the present invention proposes an interface module for stabilizing data in the process of exchanging data in slave mode.

본 발명의 또 다른 목적들은 이하의 실시예에 대한 설명을 통해 쉽게 이해될 수 있을 것이다.Still other objects of the present invention will be readily understood through the following description of the embodiments.

상기한 바와 같은 목적을 달성하기 위해, 본 발명의 바람직한 일 실시예에 따르면, 슬레이브 모드(Slave mode)에서 중앙처리장치로부터 주변장치로 데이터를 송신하는 인터페이스 모듈에 있어서, 제1 클럭에 상응하여 동작하고, 상기 중앙처리장치로부터 입력되는 데이터를 출력하는 송신제어부; 및 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하고, 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 전달부를 포함하되, 상기 송신제어부 및 상 기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 따라 변환하기 위한 동기부를 포함하는 것을 특징으로 하는 인터페이스 모듈이 제공된다.In order to achieve the above object, according to a preferred embodiment of the present invention, the interface module for transmitting data from the central processing unit to the peripheral device in the slave mode, the operation corresponding to the first clock A transmission control unit for outputting data input from the central processing unit; And a transmission unit operating in correspondence with a second clock input from the peripheral device, and sequentially outputting data input from the transmission control unit to the peripheral device, wherein the transmission control unit and the transmission unit are controlled to be transmitted and received to each other. An interface module is provided that includes a synchronizer for converting signals in accordance with respective operating clocks.

상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 클럭 분주기를 더 포함할 수 있다. The apparatus may further include a clock divider configured to generate the first clock using a system clock input from the CPU.

상기 중앙처리장치로부터 입력되는 m(임의의 자연수)비트 데이터를 n(임의의 자연수)비트데이터로 변환하여 상기 송신제어부로 출력하는 레지스터부를 더 포함할 수 있다.The apparatus may further include a register unit configured to convert m (arbitrary natural number) bit data input from the CPU to n (arbitrary natural number) bit data and output the n-bit data.

상기 레지스터부로부터 입력되는 n 비트 데이터를 저장한 후, 저장된 순서대로 상기 송신제어부로 출력하는 송신 선입선출부를 더 포함할 수 있다.The apparatus may further include a first-in, first-out unit that stores the n-bit data input from the register unit and outputs the n-bit data to the transmission control unit in the stored order.

상기 m은 상기 중앙처리장치의 연산비트에 상응하는 수 이며, 상기 n은 상기 인터페이스모듈과 상기 주변장치간의 데이터버스(data bus)폭에 상응하는 수일 수 있다.M may be a number corresponding to the operation bits of the CPU, and n may be a number corresponding to a data bus width between the interface module and the peripheral device.

상기 전달부는, 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 멀티플렉서(multiplexer); 상기 멀티플렉서를 인에이블(enable)하기 위한 멀티플렉서 인에이블 신호를 생성하는 카운터부; 및 상기 송신제어부에 포함된 제어신호 생성부로부터 입력되는 제어신호를 상기 제2 클럭에 동기화(synchronize)하여 상기 카운터부에 전송하는 동기부를 포함하되, 상기 카운터부는 상기 멀티플렉서 인에이블 신호의 생성횟수에 상응하여 플래그신호를 생성하여 상기 제어신호 생성부로 제공할 수 있다. The transfer unit may include: a multiplexer sequentially outputting data input from the transmission control unit to the peripheral device; A counter unit for generating a multiplexer enable signal for enabling the multiplexer; And a synchronization unit for synchronizing a control signal input from a control signal generation unit included in the transmission control unit to the second clock and transmitting the control signal to the counter unit, wherein the counter unit is configured to generate the multiplexer enable signal. Correspondingly, a flag signal may be generated and provided to the control signal generator.

상기 송신 제어부는 상기 제2 클럭에 따른 상기 플래그신호를 상기 제1 클럭 에 상응하도록 변환하여 상기 제어신호 생성부로 제공하는 동기부를 더 포함할 수 있다. The transmission control unit may further include a synchronization unit converting the flag signal according to the second clock to correspond to the first clock and providing the control signal to the control signal generator.

본 발명의 다른 측면에 따르면, 슬레이브 모드(Slave mode)에서 주변장치로부터 중앙처리장치로 데이터를 수신하는 인터페이스 모듈에 있어서, 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하고, 상기 주변 장치로부터 순차적으로 입력된 데이터를 출력하는 전달부; 및 제1 클럭에 상응하여 동작하고, 상기 전달부로부터 입력되는 데이터를 중앙처리장치로 출력하는 수신제어부를 포함하되, 상기 수신제어부 및 상기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 따라 변환하기 위한 동기부를 포함하는 것을 특징으로 하는 인터페이스 모듈이 제공된다. According to another aspect of the present invention, an interface module for receiving data from a peripheral device to a central processing unit in slave mode, the interface module operating in correspondence with a second clock input from the peripheral device, A transmission unit for outputting sequentially input data; And a reception control unit operating in correspondence with a first clock and outputting data input from the transmission unit to a central processing unit, wherein the reception control unit and the transmission unit transmit control signals transmitted and received to each other according to respective operation clocks. An interface module is provided that includes a synchronizer for converting.

상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 클럭 분주기를 더 포함할 수 있다.The apparatus may further include a clock divider configured to generate the first clock using a system clock input from the CPU.

상기 수신제어부로부터 입력되는 데이터를 저장한 후, 저장된 순서대로 상기 중앙처리장치로 출력하는 수신 선입선출부를 더 포함할 수 있다. The apparatus may further include a first-in, first-out unit that stores data input from the reception control unit and outputs the data to the central processing unit in the stored order.

상기 수신선입선출부로부터 입력되는 n(임의의 자연수)비트 데이터를 m(임의의 자연수)비트 데이터로 변환하여 상기 중앙처리장치로 출력하는 레지스터부를 더 포함할 수 있다. The apparatus may further include a register unit configured to convert n (arbitrary natural number) bit data inputted from the reception first-in / first-out unit into m (arbitrary natural number) bit data and output the m-bit arbitrary data.

상기 n은 상기 인터페이스 모듈과 상기 주변장치간의 데이터버스폭에 상응하는 수이며, 상기 m은 중앙처리장치의 연산비트에 상응하는 수일 수 있다. N is a number corresponding to the data bus width between the interface module and the peripheral device, and m may be a number corresponding to the operation bit of the central processing unit.

상기 전달부는, 상기 주변장치로부터 데이터를 순차적으로 입력받아 출력하 는 수신 쉬프트레지스터; 및 상기 수신 쉬프트레지스터에 수신되는 비트 수에 상응하여 플래그 신호를 생성하여 상기 수신제어부에 포함된 제어신호 생성부로 제공하는 카운터부를 포함할 수 있다. The transfer unit includes a reception shift register for sequentially receiving data from the peripheral device and outputting the data; And a counter unit generating a flag signal corresponding to the number of bits received by the reception shift register and providing the flag signal to a control signal generator included in the reception control unit.

상기 수신제어부는 상기 제2 클럭에 따른 상기 플래그신호를 상기 제1 클럭에 상응하도록 변환하여 상기 제어신호 생성부로 제공하는 동기부를 더 포함할 수 있다. The reception control unit may further include a synchronization unit converting the flag signal according to the second clock to correspond to the first clock and providing the control signal to the control signal generator.

본 발명의 다른 측면에 따르면, 슬레이브 모드(Slave mode)에서 중앙처리장치로부터 주변장치로 데이터를 송신하는 인터페이스 방법에 있어서, (a) 제1 클럭에 상응하여 동작하는 송신제어부가 상기 중앙처리장치로부터 입력되는 데이터를 출력하는 단계; (b) 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하는 전달부가 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 단계를 포함하되, 상기 송신제어부 및 상기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 상응하여 변환하는 것을 특징으로 하는 인터페이스 방법이 제공된다. According to another aspect of the present invention, an interface method for transmitting data from a central processing unit to a peripheral device in a slave mode, the method comprising: (a) a transmission control unit operating in response to a first clock from the central processing unit; Outputting input data; (b) a transmission unit operating in correspondence with the second clock input from the peripheral device to sequentially output data input from the transmission control unit to the peripheral device, wherein the transmission control unit and the transmission unit transmit and receive mutually. An interface method is provided which converts a control signal to be corresponding to each operation clock.

(c) 클럭분주기가 상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 단계가 상기 (a)단계 이전에 더 수행될 수 있다. (c) Generating the first clock using the system clock inputted from the CPU may be further performed before step (a).

(d) 레지스터부가 상기 중앙처리장치로부터 입력되는 m(임의의 자연수)비트 데이터를 n(임의의 자연수)비트데이터로 변환하여 송신제어부로 출력하는 단계가 상기 (a)단계 이전에 더 수행될 수 있다. (d) The step of converting the m (arbitrary natural number) bit data input from the central processing unit into n (arbitrary natural number) bit data and outputting to the transmission control unit may be further performed before step (a). have.

상기 m은 상기 중앙처리장치의 연산비트에 상응하는 수이며, 상기 n은 상기 상기 주변장치로의 데이터버스(data bus)폭에 상응하는 수 일 수 있다. M may be a number corresponding to the operation bits of the CPU, and n may be a number corresponding to a data bus width to the peripheral device.

(e) 송신 선입선출부가 상기 레지스터부로부터 입력되는 n 비트 데이터를 저장한 후, 저장된 순서대로 상기 송신제어부로 출력하는 단계가 상기 (d)단계 와 상기 (a)단계 사이에 더 수행될 수 있다. (e) The first-in, first-out of the transmission unit may store the n-bit data input from the register unit, and then output the data to the transmission control unit in the stored order between the step (d) and the step (a). .

상기 (b) 단계는, (f) 멀티플렉서(multiplexer)가 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 단계; (g) 카운터부가 상기 멀티플렉서를 인에이블하기 위한 멀티플렉서 인에이블 신호를 생성하는 단계; 및 (h) 제1 동기부가 상기 송신제어부에 포함된 제어신호 생성부로부터 입력되는 제어신호를 상기 제2 클럭에 동기화(synchronize)하여 상기 카운터부로 제공하는 단계를 포함하되; 상기 카운터부는 상기 멀티플렉서 인에이블 신호의 생성횟수에 상응하여 플래그 신호를 생성하여 상기 제어신호 생성부로 제공할 수 있다 Step (b) may include: (f) a multiplexer sequentially outputting data input from the transmission control unit to the peripheral device; (g) generating, by a counter unit, a multiplexer enable signal for enabling the multiplexer; And (h) synchronizing a control signal input from a control signal generation unit included in the transmission control unit with the second clock to the counter unit by a first synchronization unit; The counter unit may generate a flag signal corresponding to the number of generations of the multiplexer enable signal and provide the flag signal to the control signal generator.

(i) 상기 송신 제어부에 포함된 제2 동기부가 상기 제 2클럭에 따른 상기 플래그신호를 상기 제1 클럭에 상응하도록 변환하여 상기 제어신호 생성부로 입력하는 단계가 상기 (h)단계 이후에 더 수행될 수 있다. (i) converting the flag signal according to the second clock into the second signal included in the transmission controller so as to correspond to the first clock, and inputting the flag signal to the control signal generator further after step (h); Can be.

본 발명의 다른 측면에 따르면, 슬레이브 모드(Slave mode)에서 주변장치로부터 중앙처리장치로 데이터를 수신하는 인터페이스 방법에 있어서, (a) 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하는 전달부가 상기 주변장치로부터 순차적으로 입력되는 데이터를 출력하는 단계; 및 (b) 제1 클럭에 상응하여 동작하는 수신제어부가 상기 전달부로부터 입력되는 데이터를 상기 중앙처리장치로 출력하는 단계를 포함하되, 상기 수신제어부 및 상기 전달부는 상호간에 송수신되는 제 어신호를 각각의 동작 클럭에 상응하여 변환하는 것을 특징으로 하는 인터페이스 방법이 제공된다. According to another aspect of the invention, in the slave mode (Slave mode) interface method for receiving data from the peripheral device to the central processing unit, (a) a transfer unit operating in response to the second clock input from the peripheral device Outputting data sequentially input from the peripheral device; And (b) a reception control unit operating in correspondence with a first clock to output data input from the transfer unit to the central processing unit, wherein the reception control unit and the transfer unit transmit and receive control signals to and from each other. An interface method is provided which converts corresponding to each operation clock.

(c) 클럭분주기가 상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 단계가 상기 (a)단계 이전에 수행될 수 있다.  (c) Generating the first clock using the system clock inputted from the CPU may be performed before step (a).

(d) 수신 선입선출부가 상기 수신제어부로부터 입력되는 데이터를 저장한 후, 저장된 순서대로 상기 중창처리장치로 출력하는 단계가 (b)단계 이후에 더 수행될 수 있다. (d) The receiving first-in first-out unit may store data input from the receiving control unit and output the data to the midsole processing apparatus in the stored order after step (b).

(e) 레지스터부가 상기 수신 선입선출부로부터 입력되는 n(임의의 자연수)비트 데이터를 m(임의의 자연수)비트 데이터로 변환하여 상기 중앙처리장치로 출력하는 단계가 상기 (d)단계 이후에 더 수행될 수 있다. (e) converting the n (arbitrary natural number) bit data inputted from the receiving first-in first-out unit into m (arbitrary natural number) bit data and outputting the m-bit arbitrary data to the central processing unit. Can be performed.

상기 n은 상기 주변장치로의 데이터버스폭에 상응하는 수이며, 상기 m은 상기 중앙처리장치의 연산비트에 상응하는 수일 수 있다. N may be a number corresponding to a data bus width to the peripheral device, and m may be a number corresponding to an operation bit of the CPU.

상기 (a)단계는, (f) 수신 쉬프트레지스터가 상기 주변장치로부터 데이터를 순차적으로 입력받아 출력하는 단계; 및 (g) 카운터부가 상기 수신 쉬프트레지스터에 수신되는 비트 수에 상응하여 플래그 신호를 생성하여 상기 수신제어부에 포함된 제어신호 생성부로 전송하는 단계를 포함할 수 있다. Step (a) may include: (f) receiving shift registers sequentially receiving data from the peripheral device and outputting the data; And (g) generating a flag signal corresponding to the number of bits received by the reception shift register and transmitting the flag signal to a control signal generator included in the reception control unit.

(h) 상기 수신제어부에 포함된 동기부가 상기 제2 클럭에 따른 상기 플래그신호를 상기 제1클럭에 상응하여 변환하여 상기 제어신호 생성부로 입력하는 단계가 상기 (g)단계 이후에 더 수행될 수 있다. (h) The synchronizing unit included in the reception control unit may convert the flag signal according to the second clock into the control signal generation unit in correspondence with the first clock, after step (g). have.

본 발명은 다양한 변경을 가할 수 있고 여러 가지 실시예를 가질 수 있는 바, 특정 실시예들을 도면에 예시하고 상세한 설명에 상세하게 설명하고자 한다. 그러나, 이는 본 발명을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. 각 도면을 설명하면서 유사한 참조부호를 유사한 구성요소에 대해 사용하였다. 본 발명을 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 발명의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.As the invention allows for various changes and numerous embodiments, particular embodiments will be illustrated in the drawings and described in detail in the written description. However, this is not intended to limit the present invention to specific embodiments, it should be understood to include all modifications, equivalents, and substitutes included in the spirit and scope of the present invention. In describing the drawings, similar reference numerals are used for similar elements. In the following description of the present invention, if it is determined that the detailed description of the related known technology may obscure the gist of the present invention, the detailed description thereof will be omitted.

제1, 제2 등의 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되어서는 안 된다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다. 및/또는 이라는 용어는 복수의 관련된 기재된 항목들의 조합 또는 복수의 관련된 기재된 항목들 중의 어느 항목을 포함한다. Terms such as first and second may be used to describe various components, but the components should not be limited by the terms. The terms are used only for the purpose of distinguishing one component from another. For example, without departing from the scope of the present invention, the first component may be referred to as the second component, and similarly, the second component may also be referred to as the first component. The term and / or includes a combination of a plurality of related items or any item of a plurality of related items.

어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이 해되어야 할 것이다. When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.

본 출원에서 사용한 용어는 단지 특정한 실시예를 설명하기 위해 사용된 것으로, 본 발명을 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 출원에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting of the present invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this application, the terms "comprise" or "have" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features. It is to be understood that the present invention does not exclude the possibility of the presence or the addition of numbers, steps, operations, components, components, or a combination thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless defined otherwise, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. Terms such as those defined in the commonly used dictionaries should be construed as having meanings consistent with the meanings in the context of the related art, and shall not be construed in ideal or excessively formal meanings unless expressly defined in this application. Do not.

본 발명은 중앙처리장치(CPU)와 주변장치간의 통신 또는 두 개의 마이크로프로세서들간의 통신을 위한 인터페이스 모듈로서, 마스터 모드 또는/및 슬레이브 모드로 동작할 수 있는 인터페이스 모듈에 범용적으로 적용될 수 있음은 자명하다. 다만, 이하에서는 해당 인터페이스 모듈이 SPI로서, 중앙처리장치(CPU)와 주변장치간에서 데이터를 송수신하는 경우를 중심으로 설명한다.The present invention is an interface module for communication between a central processing unit (CPU) and a peripheral device or communication between two microprocessors, and can be universally applied to an interface module capable of operating in master mode and / or slave mode. Self-explanatory However, hereinafter, the interface module is an SPI, and a description will be given mainly on the case of transmitting and receiving data between the CPU and the peripheral device.

이하, 첨부된 도면을 참조하여 본 발명에 따른 바람직한 실시예를 상세히 설 명하되, 도면 부호에 관계없이 동일하거나 대응하는 구성 요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings, and the same or corresponding components will be given the same reference numerals regardless of the reference numerals, and redundant description thereof will be omitted.

도 2는 슬레이브 모드에서 데이터의 전달을 매개하는 인터페이스 모듈을 나타낸 블록도이다. 도 2를 참조하면, 본 발명에 따른 인터페이스 모듈은 레지스터부(spiReg, 200), 송신부(Transmission, 210), 수신부(Reception, 220), 클럭분주기(spiClkDiv, 230), 전달부(spiTRCtrl, 240)을 포함한다.2 is a block diagram illustrating an interface module for mediating data transfer in a slave mode. 2, the interface module according to the present invention includes a register unit spiReg 200, a transmission unit 210, a reception unit 220, a clock divider spiClkDiv 230, and a transfer unit spiTRCtrl 240. ).

레지스터부(spiReg, 200)는 중앙처리장치와 연결되어 중앙처리장치와 SPI간에 데이터를 교환한다. The register unit spiReg 200 is connected to the central processing unit to exchange data between the central processing unit and the SPI.

레지스터부(spiReg, 200)는 도 1에 예시된 에스피아이 상태 레지스터(SPI STATUS REGISTER, 101), 제1 에스피아이 제어 레지스터(SPI CONTROL REGISTER1, 102), 제2 에스피아이 제어 레지스터(SPI CONTROL REGISTER2, 103)를 포함할 수 있다. The register unit spiReg 200 may include the SPI STATUS REGISTER 101 illustrated in FIG. 103).

송신부(Transmission, 210)는 송신제어부(spiTxCtrl, 211)와 송신선입선출부(spiTxFIFO, 212)을 포함할 수 있다. The transmission unit 210 may include a transmission control unit spiTxCtrl 211 and a first-in first-out unit spiTxFIFO 212.

마찬가지로, 수신부(Reception, 220)는 수신제어부(spiRxCtrl, 221)와 수신선입선출부(spiRxFIFO, 222)을 포함할 수 있다. Similarly, the reception unit 220 may include a reception control unit spiRxCtrl 221 and a first-in first-out unit spiRxFIFO 222.

여기서, 중앙처리장치와 주변장치간의 데이터 교환을 매개하는 인터페이스 모듈에서 설명의 편의상 이하에서는 중앙처리장치에서 데이터를 입력받아 주변장치로 출력하는 경우를 송신과정으로 설명하고, 그 역의 경우를 수신과정이라고 설명 한다.Here, in the interface module for mediating data exchange between the CPU and the peripheral device, for convenience of description, the following description will be given of the transmission process of receiving data from the CPU and outputting the data to the peripheral device, and vice versa. Explain.

클럭분주기(spiClkDiv, 230)는 중앙처리장치로부터 입력되는 시스템 클럭인 PCLK을 분주하여 내부클럭(Serial CLK)인 SCLK0을 생성한다. The clock divider spiClkDiv 230 divides PCLK, which is a system clock input from the CPU, to generate SCLK0, which is an internal clock.

전달부(spiTRCtrl, 240)는 외부 주변 장치와 연결되어 직렬(serial) 통신을 하는 블록이다. The transfer unit spiTRCtrl 240 is a block that is connected to an external peripheral device and performs serial communication.

여기서, MISO(Master Input Slave Output), MOSI(Master output Slave Input), SS(Slave Select), SCK(Serial Clock)등의 핀(pin)에 대해서는 당업자에게 자명하므로, 여기서는 설명을 생략한다. Here, pins such as MISO (Master Input Slave Output), MOSI (Master Output Slave Input), SS (Slave Select), SCK (Serial Clock), etc. will be apparent to those skilled in the art, and thus descriptions thereof will be omitted.

인터페이스 모듈(이하, 'SPI'인 것으로 가정하여 설명함)이 슬레이브 모드시 데이터를 송수신하는 과정에서, SPI의 구성요소가 이용하는 클럭을 살펴볼 때, 도2의 경계선을 기준으로 보면 두 가지의 영역으로 나눌 수 있다. 경계선을 기준으로 좌측의 경우 내부 클럭(즉, 도2의 경우 클럭분주기(230)가 시스템클럭(PCLK)을 분주하여 생성한 SCLK0)으로 동작으로 하며, 우측의 경우 전달부(spiTRCtrl, 240)의 SCLK 핀을 통해 주변장치로부터 입력받은 주변클럭으로 동작을 한다. In the process of transmitting / receiving data in the slave mode by the interface module (hereinafter, referred to as 'SPI'), when looking at the clock used by the component of the SPI, the boundary of FIG. Can be divided. On the left side of the boundary line, an internal clock (ie, SCLK0 generated by dividing the system clock PCLK by the clock divider 230 in FIG. 2) is operated. In the case of the right side, the transfer unit (spiTRCtrl, 240) is performed. It operates with peripheral clock inputted from peripheral device through SCLK pin of.

상기에서 설명한 바와 같이, 주변 장치에서 여러가지 딜레이(delay, 시간지연)나 기타 시간축상의 뒤틀어짐, 깨짐등이 발생할 수 있으므로, 전달부(spiTRCtrl, 240)의 SCLK 핀으로 통해 입력되는 주변 클럭은 내부 클럭과 비동기(asychronous)가 될 수 있다. As described above, since various delays or other time axis distortions or breaks may occur in the peripheral device, the peripheral clock input through the SCLK pin of the transfer unit spiTRCtrl 240 may be an internal clock. It can be asychronous with.

이때, SPI의 각 구성요소간의 제어신호를 송수신하는 과정에서 구성요소가 이용하는 클럭이 비동기(asychronous)인 경우, 제어신호의 송수신이 정상적으로 이 루어 지지 않을 수 있다. 이 때, 중앙처리장치와 주변장치간에 교환되는 데이터가 불안정할 수 있다. At this time, when the clock used by the component in the process of transmitting and receiving the control signal between the components of the SPI (asychronous), the transmission and reception of the control signal may not be performed normally. At this time, data exchanged between the CPU and the peripheral device may be unstable.

본 발명의 바람직한 일 실시예에 따른 SPI에서는 구성요소간에 제어신호를 송수신함에 있어 구성요소가 이용하는 클럭에 제어신호를 동기화(synchronize)하여 송수신함으로써 데이터의 안정을 꾀할 수 있다. 이에 대해서는 이후 도 3 및 도 4를 참조하여 설명하기로 한다. In the SPI according to the preferred embodiment of the present invention, data can be stabilized by synchronizing and transmitting the control signal to a clock used by the component in transmitting and receiving the control signal between the components. This will be described later with reference to FIGS. 3 and 4.

설명의 편의상, 이하의 도면에서 클럭분주기(230)가 시스템 클럭을 분주하여 생성한 클럭(도 2의 경우 SCLK0)를 '내부클럭'이라 칭하고, 주변장치로부터 전달부(240)의 SCLK 핀을 통하여 입력받은 클럭을 '주변클럭'이라 칭한다.For convenience of description, the clock generated by the clock divider 230 by dividing the system clock (SCLK0 in FIG. 2) is referred to as an 'internal clock' in the following drawings, and the SCLK pin of the transmitter 240 is changed from a peripheral device. The clock inputted through this is called 'peripheral clock'.

하기에서는 SPI의 구성요소간에 제어신호를 각 구성요소가 사용하는 클럭에 동기화하는 동기부의 동작을 간단히 살펴보고, 이후 데이터를 송신하는 과정 및 수신하는 과정을 순서대로 설명한다.The following briefly describes the operation of the synchronization unit for synchronizing the control signal between the components of the SPI to the clock used by each component, and then the process of transmitting and receiving data will be described in order.

도 3은 일반적인 두개의 디-플립플롭(D-flip-flop)을 사용한 동기부이다. 3 is a synchronization unit using two general D-flip-flops.

도 3에는 클럭의 라이징에지(rising edge)에 동기부가 동작을 할 경우 입력신호(In)에 대해서 두개의 플립플롭(310, 320)의 동작이 예시되어 있다.3 illustrates an operation of two flip-flops 310 and 320 with respect to the input signal In when the synchronization unit operates at the rising edge of the clock.

두개의 디-플립플롭을 사용한 동기부는 대한 구성 및 기술은 공지 기술이므로 이에 대한 상세한 설명은 생략한다.Since the configuration and the technology for the synchronization unit using the two de-flip-flops are well known techniques, detailed description thereof will be omitted.

또한, 본 발명의 바람직한 일시예에서 디-플립플롭을 사용한 동기부를 사용하였으나, 내부클럭과 주변클럭을 동기화(synchronize)하는 동기부는 명칭에 구애 받지 아니하고 사용될 수 있음은 당업자에게 있어 자명하다. In addition, although the synchronization unit using the de-flip-flop is used in the preferred embodiment of the present invention, it is apparent to those skilled in the art that the synchronization unit for synchronizing the internal clock and the peripheral clock can be used regardless of the name.

또한, 동기부가 본 발명에서 사용되는 위치 및 기능에 대해서는 하기에서 데이터를 송신하는 과정 및 수신하는 과정에서 상세히 설명한다.In addition, the position and function of the synchronization unit used in the present invention will be described in detail in the process of transmitting and receiving data below.

이하에서는, 도 4 및 도 5를 참조하여 슬레이브 모드시 SPI가 중앙처리 장치로부터 데이터를 입력받아 주변장치로 데이터를 송신하는 경우를 설명하고, 도 6 및 도 7를 참조하여 그 역의 경우를 설명한다.Hereinafter, a case in which an SPI receives data from a central processing unit and transmits data to a peripheral device in slave mode will be described with reference to FIGS. 4 and 5, and vice versa with reference to FIGS. 6 and 7. do.

이하에서, 본 발명의 일실시예에서 중앙처리장치와 주변장치간에 데이터를 교환하는 과정을 예로 들어 설명하나, SPI는 주변장치간에도 사용될 수 있음은 당업자에게 있어 자명할 것이다. Hereinafter, the process of exchanging data between the central processing unit and the peripheral device in one embodiment of the present invention will be described as an example, it will be apparent to those skilled in the art that SPI can also be used between peripheral devices.

도 4는 본 발명의 바람직한 일 실시예에 따른 SPI의 슬레이브 모드에서 데이터를 송신하는 구성을 도시한 도면이고, 도 5는 본 발명의 바람직한 일 실시예에 따른 슬레이브 모드에서 SPI의 데이터 송신방법에 대한 흐름도이다.4 is a diagram illustrating a configuration for transmitting data in a slave mode of an SPI according to an embodiment of the present invention, and FIG. 5 is a diagram illustrating a data transmission method of an SPI in a slave mode according to an embodiment of the present invention. It is a flow chart.

도 4는 도2의 송신부를 보다 상세하게 도시한 도면으로서, 도 4를 참조하면, 레지스터부(200)는 비트분배기(201)를 포함하고, 송신선입선출부(212)는 FIFO(First Input First Ouput, 400)를 포함한다. 4 is a diagram illustrating the transmitter of FIG. 2 in more detail. Referring to FIG. 4, the register unit 200 includes a bit divider 201, and the first-in first-out unit 212 includes a first input first (FIFO). Ouput, 400).

또한, 송신제어부(211)는 송신 데이터레지스터(421), 송신 쉬프트레지스터(420), 송신유한상태머신(Transmission Finite State Mashine, 이하에서 'TxFSM'이라 칭함)(410), 제2동기부(411)를 포함한다.Also, the transmission control unit 211 includes a transmission data register 421, a transmission shift register 420, a transmission finite state mashine (hereinafter referred to as TxFSM) 410, and a second synchronization unit 411. ).

전달부(spiTRCtrl, 240)은 멀티플렉서(243), 카운터부(424), 제1동기부(241) 를 포함한다.The transfer unit spiTRCtrl 240 includes a multiplexer 243, a counter unit 424, and a first synchronization unit 241.

비트 분배기(201)는 중앙처리 장치로부터 입력되는 m(임의의 자연수)비트의 데이터를 n(임의의 자연수)비트 데이터로 나누어 SPI의 송신선입선출부 (spiTxFIFO, 212)에 전송한다. The bit divider 201 divides m (random natural number) bits of data input from the central processing unit into n (arbitrary natural numbers) bit data and transmits the data to the first-in first-out part of the SPI (spiTxFIFO) 212.

이때, m은 중앙처리장치의 연산비트일 수 있으며, n은 인터페이스모듈과 주변장치간의 데이터버스(data bus)폭에 상응하는 수 일 수 있다.In this case, m may be an operation bit of the central processing unit, and n may be a number corresponding to the data bus width between the interface module and the peripheral device.

예를 들어, 중앙처리장치가 8051인 경우는 8비트로 연산하므로 m은 8일 수 있으며, 중앙처리장치가 ARM(Advanced RISC Machine)인 경우에는 32비트로 연산하므로 m은 32일 수 있다. For example, when the CPU is 8051, m may be 8 because it is calculated as 8 bits, and when the CPU is an ARM (Advanced RISC Machine), m may be 32.

또한, n은 주변장치와 인터페이스모듈간(보다 상세하게는 전달부(240)와 주변장치간)의 데이터버스(data bus)폭에 따라 변경될 수 있다. 데이터버스 폭은 1hz가 장치간에 전송할 수 있는 데이터의 양이다.In addition, n may be changed according to the data bus width between the peripheral device and the interface module (more specifically, between the transmission unit 240 and the peripheral device). The data bus width is the amount of data that 1 hz can transfer between devices.

그러나, m과 n은 반드시 상술한 의미에 한정되지 아니하고, 본 발명을 구현하는 과정 또는 인터페이스 모듈과 주변장치와의 환경에 따라 여러가지로 변경될 수 있음은 당업자에게 자명하다. However, m and n are not necessarily limited to the above-described meaning, and it will be apparent to those skilled in the art that various changes may be made depending on the process of implementing the present invention or the environment of the interface module and the peripheral device.

송신선입선출부(spiTxFIFO, 212)는 FIFO(First Input First Output, 400)를 포함하므로, 데이터를 저장한 다음, 저장된 순서대로 다시 읽어 들여 SPI의 송신 데이터레지스터(421)로 데이터를 출력할 수 있다. Since the first-in-first-out (spiTxFIFO) 212 includes a FIFO (First Input First Output, 400), the data may be stored and then read back in the stored order to output the data to the transmission data register 421 of the SPI. .

보다 상세하게는, 중앙처리장치로부터 데이터가 순간적으로 많은 양이 입력된다 하여도, FIFO(400)에서 저장한 다음, 저장된 순서대로 다시 읽어 들여 송신 데이터레지스터(421)로 전달 할 수 있다.More specifically, even if a large amount of data is instantaneously input from the central processing unit, the data can be stored in the FIFO 400 and then read back in the stored order and transferred to the transmission data register 421.

이후, 중앙처리장치로부터 입력된 데이터가 송신 데이터레지스터(421)을 통하여 송신 쉬프트레지스터(420)에 전달되는 과정은 당업자에게 공지된 기술이므로 여기서는 설명을 생략하고, 중앙처리장치로부터 입력된 데이터가 송신쉬프트 레지스트에 전달된 이후부터 하기에서 설명한다.Since the process of transferring the data input from the central processing unit to the transmission shift register 420 through the transmission data register 421 is a technique known to those skilled in the art, a description thereof is omitted here, and the data input from the central processing unit is transmitted. It will be described below after transferring to the shift resist.

송신 데이터레지스터(421)로부터 입력받은 데이터는 송신 쉬프트레지스터(420)에서 멀티플렉서(243)을 통해 주변장치로 전송된다.Data received from the transmission data register 421 is transmitted from the transmission shift register 420 to the peripheral device through the multiplexer 243.

이때, 도 4에서 경계선을 기준으로 좌측은 내부클럭을 이용하여 동작하며, 우측은 주변장치로부터 입력받은 주변클럭을 이용하여 동작한다.  In this case, the left side operates using an internal clock on the basis of the boundary line in FIG. 4, and the right side operates using a peripheral clock input from a peripheral device.

여기서 경계선을 기준으로 좌측에 위치하는 TxFSM(410) 및 SPI의 송신 쉬프트레지스터(SPITSR)(420), 송신 데이터레지스터(421)는 내부클럭으로 동작을 하고, 카운터부(242) 및 멀티플렉서(243)는 주변클럭으로 동작을 한다. 따라서, 클럭이 비동기(asynchronous)일 수 있으므로, 전송하는 데이터가 불안정해질 수 있다.Here, the TxFSM 410 and the SPI transmission shift register (SPITSR) 420 and the transmission data register 421 which operate on the left side of the boundary line operate as internal clocks, and the counter unit 242 and the multiplexer 243 are operated. Acts as a peripheral clock. Therefore, since the clock may be asynchronous, the data to be transmitted may become unstable.

본 발명의 바람직한 일 실시예에 의하면, TxFSM(410)에서 출력되는 제어신호는 신호는 제1동기부(241)에서 주변클럭으로 동기화 (synchronize)된다. According to an exemplary embodiment of the present invention, the control signal output from the TxFSM 410 is synchronized with the peripheral clock from the first synchronization unit 241.

TxFSM(410)은 미리 지정된 프로그램 모듈로서, 송신(예를 들어, 중앙처리장치로부터 수신된 데이터를 주변장치로의 송신)을 시작하는 start신호(카운터부(242)를 인에이블(enable)하는 신호), 송신을 종료하는 stop신호(카운터부(242)를 디스에이블(disable)하는 신호)등의 제어신호를 출력하여 카운터부(242)로 전송한다. TxFSM(410)은 데이터 송신의 시작 또는/및 종료를 제어하기 위한 제어 신호 를 생성하여 출력하는 제어 신호 생성부의 일 예로서, 그 명칭에 관계없이 동일한 기능을 수행할 수 있는 모든 프로그램 모듈 또는 하드웨어 구성이 제한없이 모두 적용될 수 있음은 당업자에게 자명하다. 다만, 본 명세서에서는 제어 신호 생성부가 TxFSM인 경우를 가정하여 설명한다.The TxFSM 410 is a predetermined program module, which is a signal for enabling the start signal (counter unit 242) to start transmission (for example, data received from the central processing unit to the peripheral device). ) And a control signal such as a stop signal for ending transmission (a signal for disabling the counter 242) is output to the counter 242. The TxFSM 410 is an example of a control signal generator that generates and outputs a control signal for controlling the start or / and end of data transmission, and all program modules or hardware components capable of performing the same function regardless of its name. It will be apparent to those skilled in the art that all of these can be applied without this limitation. However, in the present specification, it is assumed that the control signal generator is TxFSM.

인터페이스 모듈이 중앙처리장치로부터 데이터를 입력받아 주변장치로 데이터를 송신하는 과정이 짧은 시간내에서도 여러 번 진행 될 수 있다. 즉 TxFSM(410)에서 카운터부(242)로 짧은 시간내에서도 start신호와 stop신호를 전송할 수 있다. 그러나 TxFSM(410)은 내부 클럭을 이용하여 동작하며, 카운터부(242)는 주변클럭을 이용하여 동작하므로, 내부 클럭과 주변 클럭이 비동기(asychronous)인 경우에, 데이터의 송신이 불안정해진다.The interface module receives data from the central processing unit and transmits the data to the peripheral device several times within a short time. That is, the start signal and the stop signal may be transmitted from the TxFSM 410 to the counter unit 242 within a short time. However, since the TxFSM 410 operates using the internal clock and the counter unit 242 operates using the peripheral clock, when the internal clock and the peripheral clock are asynchronous, the data transmission becomes unstable.

따라서, TxFSM(410)에서 출력되는 제어신호는 본발명의 바람직한 실시예에 따라 제1동기부(241)에서 주변클럭으로 동기화 (synchronize)되어 카운터부(242)로 입력된다.Therefore, the control signal output from the TxFSM 410 is synchronized with the peripheral clock from the first synchronization unit 241 according to the preferred embodiment of the present invention is input to the counter unit 242.

예를 들어, TxFSM(410)이 인터페이스 모듈의 전송을 시작하는 start신호(일종의 제어신호)를 출력한 경우, 제 1동기부(241)에서 start신호는 주변클럭으로 동기화된다. 동기화 하는 과정은 도 3을 참조하여 설명하였으므로, 여기서 중복된 설명은 생략한다.For example, when the TxFSM 410 outputs a start signal (a kind of control signal) to start transmission of the interface module, the start signal is synchronized to the peripheral clock in the first synchronization unit 241. Since the process of synchronizing has been described with reference to FIG. 3, duplicate description thereof will be omitted.

주변클럭으로 동기화된 start신호는 카운터부(242)에 입력되어 카운터부(242)를 인에이블시킨다.The start signal synchronized to the peripheral clock is input to the counter unit 242 to enable the counter unit 242.

카운터부(242)는 멀티플렉서(243)을 인에이블시켜 송신 쉬프트레지스터(420) 로부터 멀티플렉서(243)로 입력되는 데이터를 순차적으로 주변장치로 송신한다.The counter unit 242 enables the multiplexer 243 to sequentially transmit data input from the transmission shift register 420 to the multiplexer 243 to the peripheral device.

이때, 카운터부(242)는 멀티플렉서(243)를 인에이블한 횟수를 세어, 일정한 횟수에 도달한 경우 플래그 신호를 생성한다.At this time, the counter unit 242 counts the number of times the multiplexer 243 is enabled, and generates a flag signal when a certain number of times is reached.

예를 들어, 전달부(240)와 주변장치간의 데이터버스폭에 상응하여 미리 지정된 횟수가 16인경우에, 카운터부(242)는 멀티플렉서(243)를 인에이블한 횟수가 16인 경우에 플래그 신호를 생성한다. For example, when the predetermined number of times corresponding to the data bus width between the transmission unit 240 and the peripheral device is 16, the counter unit 242 generates a flag signal when the number of times the multiplexer 243 is enabled is 16. Create

TxFSM(410)은 SPI가 중앙처리장치에서 주변장치로 데이터를 송신을 시작하는 start명령이라는 제어신호를 카운터부(242)에 전송한 뒤, 데이터의 송신이 정상적으로 이루어지고 있는지를 플래그 신호를 수신하여 모니터링한다. The TxFSM 410 transmits a control signal called a start command to start the data transmission from the central processing unit to the peripheral device to the counter unit 242, and then receives a flag signal indicating whether data transmission is normally performed. Monitor.

그러나, TxFSM(410)은 앞에서 설명한 바와 같이, 내부 클럭으로 동작하고, 카운터부(242)는 주변클럭으로 동작하며, 카운터부(242)에서 생성하는 플래그신호도 주변클럭과 연동되어 생성된다. 따라서, 플래그 신호가 TxFSM(410)에 직접 입력될 경우에는 연동되는 클럭이 비동기이므로, SPI가 정상적으로 데이터를 송신하는지를 모니터링이 제대로 이루어지지 않는다.However, as described above, the TxFSM 410 operates as an internal clock, the counter unit 242 operates as a peripheral clock, and a flag signal generated by the counter unit 242 is generated in association with the peripheral clock. Therefore, when the flag signal is directly input to the TxFSM 410, since the interlocked clocks are asynchronous, it is not properly monitored whether the SPI normally transmits data.

본 발명의 바람직한 실시예에 따라 카운터부(242)에서 생성된 플래그 신호는 제2동기부(411)에서 내부클럭(즉, 도 4에서 SCLK0)으로 동기화(synchronize)되어 TxFSM(410)에 입력된다. 따라서, 내부클럭으로 동작하는 TxFSM(410)은 내부 클럭으로 동기화된 플래그 신호를 입력받음으로써, SPI가 중앙처리장치로부터 주변장치로 데이터를 정상적으로 전송하는지를 보다 정확하게 모니터링할 수 있다. According to a preferred embodiment of the present invention, the flag signal generated by the counter unit 242 is synchronized to an internal clock (that is, SCLK0 in FIG. 4) by the second synchronization unit 411 and input to the TxFSM 410. . Therefore, the TxFSM 410 operating as an internal clock can more accurately monitor whether the SPI normally transmits data from the CPU to the peripheral device by receiving a flag signal synchronized with the internal clock.

또한, 상술한 바와 같이 TxFSM(410)에서 보다 정확한 모니터링이 이루어 짐 으로써, TxFSM(410)에서 송신 데이터레지스터(421)과 송신 쉬프트레지스터(420)로 보다 정확한 제어명령(도 4에는 미도시)을 전송할 수 있다. In addition, as described above, more accurate monitoring is performed in the TxFSM 410, so that a more accurate control command (not shown in FIG. 4) is transmitted from the TxFSM 410 to the transmission data register 421 and the transmission shift register 420. Can transmit

예를 들어, 송신 데이터레지스터(421) 및 송신 쉬프트레지스터(420)가 16비트 단위로 데이터를 전송할 수 있다. 즉, SPI와 주변장치간의 데이터버스폭에 상응하여 16비트 단위로 데이터를 전송할 수 있다. For example, the transmission data register 421 and the transmission shift register 420 may transmit data in units of 16 bits. That is, data can be transmitted in units of 16 bits corresponding to the data bus width between the SPI and the peripheral device.

이 때, 카운터부(242)가 멀티플랙서(243)을 16번 인에이블한 후 플래그 신호를 생성하면, 송신 쉬프트레지스터(420)의 16비트 단위의 데이터가 주변장치로 전송이 되었음을 의미한다. 따라서, 내부 클럭으로 동기화되어 보다 정확한 플래그신호를 입력받는 TxFSM(410)은 송신 데이터레지스터(421)에는 FIFO(400)로부터 16비트 단위의 데이터를 입력받으라는 제어 신호(예를 들어, Read)을, 송신 쉬프트레지스터(420)에는 송신 데이터레지스터(421)로부터 16비트 단위의 데이터를 입력받으라는 제어 신호(예를 들어, Read)을 전송할 수 있다. At this time, when the counter unit 242 enables the multiplexer 243 16 times and generates a flag signal, it means that data in units of 16 bits of the transmission shift register 420 has been transmitted to the peripheral device. Accordingly, the TxFSM 410, which is synchronized with the internal clock and receives a more accurate flag signal, transmits a control signal (for example, read) to the 16-bit unit data from the FIFO 400 to the transmission data register 421. In addition, the transmission shift register 420 may transmit a control signal (for example, read) to receive 16-bit data from the transmission data register 421.

이 때, TxFSM(410), 송신 데이터레지스터(421) 및 송신 쉬프트레지스터(420)은 내부 클럭으로 동작하므로, 상호간에 송수신하는 제어신호는 같은 내부 클럭으로 연동되어 있으므로 별다른 동기화는 필요없다.At this time, since the TxFSM 410, the transmission data register 421 and the transmission shift register 420 operate as the internal clock, the control signals to be transmitted and received to each other are linked to the same internal clock, so no special synchronization is necessary.

따라서, 본 발명의 바람직한 실시예에 따르면, TxFSM(410)에서 송신 데이터레지스터(421)과 송신 쉬프트레지스터(420)로 보다 정확한 제어명령(도 4에는 미도시)을 전송할 수 있다. Therefore, according to a preferred embodiment of the present invention, a more accurate control command (not shown in FIG. 4) can be transmitted from the TxFSM 410 to the transmission data register 421 and the transmission shift register 420.

지금까지 도 4를 참조하여 상술한 바와 같이, 본 발명의 바람직한 일 실시예에 따라 슬레이브 모드에서 SPI가 데이터를 송신하는 과정에서, 송신제어부(211)와 전달부(240)가 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 따라 동기화하여 송수신하는 과정을 설명하였다. As described above with reference to FIG. 4, in a process in which the SPI transmits data in the slave mode according to an exemplary embodiment of the present invention, the transmission control unit 211 and the transmission unit 240 control each other to be transmitted and received. The process of synchronizing and transmitting and receiving signals according to respective operating clocks has been described.

그러나, 도 4를 참조하여 설명한 실시예에서 카운터부(242)는 4비트 카운터를, 멀티 플렉서(243)는 16:1의 멀티플렉서를, 제1 및 제2 동기부(241, 411)는 디-플립플롭(D-flipflop)을 예시로 사용하였으나, 이에 한정되지 아니함은 당업자에게 있어 자명할 것이다.However, in the embodiment described with reference to FIG. 4, the counter unit 242 is a 4-bit counter, the multiplexer 243 is a 16: 1 multiplexer, and the first and second synchronizers 241 and 411 are decoded. -D flip-flop (D-flipflop) was used as an example, but not limited to it will be apparent to those skilled in the art.

이상의 SPI의 슬레이브 모드에서 데이터를 송신하는 과정을 참조하여 데이터 송신방법에 대해 도 5를 참조하여 살펴보기로 한다. The data transmission method will now be described with reference to FIG. 5 with reference to a process of transmitting data in the slave mode of the SPI.

이하에서, 도 4의 실시예를 참조하여 설명한 것과 중복되는 되는 설명은 생략한다. 또한, 설명의 편의상 TxFSM(410)에서 송신을 시작하는 제어신호(예를 들어 start신호)인 경우를 예를 들어 설명한다.Hereinafter, descriptions overlapping with those described with reference to the exemplary embodiment of FIG. 4 will be omitted. For convenience of explanation, the case of a control signal (for example, a start signal) that starts transmission in the TxFSM 410 will be described as an example.

도 5에 도시된 바와 같이, 단계 S510에서 TxFSM(410)에서 출력되는 제어 신호는 제1 동기부(241)에서 주변클럭으로 동기화(synchronize)되고, 단계 S515에서 카운터부(242)에 입력되어 카운터를 인에이블시킨다.As shown in FIG. 5, in step S510, the control signal output from the TxFSM 410 is synchronized from the first synchronization unit 241 to the peripheral clock, and is input to the counter unit 242 in step S515. Enable.

이어서, 카운터부(241)는 단계 S540에서 멀티플렉서를 인에이블시키고, 단계 S545에서 SPI의 송신 쉬프트레지스터(420)로부터 입력된 데이터가 멀티플렉서(243)를 통해 출력된다.Subsequently, the counter unit 241 enables the multiplexer in step S540, and the data input from the transmit shift register 420 of the SPI is output through the multiplexer 243 in step S545.

또한, 카운터부(241)는 멀티플렉서(243)를 인에이블 한 횟수가 미리 지정된 횟수(즉, 전달부(240)와 주변장치간의 데이터버스폭에 상응한 횟수)가 될 때마다 플래그 신호를 생성한다(단계 S520). 생성된 플래그 신호는 제 2동기부(411)에 의해 내부클럭(즉, 도 4의 경우 SCLK0) 동기화되고(단계 S525), TxFSM(410)은 내부클럭으로 동기화된 플래그 신호를 참조하여 주변장치로의 데이터 송신이 정상적으로 이루어지고 있는지 모니터링한다(단계 S530). In addition, the counter unit 241 generates a flag signal whenever the number of times the multiplexer 243 is enabled becomes a predetermined number of times (that is, a number corresponding to the data bus width between the transmission unit 240 and the peripheral device). (Step S520). The generated flag signal is synchronized with the internal clock (i.e., SCLK0 in FIG. 4) by the second synchronization unit 411 (step S525), and the TxFSM 410 is sent to the peripheral device with reference to the flag signal synchronized with the internal clock. It is monitored whether the data transmission is normally performed (step S530).

지금까지 SPI 슬레이브 모드에서 중앙처리장치로부터 데이터를 입력받아 주변장치로 데이터를 전송하는 구성 및 방법에 대해서 살펴보았다. 이하에서는 SPI 슬레이브 모드에서 주변장치로부터 데이터를 수신하여 중앙처리 장치로 데이터를 전송하는 구성 및 방법에 대해서 도 6 및 도 7를 참조하여 살펴본다. So far, the configuration and method of receiving data from the central processing unit and transmitting the data to the peripheral device in the SPI slave mode have been described. Hereinafter, a configuration and a method of receiving data from a peripheral device in the SPI slave mode and transmitting data to the CPU will be described with reference to FIGS. 6 and 7.

도 6은 본 발명의 바람직한 일 실시예에 따라 SPI의 슬레이브 모드에서 데이터를 송신하는 구성을 도시한 도면이고, 도 7은 본 발명의 바람직한 일 실시예에 따른 슬레이브 모드에서 SPI의 데이터 수신방법에 대한 흐름도이다. 6 is a diagram illustrating a configuration of transmitting data in a slave mode of an SPI according to an embodiment of the present invention, and FIG. 7 is a diagram illustrating a method of receiving data of an SPI in a slave mode according to an embodiment of the present invention. It is a flow chart.

도 6은 도 2의 수신부를 보다 상세하게 도시한 도면으로서, 도 6을 참조하면, 레지스터부(200)는 비트결합부(601)를 포함하고, 수신선입선출부(212)는 FIFO(First Input First Output)(602)를 포함한다.FIG. 6 is a diagram illustrating the receiver of FIG. 2 in more detail. Referring to FIG. 6, the register unit 200 includes a bit combiner 601, and the first-in first-out unit 212 includes a FIFO (First Input). First Output) 602.

또한, 수신제어부(221)는 수신 데이터레지스터(607), 수신유한상태머신(Reception Finite State Mashine, 이하 'RxFSM'라 칭함)(606), 동기부(605)를 포함한다. In addition, the reception control unit 221 includes a reception data register 607, a reception finite state machine (hereinafter referred to as RxFSM) 606, and a synchronization unit 605.

전달부(spiTRCtrl, 240)은 카운터부(604), 수신 쉬프트레지스터(240)를 포함한다. The transfer unit spiTRCtrl 240 includes a counter unit 604 and a reception shift register 240.

여기서, 도 6에 도시된 블록도는 각 구성요소의 기능 및 각 구성요소가 이용하는 클럭을 기준으로 나눈 것으로, 도 6에 도시된 구성으로 본 발명이 한정되지 않음은 당업자에게 있어 자명할 것이다. Here, the block diagram shown in FIG. 6 is divided based on the function of each component and the clock used by each component, and it will be apparent to those skilled in the art that the present invention is not limited to the configuration shown in FIG. 6.

상기에서 도 4 및 도 5를 참조하여 설명한 방식과 같이, 이하에서는 설명의 편의상 인터페이스 모듈은 SPI을 예로 들어서 설명하며, 슬레이브모드에서 주변장치로부터 데이터를 입력받아 중앙처리장치로 수신하는 경우를 예로 들어서 설명한다. As described above with reference to FIGS. 4 and 5, for convenience of description, the interface module will be described below using SPI as an example, and receiving data from a peripheral device in a slave mode as a central processing unit as an example. Explain.

슬레이브 모드에서 전달부(240)의 SCK핀으로 주변장치로부터 주변클럭(도 6의 경우 SCLK1)이 입력되면 수신 쉬프트레지스터(603)는 주변장치로부터 데이터를 입력받는다.When the peripheral clock (SCLK1 in FIG. 6) is input from the peripheral device to the SCK pin of the transmitter 240 in the slave mode, the reception shift register 603 receives data from the peripheral device.

이때, 상기의 본 발명의 바람직한 일실시예에서는 슬레이브모드에서 전달부(240)의 SCK핀으로 주변클럭이 입력되는 경우에 수신 쉬프트레지스터(603)가 주변장치로부터 데이터입력받는 것을 시작하는 것을 예로 들었으나, 본 발명이 이에 한정되지 않음은 당업자에게 자명할 것이다.In this case, in the preferred embodiment of the present invention, when the peripheral clock is input to the SCK pin of the transmitter 240 in the slave mode, the reception shift register 603 starts receiving data from the peripheral device as an example. However, it will be apparent to those skilled in the art that the present invention is not limited thereto.

예를 들어, 주변클럭이 전달부(240)의 SCK핀으로 입력되더라도 RxFSM(606)의 제어신호(예를 들어 Read)가 수신 쉬프트레지스터(603)에 입력되어야 주변장치로부터 데이터를 입력받게 할 수 있음은 당업자에게 자명할 것이다. For example, even when the peripheral clock is input to the SCK pin of the transmitter 240, a control signal (for example, a read) of the RxFSM 606 must be input to the reception shift register 603 to receive data from the peripheral device. It will be apparent to those skilled in the art.

주변 장치로부터 입력되는 데이터는 SPI의 수신 쉬프트레지스터(603)를 통하여 수신 데이터레지스터(607)에 입력된다. The data input from the peripheral device is input to the reception data register 607 through the reception shift register 603 of the SPI.

이 때, 카운터부(604)는 수신 쉬프트레지스터(603)에 입력되는 데이터 비트 수를 세어 미리 지정된 일정한 횟수에 도달하면 플래그 신호를 생성한다. 여기서, 미리 지정된 일정한 횟수는 SPI를 구현하는 과정에서, 또는 데이터를 수신하는 주변장치와의 환경에 따라 여러 가지로 변경될 수 있음은 당업자에게 자명할 것이다. At this time, the counter unit 604 counts the number of data bits input to the reception shift register 603 and generates a flag signal when a predetermined number of times is reached. Here, it will be apparent to those skilled in the art that the predetermined number of times may be variously changed in the process of implementing the SPI or depending on the environment with the peripheral device receiving the data.

예를 들어, 도 4를 참조하여 설명한 바와 같이, 전달부와 주변장치간의 데이터버스폭에 상응하여 미리 지정된 횟수일 수 있다.For example, as described with reference to FIG. 4, it may be a predetermined number of times corresponding to the data bus width between the transfer unit and the peripheral device.

예를 들어, 수신 쉬프트레지스터(607) 및 수신 데이터레지스터(602)가 한번에 전송할 수 있는 데이터의 단위에 상응한 횟수일 수 있다. For example, the reception shift register 607 and the reception data register 602 may be a number of times corresponding to a unit of data that can be transmitted at one time.

이하에서는, 도 4를 참조하여 설명한 예와 동일한 방식으로, 전달부(240)와 주변장치와의 데이터버스폭에 상응한 횟수가 16인 걸로 가정하고 설명한다. Hereinafter, it will be described on the assumption that the number corresponding to the data bus width between the transmission unit 240 and the peripheral device is 16 in the same manner as the example described with reference to FIG. 4.

카운터부(604)는 수신 쉬프트레지스터(603)가 주변장치로부터 16비트를 입력받을 때마다 플래그 신호를 생성하고, 생성된 플래그 신호는 SPI의 수신과정이 정상적인지를 모니터링하는 RxFSM(606)으로 전송한다.The counter unit 604 generates a flag signal whenever the reception shift register 603 receives 16 bits from the peripheral device, and transmits the generated flag signal to the RxFSM 606 for monitoring whether the SPI reception process is normal. .

이 때, 경계선을 기준으로 우측에 위치하는 카운터부(604) 및 수신 쉬프트레지스터는 주변장치로부터 SCK핀으로 입력되는 주변클럭으로 동작한다. 그리고, 경계선의 우측에 위치하는 수신 데이터레지스터(607) 및 RxFSM(606)은 클럭분주기(230)가 시스템 클럭(도 6의 경우 PCLK)을 분주하여 생성한 내부클럭(즉, 도 6의 경우 SCLK0)으로 동작한다.At this time, the counter unit 604 and the reception shift register located on the right side of the boundary line operate as peripheral clocks inputted from the peripheral device to the SCK pin. In addition, the reception data register 607 and the RxFSM 606 positioned on the right side of the boundary line have an internal clock generated by the clock divider 230 by dividing the system clock (PCLK in FIG. 6) (ie, in the case of FIG. 6). SCLK0).

여기서, 주변클럭과 내부클럭이 비동기(asychronous)가 될 수 있음은 도 4를 참조하여 설명하였으므로, 여기서는 설명을 생략한다. Here, since the peripheral clock and the internal clock may be asynchronous (asychronous) has been described with reference to Figure 4, the description thereof will be omitted.

RxFSM(410)은 미리 지정된 프로그램 모듈로서, 수신(예를 들어, 주변장치로 부터 데이터를 입력받아 중앙처리장치로 출력)과정이 정상적인지 여부를 모니터링한다.The RxFSM 410 is a predetermined program module that monitors whether a reception (for example, data input from a peripheral device and output to a central processing unit) is normal.

SPI가 주변장치로부터 데이터를 수신하여 중앙처리장치로 데이터를 출력하는 과정은 짧은 시간내에서도 여러 번 반복 할 수 있다. 종래의 기술에 있어서, 내부 클럭으로 동작하는 RxFSM(606)이 SPI의 수신 과정이 정상적인지 여부를 모니터링하기 위해 주변 클럭으로 동작하는 전달부의 기타 구성 요소로부터 제어신호를 수신을 하였다. 따라서, 제어신호가 연동되는 클럭이 비동기이므로 짧은 시간내에서도 여러 번 수신하는 과정에서 RxFSM(606)의 모니터링이 정확하게 이루어지지 않았다.The process of receiving data from the peripherals and outputting the data to the central processing unit can be repeated many times within a short time. In the prior art, the RxFSM 606, which operates on the internal clock, receives control signals from other components of the transfer unit that operates on the peripheral clock to monitor whether the SPI reception process is normal. Therefore, since the clock to which the control signal is interlocked is asynchronous, the RxFSM 606 is not accurately monitored in the process of receiving the signal several times within a short time.

본 발명의 바람직한 실시예에 따르면, 카운터부(604)가 생성한 플래그 신호는 동기부(605)에서 내부클럭으로 동기화된 후 내부 클럭으로 동작하는 RxFSM(606)에 입력된다. 따라서, 내부 클럭으로 동작하는 RxFSM(606)에서 내부클럭에 동기화된 플래그 신호를 수신함으로써, SPI의 수신과정이 정상적인지 여부에 대한 모니터링이 보다 정확하게 이루어진다.According to a preferred embodiment of the present invention, the flag signal generated by the counter unit 604 is input to the RxFSM 606 which is synchronized with the internal clock in the synchronizer 605 and then operates as an internal clock. Accordingly, by receiving a flag signal synchronized with the internal clock in the RxFSM 606 operating as an internal clock, monitoring of whether the reception process of the SPI is normal is made more accurate.

더 나아가, RxFSM(606)은 플래그신호를 수신할 때, 수신 데이터레지스터(602)로 보다 정확한 제어신호를 전송할 수 있다. Further, when the RxFSM 606 receives the flag signal, the RxFSM 606 may transmit a more accurate control signal to the receiving data register 602.

예를 들어, 송신 데이터레지스터(421)가 16비트 단위로 데이터를 전송할 수 있다. 즉, SPI와 주변장치간의 데이터버스폭에 상응하여 16비트 단위로 데이터를 전송할 수 있다.For example, the transmission data register 421 may transmit data in units of 16 bits. That is, data can be transmitted in units of 16 bits corresponding to the data bus width between the SPI and the peripheral device.

이 때, 도 6을 참조하여 상술한 실시예의 경우 카운터부(604)가 플래그 신호를 생성하면, 주변장치로부터 수신 쉬프트레지스터(607)를 통하여 수신 데이터레지 스터(602)가 16비트의 데이터가 수신하였음을 의미한다. 따라서, RxFSM(606)은 내부클럭으로 동기화되어 보다 정확한 플래그신호를 입력받아서 그에 상응하여 수신 데이터레지스터(602)로부터 수신선입선출부(222)로 16비트의 데이터를 송신하라는 제어신호(예를 들어, Write)를 제어신호를(예를 들어, read)를 전송할 수 있다. In this case, in the case of the embodiment described above with reference to FIG. 6, when the counter unit 604 generates a flag signal, 16-bit data is received by the reception data register 602 from the peripheral device through the reception shift register 607. It means. Accordingly, the RxFSM 606 is synchronized to an internal clock to receive a more accurate flag signal and correspondingly transmit a 16-bit data from the reception data register 602 to the reception first-in, first-out part 222 (for example, for example). , Write) can transmit a control signal (for example, read).

이 때, RxFSM(606) 및 수신 데이터레지스터(607)는 내부 클럭으로 동작하므로, 상호간에 송수신하는 제어신호는 같은 내부 클럭으로 연동되어 있으므로 별다른 동기화는 필요없다. At this time, since the RxFSM 606 and the receiving data register 607 operate with an internal clock, the control signals transmitted and received between the two are interlocked with the same internal clock, so that no special synchronization is required.

따라서, 본 발명의 바람직한 실시예엘 따르면, RxFSM(606)에서 수신 데이터레지스터(607)로 보다 정확한 제어명령(도 6에는 미도시)를 전송할 수 있다. Therefore, according to a preferred embodiment of the present invention, a more accurate control command (not shown in FIG. 6) can be transmitted from the RxFSM 606 to the receiving data register 607.

상기에서 상술한 바와 같이, RxFSM(606)은 인터페이스 모듈에서 수신(예를 들어, 주변장치로부터 데이터를 입력받아 중앙처리장치로 출력)이 정상적으로 수행되는지 여부를 모니터링하며, 그에 상응하여 제어신호를 생성하여 수신 데이터레지스터(607)에 전송할 수 있다As described above, the RxFSM 606 monitors whether the reception (eg, receiving data from the peripheral device and outputting the data to the central processing unit) from the interface module is normally performed, and generates a control signal accordingly. Can be transmitted to the reception data register 607.

또한, 본 발명의 다른 실시예에 의하면, 슬레이브 모드에서 전달부(240)의 SCK핀으로 주변장치로부터 주변클럭이 입력되더라도, RxFSM으로부터 제어신호(예를 들어 Read)가 수신 쉬프트레지스터(603)에 입력되어야 수신이 개시될 수 있다.According to another embodiment of the present invention, even when a peripheral clock is input from the peripheral device to the SCK pin of the transmission unit 240 in the slave mode, a control signal (for example, Read) from the RxFSM is transmitted to the reception shift register 603. Receipt can be initiated only after input.

예를 들어, RxFSM에서 수신(주변장치로부터 데이터를 입력받아 중앙처리장치로 출력)을 시작하는 start신호(수신 쉬프트레지스트(603)를 인에이블(enable) 하는 신호), 수신을 종료하는 stop신호(수신 쉬프트레지스트(603)를 디스에이블(disable) 하는 신호)등의 제어신호를 생성하여 수신 쉬프트레지스터(603)에 전 송할 수 있다.For example, a start signal (a signal enabling the reception shift resist 603) to start reception (receiving data from a peripheral device and outputting the data to a central processing unit) in the RxFSM, and a stop signal to end reception ( A control signal such as a signal for disabling the reception shift resist 603 may be generated and transmitted to the reception shift register 603.

이 때, RxFSM은 상술한 예의 제어신호를 카운터부(604)에 전송하여 카운터부(604)가 인에이블(enable) 또는 디스에이블(disable)되고, 그에 상응하여 카운터부(604)가 수신 쉬프트레지스터(603)를 인에이블(enable) 또는 디스에이블(disable)할 수 있다. RxFSM(606)은 데이터 수신과정 또는/및 수신의 시작, 종료등을 제어하기 위한 제어 신호를 생성하여 출력하는 제어신호 생성부의 일 예로서, 그 명칭에 관계없이 동일한 기능을 수행할 수 있는 모든 프로그램 모듈 또는 하드웨어 구성이 제한없이 모두 적용될 수 있음은 당업자에게 자명하다. 다만, 본 명세서에서는 제어 신호 생성부가 RxFSM인 경우를 가정하여 설명한다.At this time, the RxFSM transmits the above-described control signal to the counter unit 604 so that the counter unit 604 is enabled or disabled, and correspondingly, the counter unit 604 receives the reception shift register. 603 may be enabled or disabled. The RxFSM 606 is an example of a control signal generator that generates and outputs a control signal for controlling a data reception process and / or a start or end of a reception, and all programs capable of performing the same function regardless of its name. It will be apparent to those skilled in the art that any module or hardware configuration can be applied without limitation. However, in the present specification, it is assumed that the control signal generator is an RxFSM.

또한, 도 4를 참조하여 본발명의 바람직한 실시예에 따라 인터페이스 모듈이 중앙처리장치로부터 데이터를 입력받아 주변장치로 송신하는 과정에서 제어신호를 생성하는 TxFSM(410)과 도 6을 참조하여 본 발명의 바람직한 실시예에 따라 인터페이스 모듈이 주변장치로부터 데이터를 입력받아 중앙처리장치로 수신하는 과정에서 제어신호를 생성하는 RxFSM이 그 명칭에 관계없이 동일한 구성으로 구현될 수 있음은 당업자에게 자명하다. In addition, according to the preferred embodiment of the present invention with reference to Figure 4 TxFSM (410) generates a control signal in the process of receiving data from the central processing unit and transmits to the peripheral device according to the present invention with reference to FIG. In accordance with a preferred embodiment of the present invention, it is apparent to those skilled in the art that an RxFSM generating a control signal in the process of receiving data from a peripheral device and receiving the data from a peripheral device may be implemented in the same configuration regardless of its name.

수신 선입선출부(spiRxFIFO, 222)는 FIFO(First Input First output, 602)을 포함하고 있어, 수신 데이터레지스터(607)로부터 입력되는 데이터를 저장한 다음, 저장된 순서대로 다시 읽어 들여서 비트결합부(601)로 데이터를 출력할 수 있다. The reception first-in first-out unit spiRxFIFO 222 includes a first input first output (FIFO) 602, which stores data input from the reception data register 607, and then reads and rereads the data in the stored order. You can output data with).

보다 상세하게는, 주변장치로부터 데이터가 순간적으로 많은 양이 입력된다 하여도, FIFO(602)에서 저장한 다음, 저장된 순서대로 다시 읽어 들여 레지스터 부(200)로 전달할 수 있다. More specifically, even if a large amount of data is instantaneously input from the peripheral device, the data can be stored in the FIFO 602, read back in the stored order, and transferred to the register unit 200. FIG.

비트 결합부(601)는 수신 선입선출부(222)로부터 입력되는 m(임의의 자연수)비트의 데이터를 n(임의의 자연수)비트 데이터로 결합하여 중앙처리장치로 출력한다.The bit combiner 601 combines m (random natural number) bits of data input from the first-in first-out unit 222 into n (random natural numbers) bit data and outputs the data to the CPU.

이 때, m은 중앙처리장치의 연산비트 일 수 있으며, n은 SPI와 주변장치간의 데이터버스(data bus)폭에 상응하는 수일 수 있다. In this case, m may be an operation bit of the CPU, and n may be a number corresponding to the data bus width between the SPI and the peripheral device.

이에 대해서는 도 4를 참조하여 전달부(200)의 비트분배기(201)의 설명에서 설명한 것과 유사하므로 중복되는 설명은 생략한다. Since this is similar to that described in the description of the bit divider 201 of the transfer unit 200 with reference to FIG. 4, redundant description thereof will be omitted.

도 6을 참조하여 설명한 일례에서는 중앙처리장치의 연산비트는 32비트이며, 전달부(240)와 주변장치와의 데이터버스폭에 상응하는 수는 16으로 가정하여 설명하였다. In the example described with reference to FIG. 6, the operation bit of the central processing unit is 32 bits, and the number corresponding to the data bus width between the transfer unit 240 and the peripheral device is assumed to be 16.

그러나, m과 n은 반드시 상기에서 상술한 의미에 한정되지 아니하고, 본 발명을 구현하는 과정 및 인터페이스 모듈과 주변장치와의 환경에 따라 여러가지로 변경될 수 있음은 당업자에게 있어 자명하다. However, it is apparent to those skilled in the art that m and n are not necessarily limited to the above-described meanings and may be variously changed according to the process of implementing the present invention and the environment of the interface module and the peripheral device.

이상의 SPI의 슬레이브 모드에서 데이터를 수신하는 구성을 참조하여 데이터 수신방법에 대해 도 7를 참조하여 살펴보기로 한다. The data receiving method will be described with reference to FIG. 7 with reference to the configuration for receiving data in the slave mode of the SPI.

이하에서, 도 6의 실시예를 참조하여 설명한 것과 중복되는 되는 설명은 생략한다. Hereinafter, descriptions overlapping with those described with reference to the exemplary embodiment of FIG. 6 will be omitted.

또한, 도 6의 실시예에서 가정한 일례를 들어서 도 7를 참조하여 설명한다. 즉, 인터페이스 모듈은 SPI을 예로 들어서 설명하며, 카운터부(604)는 수신 쉬프트레지스터(603)에 16비트가 입력될 때마다 플래그 신호를 생성하는 경우를 가정하여 하기에서 설명한다. In addition, an example assumed in the embodiment of FIG. 6 will be described with reference to FIG. 7. In other words, the interface module will be described using SPI as an example, and the counter unit 604 will be described below on the assumption that a flag signal is generated every time 16 bits are input to the reception shift register 603.

도 7을 참조하면, 슬레이브 모드에서 전달부(240)의 SCK핀으로 주변장치로부터 주변클럭(도 6의 SCLK1참조)이 입력되면 수신 쉬프트레지스터(603)는 주변장치로부터 데이터를 입력받는다(단계 S705).Referring to FIG. 7, when a peripheral clock (see SCLK1 in FIG. 6) is input from the peripheral device to the SCK pin of the transmitter 240 in the slave mode, the reception shift register 603 receives data from the peripheral device (step S705). ).

이어서, 단계 S710에서 카운터부(604)는 주변장치로부터 수신 쉬프트레지스터에 입력된 데이터가 16비트일 때마다 플래그 신호를 생성한다. Subsequently, in step S710, the counter unit 604 generates a flag signal whenever data input to the reception shift register from the peripheral device is 16 bits.

이때, 카운터부(604)에서 플래그신호를 생성하는 조건인 수신 쉬프트레지스터에 입력된 데이터의 비트수는 본 발명이 인터페이스 모듈에 구현되는 과정 또는 인터페이스 모듈과 주변장치와의 환경에 따라 변경될 수 있음은 도 6을 참조하여 설명하였다. In this case, the number of bits of data input to the reception shift register, which is a condition for generating a flag signal in the counter unit 604, may be changed according to the process of implementing the present invention or the environment of the interface module and the peripheral device. Has been described with reference to FIG. 6.

이어서 단계 S715에서 플래그 신호는 동기부(605)에서 내부클럭으로 동기화된다. 본 발명의 바람직한 실시예에 따르면, 카운터부(604)는 주변클럭으로 동작하므로, 카운터부(604)에서 생성되는 플래그신호는 주변클럭으롤 연동되어 있으므로, 내부클럭으로 동작하는 동기부(605)에 보다 정확하게 전송하기 위해서 동기부(605)에서 내부 클럭으로 동기화된다. In step S715, the flag signal is synchronized from the synchronizer 605 to the internal clock. According to a preferred embodiment of the present invention, since the counter unit 604 operates as a peripheral clock, the flag signal generated by the counter unit 604 is interlocked with the peripheral clock, so that the synchronization unit 605 operating as an internal clock is provided. In order to transmit more accurately, the synchronization unit 605 synchronizes with the internal clock.

이어서, 단계 S720에서 플래그 신호가 동기부(605)로부터 RxFSM(606)에 전송된다. Next, in step S720, a flag signal is transmitted from the synchronizer 605 to the RxFSM 606.

이 때, RxFSM(606)은 동기부(605)로부터 입력되는 플래그 신호를 이용하여 SPI가 주변장치로부터 데이터를 정상적으로 수신하는 지여부를 모니터링할 수 있음을 도 6을 참조하여 설명하였다.In this case, the RxFSM 606 has been described with reference to FIG. 6 that the SPI can monitor whether the SPI normally receives data from the peripheral device using the flag signal input from the synchronizer 605.

또한, RxFSM(606)이 동기부(605)로부터 입력되는 플래그 신호를 이용하여 수신 데이터레지스터(607)에 보다 정확한 제어신호를 보낼 수 있음도 도 6을 참조하여 설명하였다. 6, the RxFSM 606 can send a more accurate control signal to the reception data register 607 using the flag signal input from the synchronization unit 605. FIG.

단계 S725에서 상술한 RxFSM(616)로부터 제어신호에 상응하여 수신 쉬프트레지스터(603)에서 입력되는 데이터는 수신 데이터레지스터(607)에 입력되고, 이후 수신선입선출부(spiRxFIFO, 222)에 저장되었다가, 다시 읽어들여져 비트결합부(601)에서 n(임의의 자연수)비트로 결합되어 중앙처리 장치로 전송된다. (도 7에는 미도시)In response to the control signal from the RxFSM 616 described above in step S725, the data input from the reception shift register 603 is input to the reception data register 607 and then stored in the first-in first-out section spiRxFIFO 222. The data is read back and combined by the bit combiner 601 into n (random natural numbers) bits and transmitted to the CPU. (Not shown in Figure 7)

도 6 및 도 7를 참조하여 설명한 바와 같이, 본 발명의 바람직한 일 실시예에 따르면, 슬레이브 모드에서 SPI가 주변장치로부터 데이터를 수신하는 과정에서, 수신제어부(221)와 전달부(240)가 상호간에 송수신되는 제어신호를 각각의 동작의 클럭에 따라 동기화하여 송수신하여, 수신되는 데이터의 안정화를 도모하는 것을 설명하였다. As described with reference to FIGS. 6 and 7, according to an exemplary embodiment of the present invention, in the process of receiving data from the peripheral device by the SPI in the slave mode, the reception controller 221 and the transmitter 240 mutually interact with each other. It has been described that the control signals transmitted and received are synchronized with each other according to the clock of each operation, and thus, the data received is stabilized.

상기에서 도 6 및 도 7를 참조하여 설명한 본 발명의 바람직한 일실시예에서 카운터부(604)는 4비트 카운터를, 동기부(605)는 디-플립플롭(D-flipflop)을 예시로 사용하였으나, 이에 한정되지 아니함은 당업자에게 있어 자명할 것이다. 6 and 7, the counter unit 604 uses a 4-bit counter and the synchronizer 605 uses a D-flipflop as an example. It should be apparent to those skilled in the art that the present invention is not limited thereto.

상기한 본 발명의 바람직한 실시예는 예시의 목적을 위해 개시된 것이고, 본 발명에 대해 통상의 지식을 가진 당업자라면 본 발명의 사상과 범위 안에서 다양한 수정, 변경, 부가가 가능할 것이며, 이러한 수정, 변경 및 부가는 하기의 특허청구범위에 속하는 것으로 보아야 할 것이다.Preferred embodiments of the present invention described above are disclosed for purposes of illustration, and those skilled in the art will be able to make various modifications, changes, and additions within the spirit and scope of the present invention. Additions should be considered to be within the scope of the following claims.

이상에서 설명한 바와 같이, 본 발명에 의한 인터페이스 모듈은 슬레이브 모드(Slave mode)에서 중앙처리장치와 주변장치간에 데이터를 송수신하는 과정에서, 인터페이스 모듈의 구성요소간에 송수신되어지는 제어신호를 각각의 동작 클럭에 따라 동기화되어 송수신되어짐으로서 보다 정확한 제어신호가 송수신되어지는 장점이 있다. As described above, the interface module according to the present invention, in the slave mode (Slave mode) in the process of transmitting and receiving data between the central processing unit and the peripheral device, the control signal transmitted and received between the components of the interface module, each operation clock According to the synchronization is transmitted and received, there is an advantage that a more accurate control signal is transmitted and received.

또한, 본 발명에 의한 인터페이스 모듈은 슬레이브 모드에서 데이터를 교환하는 과정에서 데이터의 안정화를 도모하는 장점이 있다. In addition, the interface module according to the present invention has an advantage of stabilizing data in the process of exchanging data in the slave mode.

Claims (28)

슬레이브 모드(Slave mode)에서 중앙처리장치로부터 주변장치로 데이터를 송신하는 인터페이스 모듈에 있어서,An interface module for transmitting data from a central processing unit to a peripheral device in a slave mode, 제1 클럭에 상응하여 동작하고, 상기 중앙처리장치로부터 입력되는 데이터를 출력하는 송신제어부; 및A transmission control unit operating in correspondence with a first clock and outputting data input from the central processing unit; And 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하고, 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 전달부를 포함하되,A transmission unit operating in correspondence with a second clock input from the peripheral device and sequentially outputting data input from the transmission control unit to the peripheral device; 상기 송신제어부 및 상기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 따라 변환하기 위한 동기부를 포함하는 것을 특징으로 하는 인터페이스 모듈The transmission control unit and the transfer unit interface module comprising a synchronization unit for converting control signals transmitted and received between each other according to the operation clock 제1항에 있어서,The method of claim 1, 상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 클럭 분주기를 더 포함하는 것을 특징으로 하는 인터페이스 모듈Interface module further comprises a clock divider for generating the first clock using the system clock input from the central processing unit 제 1항에 있어서, The method of claim 1, 상기 중앙처리장치로부터 입력되는 m(임의의 자연수)비트 데이터를 n(임의의 자연수)비트데이터로 변환하여 상기 송신제어부로 출력하는 레지스터부를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.And a register unit converting the m (arbitrary natural number) bit data input from the central processing unit into n (arbitrary natural number) bit data and outputting the bit data to the transmission control unit. 제 3항에 있어서,The method of claim 3, wherein 상기 레지스터부로부터 입력되는 n 비트 데이터를 저장한 후, 저장된 순서대로 상기 송신제어부로 출력하는 송신 선입선출부를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.And a transmission first-in, first-out unit for storing the n-bit data input from the register unit and outputting the n-bit data to the transmission control unit in the stored order. 제 3항에 있어서,The method of claim 3, wherein 상기 m은 상기 중앙처리장치의 연산비트에 상응하는 수 이며,M is a number corresponding to the operation bit of the CPU, 상기 n은 상기 인터페이스모듈과 상기 주변장치간의 데이터버스(data bus)폭에 상응하는 수인 것을 특징으로 하는 인터페이스 모듈.N is a number corresponding to a data bus width between the interface module and the peripheral device. 제 1항에 있어서,The method of claim 1, 상기 전달부는, The delivery unit, 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력 하는 멀티플렉서(multiplexer);A multiplexer sequentially outputting data input from the transmission control unit to the peripheral device; 상기 멀티플렉서를 인에이블(enable)하기 위한 멀티플렉서 인에이블 신호를 생성하는 카운터부; 및A counter unit for generating a multiplexer enable signal for enabling the multiplexer; And 상기 송신제어부에 포함된 제어신호 생성부로부터 입력되는 제어신호를 상기 제2 클럭에 동기화(synchronize)하여 상기 카운터부에 전송하는 동기부를 포함하되,A synchronization unit for synchronizing a control signal input from a control signal generation unit included in the transmission control unit with the second clock and transmitting the control signal to the counter unit, 상기 카운터부는 상기 멀티플렉서 인에이블 신호의 생성횟수에 상응하여 플래그신호를 생성하여 상기 제어신호 생성부로 제공하는 것을 특징으로 하는 인터페이스 모듈.And the counter unit generates a flag signal corresponding to the number of generations of the multiplexer enable signal and provides the flag signal to the control signal generator. 제 6항에 있어서,The method of claim 6, 상기 송신 제어부는 상기 제2 클럭에 따른 상기 플래그신호를 상기 제1 클럭에 상응하도록 변환하여 상기 제어신호 생성부로 제공하는 동기부를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.The transmission control unit further comprises a synchronization unit converting the flag signal according to the second clock to correspond to the first clock and providing the control signal to the control signal generator. 슬레이브 모드(Slave mode)에서 주변장치로부터 중앙처리장치로 데이터를 수신하는 인터페이스 모듈에 있어서, An interface module for receiving data from a peripheral device to a central processing unit in a slave mode, 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하고, 상기 주변 장 치로부터 순차적으로 입력된 데이터를 출력하는 전달부; 및A transfer unit operating in correspondence with a second clock input from the peripheral device, and outputting data sequentially input from the peripheral device; And 제1 클럭에 상응하여 동작하고, 상기 전달부로부터 입력되는 데이터를 중앙처리장치로 출력하는 수신제어부를 포함하되,A reception control unit which operates in response to a first clock and outputs data input from the transfer unit to a central processing unit; 상기 수신제어부 및 상기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 따라 변환하기 위한 동기부를 포함하는 것을 특징으로 하는 인터페이스 모듈.And the reception control unit and the transfer unit include a synchronization unit for converting control signals transmitted and received to each other according to operation clocks. 제 8항에 있어서,The method of claim 8, 상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 클럭 분주기를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.And a clock divider configured to generate the first clock using a system clock input from the CPU. 제 8항에 있어서,The method of claim 8, 상기 수신제어부로부터 입력되는 데이터를 저장한 후, 저장된 순서대로 상기 중앙처리장치로 출력하는 수신 선입선출부를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.And receiving first-in, first-out unit for storing the data inputted from the reception control unit and outputting the data to the central processing unit in the stored order. 제 10항에 있어서,The method of claim 10, 상기 수신선입선출부로부터 입력되는 n(임의의 자연수)비트 데이터를 m(임의의 자연수)비트 데이터로 변환하여 상기 중앙처리장치로 출력하는 레지스터부를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.And a register unit for converting the n (arbitrary natural number) bit data inputted from the receiving first-in first-out unit into m (arbitrary natural number) bit data and outputting the m-bit arbitrary data. 제 11항에 있어서,The method of claim 11, 상기 n은 상기 인터페이스 모듈과 상기 주변장치간의 데이터버스폭에 상응하는 수이며,N is a number corresponding to a data bus width between the interface module and the peripheral device, 상기 m은 중앙처리장치의 연산비트에 상응하는 수인 것을 특징으로 하는 인터페이스 모듈.M is the number corresponding to the operation bit of the central processing unit. 제 8항에 있어서, The method of claim 8, 상기 전달부는,The delivery unit, 상기 주변장치로부터 데이터를 순차적으로 입력받아 출력하는 수신 쉬프트레지스터; 및A reception shift register sequentially receiving data from the peripheral device and outputting the data; And 상기 수신 쉬프트레지스터에 수신되는 비트 수에 상응하여 플래그 신호를 생성하여 상기 수신제어부에 포함된 제어신호 생성부로 제공하는 카운터부를 포함하는 것을 특징으로 하는 인터페이스 모듈.And a counter unit generating a flag signal corresponding to the number of bits received by the reception shift register and providing the flag signal to a control signal generator included in the reception control unit. 제 13항에 있어서,The method of claim 13, 상기 수신제어부는 상기 제2 클럭에 따른 상기 플래그신호를 상기 제1 클럭에 상응하도록 변환하여 상기 제어신호 생성부로 제공하는 동기부를 더 포함하는 것을 특징으로 하는 인터페이스 모듈.The reception control unit further comprises a synchronization unit for converting the flag signal according to the second clock corresponding to the first clock to provide to the control signal generator. 슬레이브 모드(Slave mode)에서 중앙처리장치로부터 주변장치로 데이터를 송신하는 인터페이스 방법에 있어서,An interface method for transmitting data from a CPU to a peripheral device in a slave mode, (a) 제1 클럭에 상응하여 동작하는 송신제어부가 상기 중앙처리장치로부터 입력되는 데이터를 출력하는 단계;(a) outputting data input from the central processing unit by a transmission controller operating in response to a first clock; (b) 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하는 전달부가 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 단계를 포함하되,(b) a step of sequentially transmitting data input from the transmission control unit to the peripheral device, the transfer unit operating in correspondence with the second clock input from the peripheral device, 상기 송신제어부 및 상기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 상응하여 변환하는 것을 특징으로 하는 인터페이스 방법.And the transmission control unit and the transfer unit convert control signals transmitted and received to each other according to each operation clock. 제 15항에 있어서,The method of claim 15, (c) 클럭분주기가 상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하 여 상기 제1 클럭을 생성하는 단계가 (c) generating a first clock using a system clock inputted from the CPU by a clock divider; 상기 (a)단계 이전에 더 수행되는 것을 특징으로 하는 인터페이스 방법.Interface method characterized in that it is further performed before step (a). 제 15항에 있어서,The method of claim 15, (d) 레지스터부가 상기 중앙처리장치로부터 입력되는 m(임의의 자연수)비트 데이터를 n(임의의 자연수)비트데이터로 변환하여 송신제어부로 출력하는 단계가(d) converting the m (arbitrary natural number) bit data inputted from the central processing unit into n (arbitrary natural number) bit data inputted from the CPU, and outputting the bit to the transmission control unit 상기 (a)단계 이전에 더 수행되는 것을 특징으로 하는 인터페이스 방법.Interface method characterized in that it is further performed before step (a). 제 17항에 있어서,The method of claim 17, 상기 m은 상기 중앙처리장치의 연산비트에 상응하는 수이며,M is a number corresponding to the operation bit of the CPU, 상기 n은 상기 상기 주변장치로의 데이터버스(data bus)폭에 상응하는 수인 것을 특징으로 하는 인터페이스 방법.And n is a number corresponding to a data bus width to the peripheral device. 제 17항에 있어서,The method of claim 17, (e) 송신 선입선출부가 상기 레지스터부로부터 입력되는 n 비트 데이터를 저장한 후, 저장된 순서대로 상기 송신제어부로 출력하는 단계가 상기 (d)단계 와 상기 (a)단계 사이에 더 수행되는 것을 특징으로 하는 인터페이스 방법.(e) transmitting first-in first-out unit to store the n-bit data input from the register unit, and then outputting to the transmission control unit in the stored order is further performed between step (d) and step (a). Interface method. 제 15항에 있어서,The method of claim 15, 상기 (b) 단계는,In step (b), (f) 멀티플렉서(multiplexer)가 상기 송신제어부로부터 입력되는 데이터를 상기 주변장치로 순차적으로 출력하는 단계;(f) a multiplexer sequentially outputting data input from the transmission control unit to the peripheral device; (g) 카운터부가 상기 멀티플렉서를 인에이블하기 위한 멀티플렉서 인에이블 신호를 생성하는 단계; 및(g) generating, by a counter unit, a multiplexer enable signal for enabling the multiplexer; And (h) 제1 동기부가 상기 송신제어부에 포함된 제어신호 생성부로부터 입력되는 제어신호를 상기 제2 클럭에 동기화(synchronize)하여 상기 카운터부로 제공하는 단계를 포함하되;(h) synchronizing a control signal input from a control signal generation unit included in the transmission control unit with the second clock to the counter unit by a first synchronization unit; 상기 카운터부는 상기 멀티플렉서 인에이블 신호의 생성횟수에 상응하여 플래그 신호를 생성하여 상기 제어신호 생성부로 제공하는 것을 특징으로 하는 인터페이스 방법.And the counter unit generates a flag signal corresponding to the number of generations of the multiplexer enable signal and provides the flag signal to the control signal generator. 제 20항에 있어서,The method of claim 20, (i) 상기 송신 제어부에 포함된 제2 동기부가 상기 제 2클럭에 따른 상기 플래그신호를 상기 제1 클럭에 상응하도록 변환하여 상기 제어신호 생성부로 입력하는 단계가 상기 (h)단계 이후에 더 수행되는 것을 특징으로 하는 인터페이스 방법.(i) converting the flag signal according to the second clock into the second signal included in the transmission controller so as to correspond to the first clock, and inputting the flag signal to the control signal generator further after step (h); Interface method characterized in that. 슬레이브 모드(Slave mode)에서 주변장치로부터 중앙처리장치로 데이터를 수신하는 인터페이스 방법에 있어서,An interface method for receiving data from a peripheral device to a CPU in a slave mode, (a) 상기 주변장치로부터 입력되는 제2 클럭에 상응하여 동작하는 전달부가 상기 주변장치로부터 순차적으로 입력되는 데이터를 출력하는 단계; 및(a) outputting data sequentially input from the peripheral device by a transfer unit operating in response to a second clock input from the peripheral device; And (b) 제1 클럭에 상응하여 동작하는 수신제어부가 상기 전달부로부터 입력되는 데이터를 상기 중앙처리장치로 출력하는 단계를 포함하되,(b) outputting data input from the transmission unit to the central processing unit by a reception controller operating in response to a first clock, 상기 수신제어부 및 상기 전달부는 상호간에 송수신되는 제어신호를 각각의 동작 클럭에 상응하여 변환하는 것을 특징으로 하는 인터페이스 방법.And the reception control unit and the transfer unit convert control signals transmitted and received to each other in correspondence with respective operation clocks. 제 22항에 있어서,The method of claim 22, (c) 클럭분주기가 상기 중앙처리장치로부터 입력되는 시스템 클럭을 이용하여 상기 제1 클럭을 생성하는 단계가(c) generating a first clock using a system clock inputted from the CPU by a clock divider; 상기 (a)단계 이전에 수행되는 것을 특징으로 하는 인터페이스 방법.Interface method characterized in that performed before step (a). 제 22항에 있어서,The method of claim 22, (d) 수신 선입선출부가 상기 수신제어부로부터 입력되는 데이터를 저장한 후, 저장된 순서대로 상기 중창처리장치로 출력하는 단계가 (b)단계 이후에 더 수행되는 것을 특징으로 하는 인터페이스 방법.and (d) storing the data input from the reception control unit by the first-in first-out unit and outputting the data to the midsole processing apparatus in the stored order after step (b). 제 24항에 있어서,The method of claim 24, (e) 레지스터부가 상기 수신 선입선출부로부터 입력되는 n(임의의 자연수)비트 데이터를 m(임의의 자연수)비트 데이터로 변환하여 상기 중앙처리장치로 출력하는 단계가 상기 (d)단계 이후에 더 수행되는 것을 특징으로 하는 인터페이스 방법.(e) converting the n (arbitrary natural number) bit data inputted from the receiving first-in first-out unit into m (arbitrary natural number) bit data and outputting the m-bit arbitrary data to the CPU, after step (d). Interface method, characterized in that performed. 제 25항에 있어서,The method of claim 25, 상기 n은 상기 주변장치로의 데이터버스폭에 상응하는 수이며,N is a number corresponding to the data bus width to the peripheral device, 상기 m은 상기 중앙처리장치의 연산비트에 상응하는 수인 것을 특징을 하는 인터페이스 방법.M is a number corresponding to the operation bits of the CPU. 제 22항에 있어서,The method of claim 22, 상기 (a)단계는,In step (a), (f) 수신 쉬프트레지스터가 상기 주변장치로부터 데이터를 순차적으로 입력받아 출력하는 단계; 및(f) receiving and outputting data sequentially from the peripheral device by a reception shift register; And (g) 카운터부가 상기 수신 쉬프트레지스터에 수신되는 비트 수에 상응하여 플래그 신호를 생성하여 상기 수신제어부에 포함된 제어신호 생성부로 전송하는 단계를 포함하는 것을 특징으로 하는 인터페이스 방법.(g) a counter unit generating a flag signal corresponding to the number of bits received by the reception shift register and transmitting the flag signal to a control signal generation unit included in the reception control unit. 제 27항에 있어서,The method of claim 27, (h) 상기 수신제어부에 포함된 동기부가 상기 제2 클럭에 따른 상기 플래그신호를 상기 제1클럭에 상응하여 변환하여 상기 제어신호 생성부로 입력하는 단계가 상기 (g)단계 이후에 더 수행되는 것을 특징으로 하는 인터페이스 방법. (h) the synchronizing unit included in the reception control unit converting the flag signal according to the second clock corresponding to the first clock and inputting the flag signal to the control signal generator is further performed after step (g). Characterized by the interface method.
KR1020060075219A 2006-08-09 2006-08-09 Interface module and method for data communication by synchronizing clock KR20080013548A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020060075219A KR20080013548A (en) 2006-08-09 2006-08-09 Interface module and method for data communication by synchronizing clock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020060075219A KR20080013548A (en) 2006-08-09 2006-08-09 Interface module and method for data communication by synchronizing clock

Publications (1)

Publication Number Publication Date
KR20080013548A true KR20080013548A (en) 2008-02-13

Family

ID=39341294

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020060075219A KR20080013548A (en) 2006-08-09 2006-08-09 Interface module and method for data communication by synchronizing clock

Country Status (1)

Country Link
KR (1) KR20080013548A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101248034B1 (en) * 2010-11-02 2013-03-27 한국표준과학연구원 Synchronized multichannel SPI communication system for vibration sensors and its implementation method
KR20150039142A (en) * 2015-02-16 2015-04-09 주식회사 이노와이어리스 Serial peripheral interface with control logic for system performance improvement, and method therefor
US11295828B2 (en) 2019-03-08 2022-04-05 Analog Devices International Unlimited Company Multi-chip programming for phased array

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101248034B1 (en) * 2010-11-02 2013-03-27 한국표준과학연구원 Synchronized multichannel SPI communication system for vibration sensors and its implementation method
KR20150039142A (en) * 2015-02-16 2015-04-09 주식회사 이노와이어리스 Serial peripheral interface with control logic for system performance improvement, and method therefor
US11295828B2 (en) 2019-03-08 2022-04-05 Analog Devices International Unlimited Company Multi-chip programming for phased array

Similar Documents

Publication Publication Date Title
JP5459807B2 (en) Debug signaling in multiprocessor data processing systems
US8301932B2 (en) Synchronising between clock domains
EP0547768A2 (en) Synchronizer apparatus and method
US8520464B2 (en) Interface circuit and semiconductor device incorporating same
JP5096024B2 (en) USB controller and USB controller test method
US7590146B2 (en) Information processing unit
EP1575206B1 (en) Data synchronization arrangement
KR20080013548A (en) Interface module and method for data communication by synchronizing clock
KR100817270B1 (en) Interface device and method for synchronizing data
GB2521035A (en) A synchronous bridge circuitry and a method of transferring data using asynchronous bridge circuitry
KR100580179B1 (en) Method and integrated circuit apparatus for reducing simultaneously changing output
US20060156061A1 (en) Fault-tolerant computer and method of controlling same
JP4906688B2 (en) Control signal communication method and optical transceiver device
WO2009069094A1 (en) Method and device for routing data between components
US20080168200A1 (en) Method of compensating for propagation delay of tri-state bidirectional bus in a semiconductor device
CN101324873B (en) Compatible type non-standard bit wide serial perimeter interface and data transmission method among interfaces
KR100440571B1 (en) A system for clock synchronization between switch boards with redundancy and line boards
JP7186741B2 (en) data sending device
JP7149974B2 (en) Master device, slave device and serial transmission system
KR20110005264A (en) Testing device, transmission circuit, testing device control method and transmission circuit control method
CN108932210B (en) Data transmission device and data receiving device of serial peripheral interface
US7861018B2 (en) System for transmitting data between transmitter and receiver modules on a channel provided with a flow control link
KR950004509B1 (en) Bus connecting circuit in long distance interface units
JP3893873B2 (en) Duplex processor entanglement system
JPH04360430A (en) Multiplex data phase control circuit

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E601 Decision to refuse application