KR101506279B1 - Universal spi core using fpga - Google Patents

Universal spi core using fpga Download PDF

Info

Publication number
KR101506279B1
KR101506279B1 KR1020130136898A KR20130136898A KR101506279B1 KR 101506279 B1 KR101506279 B1 KR 101506279B1 KR 1020130136898 A KR1020130136898 A KR 1020130136898A KR 20130136898 A KR20130136898 A KR 20130136898A KR 101506279 B1 KR101506279 B1 KR 101506279B1
Authority
KR
South Korea
Prior art keywords
spi
signal
core
clock
data
Prior art date
Application number
KR1020130136898A
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 KR1020130136898A priority Critical patent/KR101506279B1/en
Application granted granted Critical
Publication of KR101506279B1 publication Critical patent/KR101506279B1/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/06Clock generators producing several clock signals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4208Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being a system bus, e.g. VME bus, Futurebus, Multibus
    • G06F13/4213Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being a system bus, e.g. VME bus, Futurebus, Multibus with asynchronous protocol

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

Disclosed is a general-purpose SPI core using FPGA. According to the present invention, an SPI core, embedded in a device performing SPI communications, includes: a sync clock generating part generating a sync clock for synchronization in response to a clock polarity setting signal applied by a device when SPI communications is performed between the device and at least one other device performing the SPI communications; a counter generating count values determining a sampling timing of data and the number of bits of the data transceived through the SPI communications; and a SPI logic part receiving and then storing a control signal, including the clock polarity setting signal and a phase setting signal, from the device, and transceiving the data through the SPI communications between the device and at least one other device according to the stored phase setting signal and the counter values generated in the counter.

Description

FPGA를 이용한 범용 SPI 코어 {UNIVERSAL SPI CORE USING FPGA}A universal SPI core using an FPGA {UNIVERSAL SPI CORE USING FPGA}

본 발명은 범용 SPI 코어에 관한 것으로, 특히 FPGA를 이용하여 구현 가능한 범용 SPI 코어 에 관한 것이다.The present invention relates to a general-purpose SPI core, and more particularly to a general-purpose SPI core that can be implemented using an FPGA.

SPI(Serial to Peripheral Interface)는 아키텍처 전이중 통신 모드로 동작하는 동기화 직렬 데이터 연결 표준으로서, 직렬 주변기기 인터페이스다. SPI는 CPU와 다수의 CPU들 또는 CPU와 다수의 주변장치들 사이에 고속으로 데이터를 동기 전송하는데 사용되는 직렬 통신 방법 중에 하나이다. SPI 통신을 사용하고자 장치들은 SPI 통신을 지원하기 위한 SPI 코어(SPI Core)를 내장하여 마스터와 슬레이브 중 하나로 동작하며, 마스터는 여러 슬레이브 장치들과 개별 칩 선택(Chip Select) 라인을 이용하여 SPI 통신을 수행할 수 있다. 즉 하나의 마스터(Master)에 여러 개의 슬레이브(Slave)가 연결될 수 있고, 마스터는 여러 개의 슬레이브 중 하나를 칩 선택 라인을 이용하여 선택하는 형식으로 통신이 이루어진다.The Serial to Peripheral Interface (SPI) is a synchronous serial data connection standard that operates in architecture full duplex communication mode, and is a serial peripheral interface. SPI is one of the serial communication methods used to transfer data at high speed between CPU and multiple CPUs or between CPU and many peripheral devices. In order to use SPI communication, devices operate as one of master and slave with built-in SPI core (SPI Core) to support SPI communication. Master uses SPI communication with several slave devices and individual chip select lines Can be performed. That is, a plurality of slaves can be connected to one master, and the master performs communication in a form of selecting one of a plurality of slaves using a chip select line.

SPI는 4-와이어 직렬 통신 인터페이스로서 4개의 신호 라인을 통해 통신을 수행하며, 4개의 신호 라인에 대응하는 4개의 논리 신호를 지정하고 있다. 4개의 논리 신호는 SCLK(Serial Clock 또는 CLK), MOSI(Mater Output Slave Input 또는 SDI, DI, DIN, SI), MISO(Mater Input Slave Output 또는 SDO, DO, DOUT, SO), CS(Chip Select 또는 SS, CSB, CSN, STE)이다.The SPI is a four-wire serial communication interface that communicates over four signal lines and specifies four logic signals corresponding to four signal lines. The four logic signals are SCLK (Serial Clock or CLK), MOSI (Mater Output Slave Input or SDI, DI, DIN, SI), MISO (Maternal Input Slave Output or SDO, DO, DOUT, SO) SS, CSB, CSN, STE).

SCLK는 마스터와 슬레이브 사이의 동기를 위한 클럭 신호로서, 마스터에서 생성되어 슬레이브로 전송된다. MOSI와 MISO는 데이터 송수신을 위한 신호로서, MOSI는 마스터에서 출력되어 슬레이브로 입력되는 신호이다. MISO는 MOSI와 반대로 슬레이브에서 출력되어 마스터로 입력되는 신호이다. 그리고 CS는 상기한 바와 같이 슬레이브 선택 신호로서 슬레이브 선택 신호이다.SCLK is a clock signal for synchronization between the master and the slave, generated by the master and transmitted to the slave. MOSI and MISO are signals for data transmission and reception, and MOSI is a signal output from a master and input to a slave. MISO is a signal that is output from the slave and input to the master as opposed to MOSI. And CS is a slave selection signal as a slave selection signal as described above.

도1 은 SPI 통신의 클럭 극성 설정 신호와 위상 설정 신호의 개념을 나타내는 도면이다.1 is a diagram showing the concept of a clock polarity setting signal and a phase setting signal of SPI communication.

