KR101506279B1 - Universal spi core using fpga - Google Patents
Universal spi core using fpga Download PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
- G06F1/06—Clock generators producing several clock signals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4204—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
- G06F13/4208—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being a system bus, e.g. VME bus, Futurebus, Multibus
- G06F13/4213—Bus 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
Description
본 발명은 범용 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
도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 코어(100)에서 동기 클럭 발생부(130)는 마스터 장치와 슬레이브 장치의 SPI 코어(100) 사이의 동기화를 위해 제공하는 클럭인 동기 클럭(SCLK)을 생성한다. 카운터(120)는 SPI 로직부(110)에 저장된 데이터(DATA)를 시프트(shift)하고, 데이터(DATA)의 샘플링 타이밍을 지정하기 위한 카운트값(CNT)을 생성한다. SPI 로직부(110)는 컨트롤 신호(CTRL) 및 카운터(120)의 카운터값(CNT)에 따라 출력을 설정한다.In the
따라서 도2 의 SPI 코어(100)는 대응하는 장치로부터 컨트롤 신호(CTRL)를 수신하여 클럭 극성 설정 신호(CPOL)나 위상 설정 신호(CPHA)의 값을 포함하는 다양한 설정 값들을 대응하는 장치가 지정할 수 있도록 함으로써, 미리 정해진 설정값에 따라서만 동작하는 기존의 SPI 코어에 비하여 범용성을 갖도록 할 수 있다.Accordingly, the
도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 코어(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
여기서 비트 카운트 값(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
그리고 동기 클럭 발생부(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
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 로직부(110)는 입력 데이터(DATA_IN)에 대응하는 비트 단위의 데이터인 송신 데이터(SPI_WRITE)를 슬레이브 장치의 SPI 코어로 송신하고, 슬레이브 장치의 SPI 코어로부터 비트 단위로 수신 데이터(SPI_READ)를 수신하여, 수신 데이터(SPI_READ)에 대응하는 출력 데이터(DATA_OUT)를 획득하여 대응하는 장치로 출력한다.Also, the
그리고 SPI 로직부(110)는 기설정된 단위(예를 들면 바이트(byte))의 통신이 완료될 때마다, 단위 통신이 완료되었음을 단위 통신 완료 신호(NEXT_BYTE)를 출력하여 대응하는 장치로 통지한다. 한편 SPI 로직부(110)는 수신된 전송 횟수값(BCNT)만큼의 전송이 완료되면, 전송 완료 신호(CHK_FIN)를 대응하는 장치로 출력한다.The
상기한 도3 에 도시된 바와 같이, 본 발명의 SPI 코어(100)는 클럭 극성 설정 신호(CPOL)와 위상 설정 신호(CPHA)를 SPI 코어(100)를 구비하는 대응하는 장치로부터 수신하여 설정할 수 있다. 따라서 클럭 극성 설정 신호(CPOL)와 위상 설정 신호(CPHA)가 서로 다르게 설정된 다양한 종류의 슬레이브 장치와 원활하게 SPI 통신을 수행할 수 있다. 즉 슬레이브 장치의 SPI 코어 설정에 무관하게 통신을 수행할 수 있다.3, the
본 발명에 따른 방법은 컴퓨터로 읽을 수 있는 기록매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 기록매체는 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 기록매체의 예로는 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 코어.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.
상기 클럭 극성 설정 신호에 따라 상기 동기 클럭의 초기 레벨을 결정하고, 상기 장치에서 인가되는 카운터 및 클럭 실행 신호에 응답하여 상기 동기 클럭을 토글하여 상기 다른 장치로 출력하는 것을 특징으로 하는 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.
상기 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.
상기 리셋 카운트 값이 기설정된 안정화 시간에 도달한 이후 인가되는 상기 카운터 및 클럭 실행 신호에 응답하여 활성화되어 상기 카운트 값들 중 상기 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.
상기 장치로부터 인가되는 로직 실행 신호에 응답하여 활성화되고, 데이터를 샘플링하는 타이밍의 위상을 설정하는 상기 위상 설정 신호, 기설정된 단위로 전송을 수행할 횟수를 설정하는 전송 횟수값 및 상기 다른 장치로 전송할 입력 데이터를 수신하여, 상기 비트 카운트 값에 따라 상기 데이터를 송신 데이터로서 비트 단위로 상기 다른 장치로 전송하고, 상기 다른 장치에서 전송되는 수신 데이터를 출력 데이터로서 상기 장치로 출력하는 것을 특징으로 하는 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.
상기 기설정된 단위의 통신이 완료될 때마다, 단위 통신이 완료되었음을 나타내는 단위 통신 완료 신호를 상기 장치로 출력하고, 상기 데이터 송신 횟수값이 상기 전송 횟수값만큼 전송되면, 전송 완료 신호를 상기 장치로 출력하는 것을 특징으로 하는 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.
상기 장치로부터 적어도 하나의 선택 입력 신호 중 하나가 활성화되면, 적어도 하나의 슬레이브 선택 신호 중 활성화된 입력 선택 신호에 대응하는 슬레이브 선택 신호를 활성화하여 상기 적어도 하나의 다른 장치 중 상기 장치와 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.
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.
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)
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 |
-
2013
- 2013-11-12 KR KR1020130136898A patent/KR101506279B1/en active IP Right Grant
Patent Citations (2)
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 |