SPI 코어에 구비된 SPI 제어 레지스터는 클럭 극성 설정 신호(CPOL)와 위상 설정 신호(CPHA)를 설정하도록 되어 있다. 여기서 클럭 극성 설정 신호(CPOL)는 클럭의 극성을 지정하는 값이고, 위상 설정 신호(CPHA)는 클럭 위상을 지정하는 값으로, 도1 에 도시된 바와 같이, CPOL = 1 이면 동기 클럭 신호(SCK)을 시작할 때, HIGH에서 시작되고, CPOL = 0이면 동기 클럭(SCK)이 LOW에서 시작된다. 즉, 동기 클럭 신호(SCK)의 시작을 선택하는 비트가 클럭 극성 설정 신호(CPOL) 이다.The SPI control register included in the SPI core is configured to set the clock polarity setting signal CPOL and the phase setting signal CPHA. In this case, the clock polarity setting signal CPOL is a value for designating the polarity of the clock, and the phase setting signal CPHA is a value for specifying the clock phase. If CPOL = 1, ), It starts at HIGH. When CPOL = 0, the synchronous clock (SCK) starts at LOW. That is, the bit for selecting the start of the synchronous clock signal SCK is the clock polarity setting signal CPOL.

그리고 위상 설정 신호(CPHA)는 하강 에지(Falling Edge), 상승 에지(Rising Edge)를 선택하는 것으로, 예를 들면, 도1 에 도시된 바와 같이, 위상 설정 신호(CPHA)가 1이고, 클럭 극성 설정 신호(CPOL)이 1이면 상승 에지에서 데이터 래치(Data Latch)가 일어나고, 위상 설정 신호(CPHA)가 1이고, 클럭 극성 설정 신호(CPOL)가 0이면 하강 에지에서 데이터 래치가 일어나며, 위상 설정 신호(CPHA)가 0이고, 클럭 극성 설정 신호(CPOL)이 1이면 하강 에지에서, 위상 설정 신호(CPHA)가 0이고 클럭 극성 설정 신호(CPOL)가 0이면 상승 에지에서 데이터 래치가 일어난다. For example, as shown in FIG. 1, when the phase setting signal CPHA is 1 and the clock polarity is 1, When the set signal CPOL is 1, a data latch occurs at the rising edge. When the phase setting signal CPHA is 1 and the clock polarity setting signal CPOL is 0, data latch occurs at the falling edge, If the signal CPHA is 0 and the clock polarity setting signal CPOL is 1 on the falling edge, if the phase setting signal CPHA is 0 and the clock polarity setting signal CPOL is 0, the data latch occurs at the rising edge.

그러나 기존의 SPI 코어는 제어 레지스터의 클럭 극성 설정 신호(CPOL)와 위상 설정 신호(CPHA)의 값이 하나의 값으로 미리 지정되어 설계되었다. 따라서 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값이 서로 다르게 설정된 장치들 사이의 SPI 통신을 수행할 수 없으므로, 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값이 동일한 SPI 코어를 재설계해야 하는 문제가 있다. 즉 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값이 매치되지 않는 장치들 사이에 SPI 통신을 지원하기 위해서는 항상 SPI 코어를 수정하는 번거로움이 있다.However, in the conventional SPI core, the value of the clock polarity setting signal (CPOL) and the phase setting signal (CPHA) of the control register are designed in advance as one value. Therefore, since the SPI communication between the devices having different values of the clock polarity setting signal CPOL and the phase setting signal CPHA can not be performed, the values of the clock polarity setting signal CPOL and the phase setting signal CPHA are There is a problem that the same SPI core needs to be redesigned. In other words, it is troublesome to always modify the SPI core to support SPI communication between devices in which the values of the clock polarity setting signal (CPOL) and the phase setting signal (CPHA) do not match.

본 발명의 목적은 다양한 SPI 장치의 사용 조건에 대응하여 설정값의 변경이 가능하도록 FPGA로 구현되는 SPI 코어를 제공하는데 있다.It is an object of the present invention to provide an SPI core implemented in an FPGA so that a setting value can be changed corresponding to use conditions of various SPI devices.

상기 목적을 달성하기 위한 본 발명의 일 예에 따른 FPGA를 이용한 범용 SPI 코어는 SPI 통신을 수행하고자 하는 장치에 내장되는 SPI 코어에 있어서, 상기 장치와 SPI 통신을 수행하는 적어도 하나의 다른 장치 사이에 상기 SPI 통신 시에 동기화를 위한 동기 클럭을 상기 장치로부터 인가되는 클럭 극성 설정 신호에 응답하여 생성하는 동기 클럭 발생부; 상기 SPI 통신으로 송수신하는 데이터의 비트 수와 데이터의 샘플링 타이밍을 결정하는 카운트값들을 생성하는 카운터; 상기 장치로부터 클럭 극성 설정 신호와 위상 설정 신호를 포함하는 컨트롤 신호를 수신하여 저장하고, 저장된 상기 위상 설정 신호 및 상기 카운터에서 생성된 상기 카운터값들에 따라 상기 장치와 상기 적어도 하나의 다른 장치 사이에 SPI 통신으로 데이터를 송수신하는 SPI 로직부; 를 포함한다.According to an aspect of the present invention, there is provided a general-purpose SPI core using an FPGA, the SPI core including an SPI core embedded in a device for performing SPI communication, the SPI core including at least one SPI core A synchronous clock generator for generating a synchronous clock for synchronization in the SPI communication in response to a clock polarity setting signal applied from the apparatus; A counter for generating count values for determining the number of bits of data to be transmitted and received in the SPI communication and sampling timing of data; Receiving and storing a control signal including a clock polarity setting signal and a phase setting signal from the apparatus and storing a control signal including a clock polarity setting signal and a phase setting signal between the apparatus and the at least one other apparatus in accordance with the stored phase setting signal and the counter values generated in the counter An SPI logic unit for transmitting and receiving data through SPI communication; .

상기 클럭 발생부는 상기 클럭 극성 설정 신호에 따라 상기 동기 클럭의 초기 레벨을 결정하고, 상기 장치에서 인가되는 카운터 및 클럭 실행 신호에 응답하여 상기 동기 클럭을 토글하여 상기 다른 장치로 출력하는 것을 특징으로 한다.The clock generating unit determines an initial level of the synchronous clock according to the clock polarity setting signal and toggles the synchronous clock in response to a counter and a clock execution signal applied from the apparatus to output the synchronized clock to the other apparatus .

상기 카운터는 상기 SPI 코어가 초기 구동되거나, 상기 SPI 코어로 상기 장치로부터 리셋 신호가 인가되면, 상기 카운트 값들 중 리셋 카운트 값을 카운트하여 출력하는 것을 특징으로 한다.Wherein the counter counts a reset count value among the count values when the SPI core is initially driven or a reset signal is applied to the SPI core from the device.

상기 카운터는 상기 리셋 카운트 값이 기설정된 안정화 시간에 도달한 이후 인가되는 상기 카운터 및 클럭 실행 신호에 응답하여 활성화되어 상기 카운트 값들 중 상기 SPI 로직부에서 데이터 전송과 샘플링 타이밍을 결정하기 위해 사용되는 비트 카운트 값을 카운트하여 출력하고, 상기 장치에서 인가되는 카운터 초기화 신호에 응답하여 상기 카운트 값들을 초기화하는 것을 특징으로 한다.Wherein the counter is activated in response to the counter and clock enable signal applied after the reset count value reaches a predetermined settling time and the bit used to determine the data transmission and sampling timing in the SPI logic portion of the count values Counts and outputs a count value, and initializes the count values in response to a counter initialization signal applied from the apparatus.

상기 SPI 로직부는 상기 장치로부터 인가되는 로직 실행 신호에 응답하여 활성화되고, 데이터를 샘플링하는 타이밍의 위상을 설정하는 상기 위상 설정 신호, 기설정된 단위로 전송을 수행할 횟수를 설정하는 전송 횟수값 및 상기 다른 장치로 전송할 입력 데이터를 수신하여, 상기 비트 카운트 값에 따라 상기 데이터를 송신 데이터로서 비트 단위로 상기 다른 장치로 전송하고, 상기 다른 장치에서 전송되는 수신 데이터를 출력 데이터로서 상기 장치로 출력하는 것을 특징으로 한다.Wherein the SPI logic unit is activated in response to a logic execution signal applied from the apparatus and includes a phase setting signal for setting a phase of timing for sampling data, a transmission number value for setting a number of times of performing transmission in a predetermined unit, And outputting the data as transmission data to the other device on a bit basis in accordance with the bit count value and outputting the received data transmitted from the other device to the device as output data .

상기 SPI 로직부는 상기 기설정된 단위의 통신이 완료될 때마다, 단위 통신이 완료되었음을 나타내는 단위 통신 완료 신호를 상기 장치로 출력하고, 상기 데이터 송신 횟수값이 상기 전송 횟수값만큼 전송되면, 전송 완료 신호를 상기 장치로 출력하는 것을 특징으로 한다.The SPI logic unit outputs a unit communication completion signal indicating completion of the unit communication to the apparatus every time the predetermined unit of communication is completed, and when the data transmission number value is transmitted by the transmission number value, To the apparatus.

상기 SPI 코어는 상기 장치로부터 적어도 하나의 선택 입력 신호 중 하나가 활성화되면, 적어도 하나의 슬레이브 선택 신호 중 활성화된 입력 선택 신호에 대응하는 슬레이브 선택 신호를 활성화하여 상기 적어도 하나의 다른 장치 중 상기 장치와 SPI 통신을 수행할 다른 장치를 선택하는 것을 특징으로 한다.Wherein the SPI core activates a slave selection signal corresponding to an activated input selection signal of at least one slave selection signal when one of the at least one selection input signal is activated from the device, And selects another device to perform the SPI communication.

상기 SPI 코어는 상기 FPGA로 구현되어 상기 장치에 내장 되는 것을 특징으로 한다.The SPI core is implemented in the FPGA and is embedded in the device.

따라서, 본 발명의 FPGA를 이용한 범용 SPI 코어는 SPI 코어가 SPI 코어를 구비하는 대응하는 장치로부터 각종 설정을 지정하는 컨트롤 신호를 수신하여, 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값을 포함하는 다양한 설정 값들을 설정하므로, 대응하는 장치가 직접 각종 설정을 지정할 수 있도록 한다. 그러므로 미리 정해진 설정값에 따라서만 동작하는 기존의 SPI 코어에 비하여 범용성을 갖도록 할 수 있다. 또한 FPGA로 구현됨에 따라 다양한 장치에 용이하게 포함될 수 있으며, 추후 수정이 용이하다.Accordingly, in the general-purpose SPI core using the FPGA of the present invention, the SPI core receives a control signal designating various settings from a corresponding device having an SPI core, and outputs a clock signal having a clock polarity setting signal CPOL or a phase setting signal CPHA Values, so that the corresponding device can directly specify various settings. Therefore, it is possible to have versatility in comparison with a conventional SPI core that operates only in accordance with a predetermined set value. Also, since it is implemented in FPGA, it can be easily included in various devices and can be easily modified later.

도1 은 SPI 통신의 클럭 극성 설정 신호와 위상 설정 신호의 개념을 나타내는 도면이다.
도2 는 본 발명의 일 실시예에 따른 SPI 코어의 구조를 나타낸다.
도3 은 도2 의 SPI 코어의 각 구성의 동작을 상세하게 나타낸 도면이다.
1 is a diagram showing the concept of a clock polarity setting signal and a phase setting signal of SPI communication.
2 shows a structure of an SPI core according to an embodiment of the present invention.
3 is a detailed view showing the operation of each configuration of the SPI core of FIG.

본 발명과 본 발명의 동작상의 이점 및 본 발명의 실시에 의하여 달성되는 목적을 충분히 이해하기 위해서는 본 발명의 바람직한 실시예를 예시하는 첨부 도면 및 첨부 도면에 기재된 내용을 참조하여야만 한다. In order to fully understand the present invention, operational advantages of the present invention, and objects achieved by the practice of the present invention, reference should be made to the accompanying drawings and the accompanying drawings which illustrate preferred embodiments of the present invention.

이하, 첨부한 도면을 참조하여 본 발명의 바람직한 실시예를 설명함으로서, 본 발명을 상세히 설명한다. 그러나, 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며, 설명하는 실시예에 한정되는 것이 아니다. 그리고, 본 발명을 명확하게 설명하기 위하여 설명과 관계없는 부분은 생략되며, 도면의 동일한 참조부호는 동일한 부재임을 나타낸다. Hereinafter, the present invention will be described in detail with reference to the preferred embodiments of the present invention with reference to the accompanying drawings. However, the present invention can be implemented in various different forms, and is not limited to the embodiments described. In order to clearly describe the present invention, parts that are not related to the description are omitted, and the same reference numerals in the drawings denote the same members.

명세서 전체에서, 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라, 다른 구성요소를 더 포함할 수 있는 것을 의미한다. 또한, 명세서에 기재된 "...부", "...기", "모듈", "블록" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미하며, 이는 하드웨어나 소프트웨어 또는 하드웨어 및 소프트웨어의 결합으로 구현될 수 있다. Throughout the specification, when an element is referred to as "including" an element, it does not exclude other elements unless specifically stated to the contrary. The terms "part", "unit", "module", "block", and the like described in the specification mean units for processing at least one function or operation, And a combination of software.

도2 는 본 발명의 일 실시예에 따른 SPI 코어의 구조를 나타내며, 일예로 마스터 장치의 SPI 코어(100)를 나타낸다.FIG. 2 shows a structure of an SPI core according to an embodiment of the present invention, for example, an SPI core 100 of a master device.

도2 를 참조하면, SPI 코어(100)는 SPI 로직부(110), 카운터(120) 및 동기 클럭 발생부(130)를 구비한다. SPI 코어(100)는 SPI 코어(100)가 포함되는 대응하는 장치로부터 클럭 신호(CLK)와 리셋 신호(RST), 컨트롤 신호(CTRL) 및 데이터(DATA)를 수신하고, SPI 통신으로 통신을 수행하고자 하는 슬레이브 장치의 SPI 코어(100)로 슬레이브 선택 신호(CS), 동기 클럭(SCLK), 송신 데이터(SPI_WRITE)를 전송하고, 슬레이브 장치의 SPI 코어(100)로부터 수신 데이터 신호(SPI_READ)를 수신한다. 그리고 수신 데이터(SPI_READ)에서 데이터(DATA)를 획득하여 대응하는 장치로 전송한다. 여기서 컨트롤 신호(CTRL)는 단일 신호가 아니라 복수개의 신호가 조합된 신호이며, 특히 컨트롤 신호(CTRL)는 SPI 코어(100)의 각종 설정을 지정하기 위한 신호로서, 클럭 극성 설정 신호(CPOL)나 CPHA 값을 포함하여 SPI 코어(100)의 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값을 대응하는 장치가 직접 지정할 수 있도록 한다.Referring to FIG. 2, the SPI core 100 includes an SPI logic unit 110, a counter 120, and a synchronous clock generation unit 130. The SPI core 100 receives a clock signal CLK, a reset signal RST, a control signal CTRL and data DATA from a corresponding device including the SPI core 100 and performs communication through SPI communication The slave selection signal CS, the synchronous clock SCLK and the transmission data SPI_WRITE to the SPI core 100 of the slave device to be received and receives the reception data signal SPI_READ from the SPI core 100 of the slave device do. Then, it acquires the data (DATA) from the received data (SPI_READ) and transmits it to the corresponding device. The control signal CTRL is not a single signal but a combination of a plurality of signals. Particularly, the control signal CTRL is a signal for designating various settings of the SPI core 100 and includes a clock polarity setting signal CPOL The value of the clock polarity setting signal CPOL or the phase setting signal CPHA of the SPI core 100 including the CPHA value can be directly designated by the corresponding device.

SPI 코어(100)에서 동기 클럭 발생부(130)는 마스터 장치와 슬레이브 장치의 SPI 코어(100) 사이의 동기화를 위해 제공하는 클럭인 동기 클럭(SCLK)을 생성한다. 카운터(120)는 SPI 로직부(110)에 저장된 데이터(DATA)를 시프트(shift)하고, 데이터(DATA)의 샘플링 타이밍을 지정하기 위한 카운트값(CNT)을 생성한다. SPI 로직부(110)는 컨트롤 신호(CTRL) 및 카운터(120)의 카운터값(CNT)에 따라 출력을 설정한다.In the SPI core 100, the synchronous clock generator 130 generates a synchronous clock SCLK, which is a clock for providing synchronization between the master device and the SPI core 100 of the slave device. The counter 120 shifts the data DATA stored in the SPI logic unit 110 and generates a count value CNT for designating the sampling timing of the data DATA. The SPI logic unit 110 sets the output according to the control signal CTRL and the counter value CNT of the counter 120.

따라서 도2 의 SPI 코어(100)는 대응하는 장치로부터 컨트롤 신호(CTRL)를 수신하여 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값을 포함하는 다양한 설정 값들을 대응하는 장치가 지정할 수 있도록 함으로써, 미리 정해진 설정값에 따라서만 동작하는 기존의 SPI 코어에 비하여 범용성을 갖도록 할 수 있다.Accordingly, the SPI core 100 of FIG. 2 receives the control signal CTRL from the corresponding device and outputs various setting values including the values of the clock polarity setting signal CPOL and the phase setting signal CPHA to the corresponding devices It is possible to have versatility in comparison with a conventional SPI core that operates only in accordance with a predetermined set value.

도3 은 도1 의 SPI 코어의 각 구성의 동작을 상세하게 나타낸 도면이다.3 is a detailed view showing the operation of each configuration of the SPI core of FIG.

도2 를 참조하여 도3 의 SPI 코어(100)의 동작을 살펴보면, SPI 코어(100)는 클럭 신호(CLK)와 리셋 신호(RST)를 SPI 코어(100)를 구비하는 대응하는 장치로부터 수신한다. 클럭 신호(CLK)는 SPI 코어(100)이 사용하는 클럭 신호로서, SPI 코어(100)의 동작 타이밍의 기준이 되는 신호이다. 그리고 리셋 신호(RST)는 SPI 코어(100)의 설정값 및 데이터를 초기화 하기 위한 신호이다. 한편 SPI 코어(100)는 대응하는 장치로부터 선택 입력 신호(CE)를 수신한다. SPI 코어(100)는 선택 입력 신호(CE)에 응답하여 슬레이브를 선택하기 위한 슬레이브 선택 신호(CS)를 활성화 한다. 마스터 장치의 SPI 코어(100)는 복수개의 슬레이브 장치와 SPI 통신을 수행할 수 있으며, 마스터 장치는 복수개의 슬레이브 장치 중 통신을 수행하기 원하는 슬레이브 장치를 선택할 필요가 있다. 이에 마스터 장치는 SPI 코어(100)로 선택 입력 신호(CE)를 전송하고, SPI 코어(100)는 선택 입력 신호(CE)에 응답하여 복수개의 슬레이브 장치에 대응하여 구비되는 복수개의 슬레이브 선택 신호 라인 중 하나를 슬레이브 선택 신호(CS)로서 활성화 한다. 이에 슬레이브 선택 신호(CS)가 활성화된 슬레이브 선택 신호 라인에 연결된 슬레이브 장치의 SPI 코어가 활성화된다.3, the SPI core 100 receives the clock signal CLK and the reset signal RST from the corresponding device having the SPI core 100 . The clock signal CLK is a clock signal used by the SPI core 100 and serves as a reference of the operation timing of the SPI core 100. [ The reset signal RST is a signal for initializing the set value and data of the SPI core 100. While the SPI core 100 receives the selection input signal CE from the corresponding device. The SPI core 100 activates a slave selection signal CS for selecting a slave in response to the selection input signal CE. The SPI core 100 of the master device can perform SPI communication with a plurality of slave devices and the master device needs to select a slave device that desires to perform communication among the plurality of slave devices. The master device transmits the selection input signal CE to the SPI core 100. The SPI core 100 responds to the selection input signal CE to output a plurality of slave selection signal lines As a slave selection signal CS. The SPI core of the slave device connected to the slave selection signal line in which the slave selection signal CS is activated is activated.

한편 SPI 코어(100)의 카운터(120)는 대응하는 장치로부터 컨트롤 신호(CTRL)로서 카운터 및 클럭 실행 신호(EXEC_CNT_N_SCLK_EN)와 카운터 초기화 신호(EXEC_CNT_CLR)를 수신한다. 카운터 및 클럭 실행 신호(EXEC_CNT_N_SCLK_EN)는 카운터(120)를 실행하도록 하는 구동 신호이다. 카운터 실행 신호(EXEC_CNT_N_SCLK_EN)가 인가되면, 카운터(120)가 구동되어 카운트를 시작하여 카운터 값(CNT)을 출력한다. 그리고, 카운터 초기화 신호(EXEC_CNT_CLR)는 카운터(120)에 구비된 레지스터에 저장된 값, 즉 카운트 값(CNT)을 초기화 시키는 신호이다. 도3 에 도시된 바와 같이, 카운터(120)는 비트 카운터(121) 와 리셋 카운터(122)를 구비하고, 비트 카운터(121)와 리셋 카운터(122) 각각이 레지스터를 구비하여 카운트 값을 저장한다. 카운터(120)에서 출력되는 카운트 값(CNT)은 비트 카운터(121)와 리셋 카운터(122) 각각에서 출력되는 비트 카운트 값(BIT_CNT)과 리셋 카운터 값(RST_CNT)으로서, 비트 카운터(121)와 리셋 카운터(122) 각각의 레지스터에 저장된 값이다.Meanwhile, the counter 120 of the SPI core 100 receives the counter and clock execution signal (EXEC_CNT_N_SCLK_EN) and the counter initialization signal (EXEC_CNT_CLR) as the control signal CTRL from the corresponding device. The counter and the clock execution signal (EXEC_CNT_N_SCLK_EN) are drive signals for causing the counter 120 to execute. When the counter execution signal (EXEC_CNT_N_SCLK_EN) is applied, the counter 120 is driven to start counting and output a counter value (CNT). The counter initializing signal EXEC_CNT_CLR is a signal for initializing a value stored in a register provided in the counter 120, that is, a count value CNT. 3, the counter 120 includes a bit counter 121 and a reset counter 122. Each of the bit counter 121 and the reset counter 122 includes a register to store a count value . The count value CNT output from the counter 120 is a bit count value BIT_CNT and a reset counter value RST_CNT output from the bit counter 121 and the reset counter 122, Is a value stored in each of the registers of the counter 122.

여기서 비트 카운트 값(BIT_CNT)은 SPI 로직부(110)에서 데이터 쉬프트와 샘플링 타이밍을 결정하기 위해 사용되는 카운트 값으로, 클럭(CLK)의 상승 에지마다 카운트 값이 증가된다. 그리고 리셋 카운트 값(RST_CNT)은 SPI 코어(100)가 초기 구동되거나 리셋 되면, 안정적으로 구동될 때까지의 안정화 기간을 카운트 하는 카운트 값이다.Here, the bit count value BIT_CNT is a count value used for determining the data shift and the sampling timing in the SPI logic unit 110, and the count value is incremented every rising edge of the clock CLK. The reset count value RST_CNT is a count value for counting the stabilization period until the SPI core 100 is initially driven or reset when the SPI core 100 is reset.

그리고 동기 클럭 발생부(130)는 대응하는 장치로부터 카운터 및 클럭 실행 신호(EXEC_CNT_N_SCLK_EN)와 클럭 극성 설정 신호(CPOL)를 수신하고, 동기 클럭 신호(SCLK)를 슬레이브 장치의 SPI 코어로 출력한다. 카운터 및 클럭 실행 신호(EXEC_CNT_N_SCLK_EN)는 카운터(120)를 실행하도록 하는 구동 신호이며, 동시에 동기 클럭 발생부(130)를 실행하도록 하는 구동 신호이다. 즉 카운터 및 클럭 실행 신호(EXEC_CNT_N_SCLK_EN)는 카운터(120)과 동기 클럭 발생부(130)를 동시에 구동한다. 클럭 극성 설정 신호(CPOL)는 상기한 바와 같이, 동기 클럭 신호(SCLK)의 극성을 조절하는 신호로서, 동기 클럭 발생부(130)는 클럭 극성 설정 신호(CPOL)에 응답하여 출력하는 동기 클럭 신호(SCLK)가 하이 레벨에서 시작할지 로우 레벨에서 시작할지 결정하여, 클럭 신호(SCLK)를 슬레이브 장치로 출력한다.The synchronous clock generating unit 130 receives the counter and clock execution signal EXEC_CNT_N_SCLK_EN and the clock polarity setting signal CPOL from the corresponding device and outputs the synchronous clock signal SCLK to the SPI core of the slave device. The counter and clock execution signal (EXEC_CNT_N_SCLK_EN) is a driving signal for causing the counter 120 to execute and a driving signal for causing the synchronous clock generating section 130 to execute simultaneously. That is, the counter and clock execution signal (EXEC_CNT_N_SCLK_EN) simultaneously drives the counter 120 and the synchronous clock generator 130. The clock polarity setting signal CPOL is a signal for controlling the polarity of the synchronous clock signal SCLK as described above. The synchronous clock generating unit 130 generates a synchronous clock signal SCCLK, which is output in response to the clock polarity setting signal CPOL, Determines whether the clock signal SCLK starts at the high level or the low level and outputs the clock signal SCLK to the slave device.

SPI 로직부(110)는 대응하는 장치로부터 위상 설정 신호(CPHA), 전송 횟수값(BCNT), 로직 실행 신호(EXEC_SPI_LOGIC) 및 입력 데이터(DATA_IN)을 수신하고, 출력 데이터(DATA_OUT)를 대응하는 장치로 출력한다. 여기서 위상 설정 신호(CPHA)는 데이터 동기화 타이밍을 조절하는 신호로서, 데이터를 샘플링하는 타이밍의 위상을 설정하는 신호이다. 그리고 전송 횟수값(BCNT)는 기설정된 단위(예를 들면 바이트(byte))로 전송을 수행할 횟수를 설정하는 신호이다. 로직 실행 신호(EXEC_SPI_LOGIC)는 카운터 및 클럭 실행 신호(EXEC_CNT_N_SCLK_EN)와 유사하게, SPI 로직부(110)를 실행하도록 하는 구동 신호이다.The SPI logic unit 110 receives the phase setting signal CPHA, the transmission count value BCNT, the logic execution signal EXEC_SPI_LOGIC and the input data DATA_IN from the corresponding device and outputs the output data DATA_OUT to the corresponding device . The phase setting signal CPHA is a signal for adjusting the data synchronization timing, and is a signal for setting the phase of the timing for sampling data. The transmission number value BCNT is a signal for setting the number of times of performing transmission in a predetermined unit (for example, byte). The logic execution signal EXEC_SPI_LOGIC is a driving signal that causes the SPI logic unit 110 to execute, similar to the counter and clock execution signal EXEC_CNT_N_SCLK_EN.

또한 SPI 로직부(110)는 입력 데이터(DATA_IN)에 대응하는 비트 단위의 데이터인 송신 데이터(SPI_WRITE)를 슬레이브 장치의 SPI 코어로 송신하고, 슬레이브 장치의 SPI 코어로부터 비트 단위로 수신 데이터(SPI_READ)를 수신하여, 수신 데이터(SPI_READ)에 대응하는 출력 데이터(DATA_OUT)를 획득하여 대응하는 장치로 출력한다.Also, the SPI logic unit 110 transmits transmission data (SPI_WRITE), which is data in bit units corresponding to the input data (DATA_IN), to the SPI core of the slave device, and receives reception data (SPI_READ) in units of bits from the SPI core of the slave device. And obtains the output data (DATA_OUT) corresponding to the received data (SPI_READ) and outputs it to the corresponding device.

그리고 SPI 로직부(110)는 기설정된 단위(예를 들면 바이트(byte))의 통신이 완료될 때마다, 단위 통신이 완료되었음을 단위 통신 완료 신호(NEXT_BYTE)를 출력하여 대응하는 장치로 통지한다. 한편 SPI 로직부(110)는 수신된 전송 횟수값(BCNT)만큼의 전송이 완료되면, 전송 완료 신호(CHK_FIN)를 대응하는 장치로 출력한다.The SPI logic unit 110 outputs a unit communication completion signal NEXT_BYTE to notify the corresponding device that the unit communication is completed each time communication of a preset unit (for example, byte) is completed. On the other hand, the SPI logic unit 110 outputs the transmission completion signal CHK_FIN to the corresponding device when the transmission of the number of transmission times (BCNT) is completed.

상기한 도3 에 도시된 바와 같이, 본 발명의 SPI 코어(100)는 클럭 극성 설정 신호(CPOL)와 위상 설정 신호(CPHA)를 SPI 코어(100)를 구비하는 대응하는 장치로부터 수신하여 설정할 수 있다. 따라서 클럭 극성 설정 신호(CPOL)와 위상 설정 신호(CPHA)가 서로 다르게 설정된 다양한 종류의 슬레이브 장치와 원활하게 SPI 통신을 수행할 수 있다. 즉 슬레이브 장치의 SPI 코어 설정에 무관하게 통신을 수행할 수 있다.3, the SPI core 100 of the present invention receives and sets a clock polarity setting signal CPOL and a phase setting signal CPHA from a corresponding device having the SPI core 100 have. Therefore, it is possible to smoothly perform SPI communication with various kinds of slave devices in which the clock polarity setting signal CPOL and the phase setting signal CPHA are set to be different from each other. That is, communication can be performed irrespective of the SPI core setting of the slave device.

본 발명에 따른 방법은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 기록매체의 예로는 ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광데이터 저장장치 등이 있으며, 또한 캐리어 웨이브(예를 들어 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 또한 컴퓨터가 읽을 수 있는 기록매체는 네트워크로 연결된 컴퓨터 시스템에 분산되어 분산방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.The method according to the present invention can be implemented as a computer-readable code on a computer-readable recording medium. A computer-readable recording medium includes all kinds of recording apparatuses in which data that can be read by a computer system is stored. Examples of the recording medium include a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like, and a carrier wave (for example, transmission via the Internet). The computer-readable recording medium may also be distributed over a networked computer system so that computer readable code can be stored and executed in a distributed manner.

본 발명은 도면에 도시된 실시예를 참고로 설명되었으나 이는 예시적인 것에 불과하며, 본 기술 분야의 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is evident that many alternatives, modifications and variations will be apparent to those skilled in the art.

따라서, 본 발명의 진정한 기술적 보호 범위는 첨부된 등록청구범위의 기술적 사상에 의해 정해져야 할 것이다.Accordingly, the true scope of the present invention should be determined by the technical idea of the appended claims.

Claims (8)

SPI 통신을 수행하고자 하는 장치에 내장되는 SPI 코어에 있어서,
상기 장치와 SPI 통신을 수행하는 적어도 하나의 다른 장치 사이에 상기 SPI 통신 시에 동기화를 위한 동기 클럭을 상기 장치로부터 인가되는 클럭 극성 설정 신호에 응답하여 생성하는 동기 클럭 발생부;
상기 SPI 통신으로 송수신하는 데이터의 비트 수와 데이터의 샘플링 타이밍을 결정하는 카운트값들을 생성하는 카운터; 및
상기 장치로부터 클럭 극성 설정 신호와 위상 설정 신호를 포함하는 컨트롤 신호를 수신하여 저장하고, 저장된 상기 위상 설정 신호 및 상기 카운터에서 생성된 상기 카운터값들에 따라 상기 장치와 상기 적어도 하나의 다른 장치 사이에 SPI 통신으로 데이터를 송수신하는 SPI 로직부; 를 포함하는 SPI 코어.
In an SPI core embedded in a device to perform SPI communication,
A synchronous clock generator for generating a synchronous clock for synchronization in the SPI communication between the apparatus and at least one other apparatus performing SPI communication in response to a clock polarity setting signal applied from the apparatus;
A counter for generating count values for determining the number of bits of data to be transmitted and received in the SPI communication and sampling timing of data; And
Receiving and storing a control signal including a clock polarity setting signal and a phase setting signal from the apparatus and storing a control signal including a clock polarity setting signal and a phase setting signal between the apparatus and the at least one other apparatus in accordance with the stored phase setting signal and the counter values generated in the counter An SPI logic unit for transmitting and receiving data through SPI communication; The SPI core.
제1 항에 있어서, 상기 클럭 발생부는
상기 클럭 극성 설정 신호에 따라 상기 동기 클럭의 초기 레벨을 결정하고, 상기 장치에서 인가되는 카운터 및 클럭 실행 신호에 응답하여 상기 동기 클럭을 토글하여 상기 다른 장치로 출력하는 것을 특징으로 하는 SPI 코어.
The apparatus of claim 1, wherein the clock generator
Determines an initial level of the synchronous clock according to the clock polarity setting signal, and toggles the synchronous clock in response to a counter and a clock execution signal applied from the apparatus, and outputs the toggled synchronous clock to the other apparatus.
제2 항에 있어서, 상기 카운터는
상기 SPI 코어가 초기 구동되거나, 상기 SPI 코어로 상기 장치로부터 리셋 신호가 인가되면, 상기 카운트 값들 중 리셋 카운트 값을 카운트하여 출력하는 것을 특징으로 하는 SPI 코어.
3. The apparatus of claim 2, wherein the counter
Wherein the SPI core counts a reset count value among the count values when the SPI core is initially driven or a reset signal is applied from the device to the SPI core.
제3 항에 있어서, 상기 카운터는
상기 리셋 카운트 값이 기설정된 안정화 시간에 도달한 이후 인가되는 상기 카운터 및 클럭 실행 신호에 응답하여 활성화되어 상기 카운트 값들 중 상기 SPI 로직부에서 데이터 전송과 샘플링 타이밍을 결정하기 위해 사용되는 비트 카운트 값을 카운트하여 출력하고, 상기 장치에서 인가되는 카운터 초기화 신호에 응답하여 상기 카운트 값들을 초기화하는 것을 특징으로 하는 SPI 코어.
4. The apparatus of claim 3, wherein the counter
A bit count value that is activated in response to the counter and clock execution signal applied after the reset count value reaches a predetermined stabilization time and used to determine data transmission and sampling timing in the SPI logic unit of the count values And initializes the count values in response to a counter initialization signal applied from the apparatus.
제4 항에 있어서, 상기 SPI 로직부는
상기 장치로부터 인가되는 로직 실행 신호에 응답하여 활성화되고, 데이터를 샘플링하는 타이밍의 위상을 설정하는 상기 위상 설정 신호, 기설정된 단위로 전송을 수행할 횟수를 설정하는 전송 횟수값 및 상기 다른 장치로 전송할 입력 데이터를 수신하여, 상기 비트 카운트 값에 따라 상기 데이터를 송신 데이터로서 비트 단위로 상기 다른 장치로 전송하고, 상기 다른 장치에서 전송되는 수신 데이터를 출력 데이터로서 상기 장치로 출력하는 것을 특징으로 하는 SPI 코어.
5. The apparatus of claim 4, wherein the SPI logic portion
A phase setting signal for activating in response to a logic execution signal applied from the apparatus and setting a phase of a timing for sampling data, a transmission number value for setting a number of times of performing transmission in a predetermined unit, And outputs the data as transmission data to the other apparatus in units of bits in accordance with the bit count value and outputs the reception data transmitted from the other apparatus to the apparatus as output data. core.
제5 항에 있어서, 상기 SPI 로직부는
상기 기설정된 단위의 통신이 완료될 때마다, 단위 통신이 완료되었음을 나타내는 단위 통신 완료 신호를 상기 장치로 출력하고, 상기 데이터 송신 횟수값이 상기 전송 횟수값만큼 전송되면, 전송 완료 신호를 상기 장치로 출력하는 것을 특징으로 하는 SPI 코어.
6. The apparatus of claim 5, wherein the SPI logic portion
A unit communication completion signal indicating that the unit communication is completed is output to the apparatus every time the communication of the predetermined unit is completed, and when the data transmission number value is transmitted by the transmission number value, And outputs the SPI core.
제1 항에 있어서, 상기 SPI 코어는
상기 장치로부터 적어도 하나의 선택 입력 신호 중 하나가 활성화되면, 적어도 하나의 슬레이브 선택 신호 중 활성화된 입력 선택 신호에 대응하는 슬레이브 선택 신호를 활성화하여 상기 적어도 하나의 다른 장치 중 상기 장치와 SPI 통신을 수행할 다른 장치를 선택하는 것을 특징으로 하는 SPI 코어.
The method of claim 1, wherein the SPI core
Activating a slave selection signal corresponding to an activated input selection signal of at least one slave selection signal when one of the at least one selection input signal from the device is activated to perform SPI communication with the device of the at least one other device Gt; SPI < / RTI > core.
제1 항에 있어서, 상기 SPI 코어는
FPGA로 구현되어 상기 장치에 내장되는 것을 특징으로 하는 SPI 코어.
The method of claim 1, wherein the SPI core
Wherein the SPI core is implemented in an FPGA and embedded in the device.
KR1020130136898A 2013-11-12 2013-11-12 Universal spi core using fpga KR101506279B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020130136898A KR101506279B1 (en) 2013-11-12 2013-11-12 Universal spi core using fpga

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020130136898A KR101506279B1 (en) 2013-11-12 2013-11-12 Universal spi core using fpga

Publications (1)

Publication Number Publication Date
KR101506279B1 true KR101506279B1 (en) 2015-03-26

Family

ID=53028680

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020130136898A KR101506279B1 (en) 2013-11-12 2013-11-12 Universal spi core using fpga

Country Status (1)

Country Link
KR (1) KR101506279B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110060856A1 (en) 2009-09-09 2011-03-10 Hon Hai Precision Industry Co., Ltd. Spi control device and method for accessing spi slave devices using the same
CN202870808U (en) 2012-07-04 2013-04-10 四川九洲电器集团有限责任公司 FPGA realization device of SPI serial port module

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110060856A1 (en) 2009-09-09 2011-03-10 Hon Hai Precision Industry Co., Ltd. Spi control device and method for accessing spi slave devices using the same
CN202870808U (en) 2012-07-04 2013-04-10 四川九洲电器集团有限责任公司 FPGA realization device of SPI serial port module

Similar Documents

Publication Publication Date Title
EP3570175B1 (en) Method for implementing nvme over fabrics, terminal, server, and system
US8151134B2 (en) SPI devices and method for transferring data between the SPI devices
JP2017097907A5 (en) Integrated circuit device and system
US9213615B2 (en) Information processing apparatus with debugging unit and debugging method therefor
US9515686B2 (en) Signal transmitting circuit using common clock, and storage device therewith
US20130019039A1 (en) System and method for operating a one-wire protocol slave in a two-wire protocol bus environment
US20110062987A1 (en) Asynchronous conversion circuitry apparatus, systems, and methods
WO2016095435A1 (en) Multi-chip cascading method, chip and device, and storage medium
KR102453113B1 (en) Signal transmitting circuit reducing power at standby state
Anand et al. Design and implementation of a high speed Serial Peripheral Interface
JP2012533830A (en) Pseudo-synchronous time division multiplexing
EP3200089B1 (en) Method, apparatus, communication equipment and storage media for determining link delay
JP2021507363A (en) Serial communication device
JP2018045409A (en) Data transmitter/receiver, and data transmission/reception system
US10002090B2 (en) Method for improving the performance of synchronous serial interfaces
CN109324987B (en) Time sequence control method and device of analog communication interface and electronic equipment
Hafeez et al. IP core of Serial Peripheral Interface (SPI) with AMBA APB interface
KR101506279B1 (en) Universal spi core using fpga
TWI667904B (en) Transmitting device for high speed communication
US20170091601A1 (en) Control device, image forming apparatus, and control method
KR101447154B1 (en) Universal spi core using fpga and operation method thereof
CN103107877A (en) Data transfer system, data transfer method, receiving circuit, and receiving method
KR20160019836A (en) Signal transmitting circuit using common clock, and storage device therewith
CN106294260B (en) The method that data are output to synchronous bus from asynchronous bus
KR20150057520A (en) method and apparatus for transmitting information by Interrupt way

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
FPAY Annual fee payment

Payment date: 20180119

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20200219

Year of fee payment: 6