KR20160060181A - Communication apparatus and method for serial peripheral interface - Google Patents
Communication apparatus and method for serial peripheral interface Download PDFInfo
- Publication number
- KR20160060181A KR20160060181A KR1020140161326A KR20140161326A KR20160060181A KR 20160060181 A KR20160060181 A KR 20160060181A KR 1020140161326 A KR1020140161326 A KR 1020140161326A KR 20140161326 A KR20140161326 A KR 20140161326A KR 20160060181 A KR20160060181 A KR 20160060181A
- Authority
- KR
- South Korea
- Prior art keywords
- data
- crc
- slave device
- slave
- transmitted
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 15
- 230000002093 peripheral effect Effects 0.000 title abstract description 7
- 230000005540 biological transmission Effects 0.000 claims abstract description 29
- 230000001360 synchronised effect Effects 0.000 claims description 3
- 125000004122 cyclic group Chemical group 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0056—Systems characterized by the type of code used
- H04L1/0061—Error detection codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40052—High-speed IEEE 1394 serial bus
- H04L12/40071—Packet processing; Packet format
-
- 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/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Abstract
Description
본 발명은 에스피아이 통신 장치 및 방법에 관한 것으로, 보다 상세하게는 마스터(Master) 장치와 슬레이브(Slave) 장치 간에 에스피아이(SPI : Serial Parallel Interface) 통신 시 상기 마스터 장치가 상기 슬레이브 장치로 데이터를 송신함과 동시에 상기 슬레이브 장치로부터 씨알씨(CRC : Cyclical and Redundancy and Check) 값을 수신하여 체크함으로써 통신 에러 발생을 빠르게 판별할 수 있도록 하는 에스피아이 통신 장치 및 방법에 관한 것이다.
More particularly, the present invention relates to an apparatus and a method for communicating data between a master device and a slave device in a serial parallel interface (SPI) And a cyclic redundancy check (CRC) value is received and checked from the slave device to quickly identify the occurrence of a communication error.
일반적으로 마스터 장치와 슬레이브 장치 간에 직렬 통신으로 데이터를 주고받을 수 있게 해 주는 인터페이스인 SPI(Serial Peripheral Interface)는, 데이터 출력 핀(SDO : Select Data Out), 데이터 입력 핀(SDI : Serial Data In), 클럭 핀(SCLK : Slect Clock), 슬레이브 선택 핀(CS : Chip Select)만을 사용하므로 인터페이스 자체가 간단하고, 직렬이지만 속도가 빠르기 때문에 편리하게 다양한 기능을 구현할 수 있다.Generally, an SPI (Serial Peripheral Interface), which is an interface that allows data to be exchanged between a master device and a slave device, includes a data output pin (SDO), a data input pin (SDI) , Clock pin (SCLK: Slect Clock), and slave select pin (CS: Chip Select), so the interface itself is simple, serial, but fast.
이러한 SPI 통신 프로토콜은 정확한 동작을 위해 정해진 타이밍을 요구하는 동기 프로토콜로서, 예를 들면 비디오게임 시스템, 디지털 카메라, 카 오디오, 내비게이션, 셋톱박스, PDA, MP3 플레이어 등 빠르게 변하는 대용량 데이터를 갖는 애플리케이션에 다양한 주변 기기들을 추가, 연결할 수 있게 해 주는 프로토콜로서, 대부분 CPU(Central Processor Unit)와 주변 기기들 간의 통신을 위한 시스템에 채용된다.This SPI communication protocol is a synchronous protocol that requires a predetermined timing for correct operation. For example, the SPI communication protocol can be applied to applications having a rapidly changing large-capacity data such as a video game system, a digital camera, a car audio, a navigation set top box, a PDA, It is a protocol that allows to add and connect peripherals. It is mostly employed in a system for communication between CPU (Central Processor Unit) and peripheral devices.
최근의 차량에는 많은 전자 제어 장치들이 사용되고 있으며, 상기 SPI 통신 프로토콜은 상기 제어 장치들에 포함되어 있는 집적회로 및 여러 다양한 반도체 칩 사이의 데이터 전달을 위해 폭넓게 사용되는 프로토콜이다. 특히 SPI 마스터 장치와 하나 이상의 주변장치인 SPI 슬레이브 장치 사이에서 데이터 전달을 위해 폭넓게 사용되는 프로토콜이다.Many electronic control devices are used in recent vehicles, and the SPI communication protocol is a widely used protocol for transferring data between an integrated circuit and various semiconductor chips included in the control devices. It is a protocol widely used for data transfer between SPI master devices and SPI slave devices which are one or more peripheral devices.
그러나 SPI 마스터 장치에서 송신된 데이터 값이 마이크로컨트롤러의 오류나 전송선로 상의 잡음에 의해 발생한 글리치(Glitch)로 인해 SPI 슬레이브 장치에 동일하게 수신되지 않을 경우 전체 시스템이 정상적으로 동작하지 않을 수 있는 문제점이 있다. 따라서 상기와 같이 송신 데이터에 오류가 발생할 경우, 그 오류 발생을 가능한 빨리 판별하여 에러를 수정하거나 데이터를 재전송 할 필요가 있다. However, if the data value transmitted from the SPI master device is not equally received by the SPI slave device due to a glitch caused by a microcontroller error or noise on a transmission line, the entire system may not operate normally. Therefore, when an error occurs in the transmission data as described above, it is necessary to determine the occurrence of the error as soon as possible to correct the error or to retransmit the data.
그런데 종래에는 마스터 장치에서 별도의 CRC 체크 명령을 슬레이브 장치에 출력하고, 상기 CRC 체크 명령에 대응하여 상기 슬레이브 장치에서 상기 마스터 장치로 CRC 값을 송신하면 상기 마스터 장치가 상기 슬레이브 장치로부터 수신된 CRC 값을 체크하여 에러 발생을 판별하기 때문에 상당한 시간이 소요되는 문제점이 있었다.Conventionally, the master device outputs a separate CRC check command to the slave device. When the CRC value is transmitted from the slave device to the slave device in response to the CRC check command, the master device transmits the CRC value So that it takes a long time to determine the occurrence of an error.
본 발명의 배경기술은 대한민국 공개특허 10-2010-0073520호(2010.07.01.공개, 메인 보드와 확장 보드간 SPI 통신 시스템 및 방법)에 개시되어 있다.
The background art of the present invention is disclosed in Korean Patent Laid-Open No. 10-2010-0073520 (published on Jul. 1, 2010, SPI communication system and method between main board and expansion board).
본 발명은 상기와 같은 문제점을 해결하기 위해 창작된 것으로서, 마스터 장치와 슬레이브 장치 간에 에스피아이(SPI) 통신 시 상기 마스터 장치가 상기 슬레이브 장치로 데이터를 송신함과 동시에 상기 슬레이브 장치로부터 씨알씨(CRC) 값을 수신하여 체크함으로써 통신 에러 발생을 빠르게 판별할 수 있도록 하는 에스피아이 통신 장치 및 방법을 제공하는데 그 목적이 있다.
SUMMARY OF THE INVENTION The present invention has been made in order to solve the above problems, and it is an object of the present invention to provide a master device and a slave device, in which when the master device transmits data to the slave device during SPI communication, ) Value of the communication error, thereby enabling to quickly determine the occurrence of a communication error.
본 발명의 일 측면에 따른 에스피아이 통신 장치는, 에스피아이(SPI : Serial Parallel Interface) 프로토콜 방식으로 마스터 장치와 슬레이브 장치 간에 통신하게 하는 에스피아이 통신 장치에 있어서, 상기 마스터 장치는, 상기 슬레이브 장치에 전송할 데이터에 대한 제1 CRC(Cyclical and Redundancy and Check) 값을 생성하는 마스터 CRC 발생부; 상기 슬레이브 장치로부터 현재 명령 전송 단계에서 수신되는 제2 CRC 값을 이전 명령 전송 단계에 생성된 제1 CRC 값과 비교하는 CRC 비교부; 및 상기 제1,2 CRC 값의 비교 결과에 기초하여 이전 명령 전송 단계에 전송한 데이터에 대한 에러 발생 여부를 판별하는 마스터 SPI 제어부;를 포함하고, 상기 슬레이브 장치는, 상기 마스터 장치로부터 이전 명령 수신 단계에 전송받은 데이터에 대한 제2 CRC 값을 생성하는 슬레이브 CRC 발생부; 및 상기 생성된 제2 CRC 값을 현재 명령 수신 단계에 상기 마스터 장치에 전송하도록 제어하는 슬레이브 SPI 제어부;를 포함하는 것을 특징으로 한다.An SPIE communication device according to an aspect of the present invention is an SPIE communication device that allows a master device and a slave device to communicate using a SPI (Serial Parallel Interface) protocol, A master CRC generator for generating a first CRC (Cyclical and Redundancy and Check) value for data to be transmitted; A CRC comparison unit for comparing a second CRC value received in the current command transmission step from the slave device with a first CRC value generated in the previous command transmission step; And a master SPI controller for determining whether an error has occurred with respect to data transmitted to the previous command transmission step based on the comparison result of the first and second CRC values, A slave CRC generator for generating a second CRC value for data transmitted in step S6; And a slave SPI controller for controlling to transmit the generated second CRC value to the master device in a current command receiving step.
본 발명에 있어서, 상기 마스터 장치 및 상기 슬레이브 장치는, SPI 프로토콜 방식으로 데이터를 송수신하는 마스터 SPI 인터페이스부 및 슬레이브 SPI 인터페이스부;를 각기 더 포함하는 것을 특징으로 한다.In the present invention, the master device and the slave device may further include a master SPI interface unit and a slave SPI interface unit for transmitting and receiving data in an SPI protocol manner.
본 발명에 있어서, 상기 마스터 장치는, 상기 슬레이브 장치에 데이터 라이트 명령, 혹은 데이터 리드 명령을 전송하는 하는 것을 특징으로 한다.In the present invention, the master device transmits a data write command or a data read command to the slave device.
본 발명에 있어서, 상기 마스터 장치는, 상기 슬레이브 장치에 데이터 라이트 명령의 전송 시, SDI(Serial Data In) 단자를 통해 라이트 명령(Control), 데이터를 라이트 할 슬레이브 장치의 어드레스, 및 데이터를 순차로 조합하여 전송하는 것을 특징으로 한다.In the present invention, the master device may further include a write command (Control) via an SDI (Serial Data In) terminal, an address of a slave device to which data is to be written, and data in order when the data write command is transmitted to the slave device And transmits the combined data.
본 발명에 있어서, 상기 마스터 장치는, 상기 슬레이브 장치에 라이트 리드 명령의 전송 시, SDI(Serial Data In) 단자를 통해 리드 명령(Control), 및 데이터를 리드 할 슬레이브 장치의 어드레스를 순차로 조합하여 전송하는 것을 특징으로 한다.In the present invention, when transferring a write command to the slave device, the master device sequentially combines the read command (Control) via the SDI (Serial Data In) terminal and the address of the slave device to read data .
본 발명에 있어서, 상기 슬레이브 장치로부터 전송되는 제2 CRC 값은, 상기 마스터 장치에서 상기 슬레이브 장치에 전송하는 명령의 어드레스 위치에 동기되어 전송되는 것을 특징으로 한다.In the present invention, a second CRC value transmitted from the slave device is transmitted in synchronization with an address position of a command transmitted from the master device to the slave device.
본 발명에 있어서, 상기 마스터 장치는, 상기 마스터 장치가 이전 명령 전송 단계에서 상기 슬레이브 장치에 전송한 데이터에 대하여 생성한 제1 CRC 값과, 상기 마스터 장치가 현재 명령 전송 단계에서 상기 슬레이브 장치로부터 수신한 제2 CRC 값을 상기 CRC 비교부를 통해 비교하여, 상기 제1,2 CRC 값이 동일하면 에러가 발생하지 않은 것으로 판단하고, 상기 제1,2 CRC 값이 동일하지 않으면 에러가 발생한 것으로 판단하는 것을 특징으로 한다.
In the present invention, the master device may further include: a first CRC value generated by the master device with respect to data transmitted to the slave device in the previous command transmission step; A second CRC value is compared with the first CRC value by the CRC comparison unit, and if the first and second CRC values are the same, it is determined that no error occurs, and if the first and second CRC values are not identical, .
본 발명의 다른 측면에 따른 에스피아이 통신 방법은, 에스피아이 프로토콜 방식으로 마스터 장치와 슬레이브 장치 간에 통신하게 하는 에스피아이 통신 방법에 있어서, 상기 마스터 장치가 마스터 CRC 발생부를 통해 상기 슬레이브 장치에 전송할 데이터에 대한 제1 CRC 값을 생성하는 단계; 상기 슬레이브 장치로부터 현재 명령 전송 단계에서 수신되는 제2 CRC 값과 이전 명령 전송 단계에 생성된 제1 CRC 값을 CRC 비교부를 통해 비교하는 단계; 및 마스터 SPI 제어부를 통해 상기 제1,2 CRC 값의 비교 결과에 기초하여 이전 명령 전송 단계에 전송한 데이터에 대한 에러 발생 여부를 판별하는 단계;를 포함하고, 상기 슬레이브 장치가 상기 마스터 장치로부터 이전 명령 수신 단계에 전송받은 데이터에 대한 제2 CRC 값을 슬레이브 CRC 발생부를 통해 생성하는 단계; 및 슬레이브 SPI 제어부를 통해 상기 생성된 제2 CRC 값을 현재 명령 수신 단계에 상기 마스터 장치에 전송하는 단계;를 포함하는 것을 특징으로 한다.According to another aspect of the present invention, there is provided an ESPC communication method for communicating between a master device and a slave device by using an ESPC protocol, the method comprising: transmitting, by the master device, Generating a first CRC value for the first CRC value; Comparing a second CRC value received in the current command transmission step and a first CRC value generated in the previous command transmission step from the slave device through a CRC comparison unit; And determining whether an error has occurred in the data transmitted to the previous command transmission step based on the comparison result of the first and second CRC values through the master SPI control unit, Generating a second CRC value for the data received in the command receiving step through a slave CRC generator; And transmitting the generated second CRC value to the master device through a slave SPI control unit in a current command receiving step.
본 발명에 있어서, 상기 슬레이브 장치에 데이터 라이트 명령을 전송할 경우, 상기 마스터 장치는, SDI(Serial Data In) 단자를 통해 라이트 명령(Control), 데이터를 라이트 할 슬레이브 장치의 어드레스, 및 데이터를 순차로 조합하여 전송하는 것을 특징으로 한다.In the present invention, when a data write command is transmitted to the slave device, the master device transmits a write command through an SDI (Serial Data In) terminal, an address of the slave device to which data is to be written, And transmits the combined data.
본 발명에 있어서, 상기 슬레이브 장치에 데이터 리드 명령을 전송할 경우, 상기 마스터 장치는, SDI(Serial Data In) 단자를 통해 리드 명령(Control), 및 데이터를 리드 할 슬레이브 장치의 어드레스를 순차로 조합하여 전송하는 것을 특징으로 한다.In the present invention, when a data read command is transmitted to the slave device, the master device sequentially combines the address of the slave device to be read with the read command (Control) through the SDI (Serial Data In) terminal .
본 발명에 있어서, 상기 슬레이브 장치로부터 전송되는 제2 CRC 값은, 상기 마스터 장치에서 상기 슬레이브 장치에 전송하는 명령의 어드레스 위치에 동기되는 것을 특징으로 한다.In the present invention, the second CRC value transmitted from the slave device is synchronized with an address position of a command transmitted from the master device to the slave device.
본 발명에 있어서, 상기 에러 발생 여부를 판별하는 단계에서, 상기 마스터 장치는, 상기 마스터 장치가 이전 명령 전송 단계에서 상기 슬레이브 장치에 전송한 데이터에 대하여 생성한 제1 CRC 값과, 상기 마스터 장치가 현재 명령 전송 단계에서 상기 슬레이브 장치로부터 수신한 제2 CRC 값을 CRC 비교부를 통해 비교하여, 상기 제1,2 CRC 값이 동일하면 에러가 발생하지 않은 것으로 판별하고, 상기 제1,2 CRC 값이 동일하지 않으면 에러가 발생한 것으로 판별하는 것을 특징으로 한다.
In the present invention, in the step of determining whether or not the error has occurred, the master device has a first CRC value generated for the data transmitted to the slave device by the master device in the previous command transmission step, The second CRC value received from the slave device in the current command transmission step is compared through a CRC comparator to determine that no error has occurred if the first and second CRC values are equal to each other, And if it is not the same, it is determined that an error has occurred.
본 발명은 마스터 장치와 슬레이브 장치 간에 에스피아이(SPI) 통신 시 상기 마스터 장치가 상기 슬레이브 장치로 데이터를 송신함과 동시에 상기 슬레이브 장치로부터 씨알씨(CRC) 값을 수신하여 체크함으로써 통신 에러 발생을 빠르게 판별할 수 있도록 한다.
In the SPI communication between a master device and a slave device, the master device transmits data to the slave device, and at the same time receives and checks a CRC value from the slave device, So that it can be identified.
도 1은 본 발명의 일 실시예에 따른 에스피아이 통신 장치의 개략적인 구성을 보인 예시도.
도 2는 상기 도 1에 있어서, 에스피아이 통신 장치의 마스터 장치가 슬레이브 장치에 데이터를 라이트 할 때의 타이밍 차트를 보인 예시도.
도 3은 상기 도 1에 있어서, 에스피아이 통신 장치의 마스터 장치가 슬레이브 장치로부터 데이터를 리드 할 때의 타이밍 차트를 보인 예시도.BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is an exemplary diagram showing a schematic configuration of an SPI communication device according to an embodiment of the present invention; Fig.
Fig. 2 is an exemplary diagram showing a timing chart when the master device of the personal communication device writes data to the slave device in Fig. 1. Fig.
Fig. 3 is an exemplary diagram showing a timing chart when the master device of the personal communication device reads data from the slave device in Fig. 1; Fig.
이하, 첨부된 도면을 참조하여 본 발명에 따른 에스피아이 통신 장치 및 방법의 일 실시예를 설명한다. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, an embodiment of an apparatus and method for communicating with an IP network according to the present invention will be described with reference to the accompanying drawings.
이 과정에서 도면에 도시된 선들의 두께나 구성요소의 크기 등은 설명의 명료성과 편의상 과장되게 도시되어 있을 수 있다. 또한, 후술되는 용어들은 본 발명에서의 기능을 고려하여 정의된 용어들로서 이는 사용자, 운용자의 의도 또는 관례에 따라 달라질 수 있다. 그러므로 이러한 용어들에 대한 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.In this process, the thicknesses of the lines and the sizes of the components shown in the drawings may be exaggerated for clarity and convenience of explanation. In addition, the terms described below are defined in consideration of the functions of the present invention, which may vary depending on the intention or custom of the user, the operator. Therefore, definitions of these terms should be made based on the contents throughout this specification.
도 1은 본 발명의 일 실시예에 따른 에스피아이 통신 장치의 개략적인 구성을 보인 예시도이다.FIG. 1 is an exemplary diagram showing a schematic configuration of an IP communication device according to an embodiment of the present invention.
도 1에 도시된 바와 같이, 본 실시예에 따른 에스피아이 통신 장치는, 마스터 장치(100)와 슬레이브 장치(200)를 포함한다.As shown in FIG. 1, an SPI communication device according to the present embodiment includes a
상기 마스터 장치(100)는 SPI 인터페이스부(110), CRC 발생부(120), SPI 제어부(130), 및 CRC 비교부(131)를 포함하고, 상기 슬레이브 장치(200)는 SPI 인터페이스부(210), CRC 발생부(220), 및 SPI 제어부(230)를 포함한다. The
이때 상기 마스터 장치(100)는 차량 내 전자제어장치(예 : ECU)의 마이크로컨트롤러(미도시)와 연결되어 있을 수 있고, 상기 슬레이브 장치(200)는 차량 내 주변기기(미도시)나 다른 전자제어장치와 연결되어 있을 수 있다.The
상기 마스터 장치(100)의 SPI 인터페이스부(110)는 상기 슬레이브 장치(200)의 SPI 인터페이스부(210)와 SPI 프로토콜을 통해 데이터를 송수신한다.The
상기 마스터 장치(100)의 CRC 발생부(120)는 미리 설정된 임의의 CRC 생성 알고리즘을 이용하여 상기 마이크로컨트롤러(미도시)로부터 상기 SPI 제어부(130)에 입력되는 데이터에 대한 CRC 값을 생성한다.The
상기 마스터 장치(100)의 SPI 제어부(130)는 상기 슬레이브 장치(200)로 전송할 데이터에 대한 CRC 값을 상기 CRC 발생부(120)를 통해 생성하여 상기 CRC 비교부(131)에 순차로 보내 저장한다. The
이때 상기 마스터 장치(100)가 상기 슬레이브 장치(200)에 데이터를 전송한다는 의미는, 상기 슬레이브 장치(200)의 레지스터(또는 내부 메모리)에 어드레스(Address)를 지정하여 상기 데이터를 라이트(Write) 하는 것을 말한다. 상기 데이터 라이트를 위해 상기 마스터 장치(100)는 SDI 단자를 통해 Control 코드(즉, 라이트 명령), 어드레스(데이터를 라이트 할 슬레이브 장치의 어드레스), 및 데이터를 조합하여 전송한다(도 2 참조).The
반대로 상기 마스터 장치(100)가 상기 슬레이브 장치(200)로부터 데이터를 수신한다는 의미는, 상기 슬레이브 장치(200)의 레지스터(또는 내부 메모리)에 어드레스(Address)를 지정하여 그 어드레스에 기록되어 있는 데이터를 리드(Read) 하는 것을 말한다. 상기 데이터 리드를 위해 상기 마스터 장치(100)는 SDI 단자를 통해 Control 코드(즉, 리드 명령), 및 어드레스(데이터를 리드 할 슬레이브 장치의 어드레스)를 조합하여 전송한다(도 3 참조).On the contrary, the
상기 슬레이브 장치(200)의 SPI 인터페이스부(210)는 상기 마스터 장치(100)의 SPI 인터페이스부(110)와 SPI 프로토콜을 통해 데이터를 송수신한다.The
상기 슬레이브 장치(200)의 CRC 발생부(220)는, 미리 설정된 임의의 CRC 생성 알고리즘을 이용하여, 상기 마스터 장치(100)로부터 전송받은 데이터에 대한 CRC 값을 생성한다.The
상기 슬레이브 장치(200)의 SPI 제어부(230)는 상기 마스터 장치(100)로부터 데이터를 전송받으면, 상기 CRC 발생부(220)를 통해 현재 전송받은 데이터에 대한 CRC 값을 생성하여 다음 명령(상기 마스터 장치로부터의 리드 혹은 라이트 명령)에 동기시켜 상기 생성된 CRC 값을 상기 마스터 장치(100)에 전송한다. Upon receipt of the data from the
이때 상기 슬레이브 장치(200)로부터 전송된 CRC 값은 상기 마스터 장치(100)의 SDO 단자를 통해 리드(Read)된다. 다만, 상기 슬레이브 장치(200)로부터 현재 전송받은 CRC 값은 상기 마스터 장치(100)가 이전에 전송한 데이터에 대하여 생성된 CRC 값이다. At this time, the CRC value transmitted from the
다시 말해, 상기 슬레이브 장치(200)는 상기 마스터 장치(100)로부터 수신하는 데이터에 대한 CRC 값을 생성한 후, 상기 마스터 장치(100)로부터의 다음 번 명령(라이드 혹은 리드) 동작에 동기하여 SDO(마스터 장치의 SDO) 전송선로를 통해 SDI(마스터 장치의 SDI)의 어드레스 부분(즉, 위치나 타이밍)에 맞춰 상기 생성한 CRC 값을 상기 마스터 장치(100)로 전송한다(도 2, 3 참조).In other words, the
따라서 상기 마스터 장치(100)는 현재 단계(즉, 현재 명령 단계)의 데이터를 상기 슬레이브 장치(200)에 전송함과 동시에 바로 이전 단계(즉, 이전 명령 단계)에서 전송했던 데이터에 대한 CRC 값을 상기 슬레이브 장치(200)로부터 수신한다.Therefore, the
이에 따라 상기 마스터 장치(100)의 SPI 제어부(130)는 현재 단계에서 수신한 CRC 값(즉, 마스터 장치가 이전 단계에서 슬레이브 장치에 전송한 데이터에 대한 CRC 값)을 상기 CRC 비교부(131)로 전송하고, 상기 CRC 비교부(131)를 통해 상기 마스터 장치(100)의 CRC 발생부(120)가 이전 단계에서 생성하여 보냈던 CRC 값과 비교한다.The
상기 마스터 장치(100)의 SPI 제어부(130)는 상기 CRC 비교부(131)에서의 CRC 값의 비교 결과에 따라, 현재 단계에서 수신한 CRC 값이 이전 단계에서 전송했던 데이터에 대한 CRC 값과 동일하면 데이터 에러가 발생되지 않은 것으로 판단하고, 현재 단계에서 수신한 CRC 값이 이전 단계에서 전송했던 데이터에 대한 CRC 값과 다르면 데이터 에러가 발생된 것으로 판단한다.The
상기와 같이 본 실시예는 상기 마스터 장치(100)가 별도의 CRC 체크 명령을 슬레이브 장치(200)에 출력하지 않고, 상기 마스터 장치(100)가 상기 슬레이브 장치(200)에 데이터를 라이트하거나 리드함과 동시에 상기 슬레이브 장치(200)로부터 이전 단계에 전송했던 데이터에 대한 CRC 값을 전송받아 상기 CRC 값이 정상인지 판단함으로써 실시간에 가깝게 데이터 에러를 체크하여 곧바로 대응할 수 있도록 하는 효과가 있다.As described above, in the present embodiment, the
도 2는 상기 도 1에 있어서, 에스피아이 통신 장치의 마스터 장치가 슬레이브 장치에 데이터를 라이트 할 때의 타이밍 차트를 보인 예시도이고, 도 3은 상기 도 1에 있어서, 에스피아이 통신 장치의 마스터 장치가 슬레이브 장치로부터 데이터를 리드 할 때의 타이밍 차트를 보인 예시도이다.Fig. 2 is an exemplary diagram showing a timing chart when the master device of the personal communication device writes data to the slave device in Fig. 1. Fig. 3 is a timing chart of the master device of the personal communication device Is a timing chart when data is read from the slave device.
도 2를 참조하면, 상기 마스터 장치(100)는 CS 신호를 출력하여 해당 슬레이브 장치(200)를 선택하고, SCLK 클럭에 동기하여, 라이트 명령(Control), 데이터를 라이트 할 어드레스(Address), 및 상기 어드레스에 라이트 할 데이터의 순서로 조합하여 그 결과를 SDI 전송라인을 통해 전송한다. 2, the
이와 동시에 상기 마스터 장치가 이전 단계에 상기 슬레이브 장치(200)로 전송했던 데이터에 대한 CRC 값을 상기 슬레이브 장치(200)로부터 SDO 전송라인을 통해서 수신한다. 이때 상기 슬레이브 장치(200)로부터 전송되는 CRC 값은 상기 마스터 장치(100)가 전송하는 명령(즉, Control, Address, Data가 조합된 명령)의 어드레스 부분에 맞춰 전송된다.At the same time, the master device receives the CRC value of the data transmitted to the
도 3을 참조하면, 상기 마스터 장치(100)는 CS 신호를 출력하여 해당 슬레이브 장치(200)를 선택하고, SCLK 클럭에 동기하여, 리드 명령(Control), 및 데이터를 리드 할 어드레스(Address)의 순서로 조합하여 그 결과를 SDI 전송라인을 통해 전송한다. 3, the
이와 동시에 상기 마스터 장치(100)가 이전 단계에 상기 슬레이브 장치(200)로 전송했던 데이터에 대한 CRC 값을 상기 슬레이브 장치(200)로부터 SDO 전송라인을 통해서 수신한다. 이때 상기 슬레이브 장치(200)로부터 전송되는 CRC 값은 상기 마스터 장치(100)가 전송하는 명령(즉, Control, Address가 조합된 명령)의 어드레스 부분에 맞춰 전송된다. 그리고 상기 CRC 값에 이어서 상기 마스터 장치(100)가 요구한 어드레스에 대응하는 데이터가 전송된다.At the same time, the
이에 따라 상기 마스터 장치(100)의 SPI 제어부(130)는 현재 단계에서 수신한 CRC 값(즉, 마스터 장치가 이전 단계에서 슬레이브 장치에 전송한 데이터에 대한 CRC 값)과 상기 마스터 장치(100)의 CRC 발생부(120)가 이전 단계에서 생성했던 CRC 값을 상기 CRC 비교부(131)를 통해 비교한다. 그리고 상기 CRC 비교부(131)에서의 CRC 값의 비교 결과에 따라, 현재 단계에서 수신한 CRC 값이 이전 단계에서 전송했던 데이터에 대한 CRC 값과 동일하면 데이터 에러가 발생되지 않은 것으로 판단하고, 현재 단계에서 수신한 CRC 값이 이전 단계에서 전송했던 데이터에 대한 CRC 값과 동일하지 않으면 데이터 에러가 발생된 것으로 판단한다.Accordingly, the
상기와 같이 본 실시예는 상기 마스터 장치(100)가 별도의 CRC 체크 명령을 슬레이브 장치(200)에 출력하지 않더라도, 상기 마스터 장치(100)가 상기 슬레이브 장치(200)에 데이터를 라이트하거나 리드함과 동시에 상기 슬레이브 장치(200)로부터 전송받은 상기 CRC 값이 이전 단계에 상기 슬레이브 장치(200)로 전송했던 데이터에 대한 CRC 값과 동일한지 여부에 따라 에러 발생 여부를 판별할 수 있도록 함으로써, 에러 발생을 빠르게 판별하여 대응할 수 있도록 하는 효과가 있다.As described above, even if the
이상으로 본 발명은 도면에 도시된 실시예를 참고로 하여 설명되었으나, 이는 예시적인 것에 불과하며, 당해 기술이 속하는 분야에서 통상의 지식을 가진 자라면 이로부터 다양한 변형 및 균등한 타 실시예가 가능하다는 점을 이해할 것이다. 따라서 본 발명의 기술적 보호범위는 아래의 특허청구범위에 의해서 정하여져야 할 것이다.
While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed embodiments, but, on the contrary, I will understand the point. Accordingly, the technical scope of the present invention should be defined by the following claims.
100 : 마스터 장치
110 : 마스터 장치의 SPI 인터페이스부
120 : 마스터 장치의 CRC 발생부
130 : 마스터 장치의 SPI 제어부
131 : CRC 비교부
200 : 슬레이브 장치
210 : 슬레이브 장치의 SPI 인터페이스부
220 : 슬레이브 장치의 CRC 발생부
230 : 슬레이브 장치의 SPI 제어부100: Master device
110: SPI interface unit of the master device
120: CRC generator of the master device
130: SPI control unit of the master device
131: CRC comparison unit
200: Slave device
210: SPI interface unit of the slave device
220: CRC generator of the slave device
230: SPI control unit of the slave device
Claims (12)
상기 마스터 장치는,
상기 슬레이브 장치에 전송할 데이터에 대한 제1 CRC(Cyclical and Redundancy and Check) 값을 생성하는 마스터 CRC 발생부;
상기 슬레이브 장치로부터 현재 명령 전송 단계에서 수신되는 제2 CRC 값을 이전 명령 전송 단계에 생성된 제1 CRC 값과 비교하는 CRC 비교부; 및
상기 제1,2 CRC 값의 비교 결과에 기초하여 이전 명령 전송 단계에 전송한 데이터에 대한 에러 발생 여부를 판별하는 마스터 SPI 제어부;를 포함하고,
상기 슬레이브 장치는,
상기 마스터 장치로부터 이전 명령 수신 단계에 전송받은 데이터에 대한 제2 CRC 값을 생성하는 슬레이브 CRC 발생부; 및
상기 생성된 제2 CRC 값을 현재 명령 수신 단계에 상기 마스터 장치에 전송하도록 제어하는 슬레이브 SPI 제어부;를 포함하는 것을 특징으로 하는 에스피아이 통신 장치.
An SPIE communication device for communicating between a master device and a slave device using a SPI (Serial Parallel Interface) protocol,
The master device comprises:
A master CRC generator for generating a first cyclic redundancy check (CRC) value for data to be transmitted to the slave device;
A CRC comparison unit for comparing a second CRC value received in the current command transmission step from the slave device with a first CRC value generated in the previous command transmission step; And
And a master SPI controller for determining whether an error has occurred in the data transmitted in the previous command transmission step based on the comparison result of the first and second CRC values,
The slave device includes:
A slave CRC generator for generating a second CRC value for data received in the previous command receiving step from the master device; And
And controlling the slave SPI controller to transmit the generated second CRC value to the master device in a current command reception step.
SPI 프로토콜 방식으로 데이터를 송수신하는 마스터 SPI 인터페이스부 및 슬레이브 SPI 인터페이스부;를 각기 더 포함하는 것을 특징으로 하는 에스피아이 통신 장치.
2. The communication system according to claim 1, wherein the master device and the slave device comprise:
A master SPI interface unit and a slave SPI interface unit for transmitting and receiving data in an SPI protocol manner.
상기 슬레이브 장치에 데이터 라이트 명령, 혹은 데이터 리드 명령을 전송하는 하는 것을 특징으로 하는 에스피아이 통신 장치.
The apparatus according to claim 1,
And a data write command or a data read command to the slave device.
상기 슬레이브 장치에 데이터 라이트 명령의 전송 시,
SDI(Serial Data In) 단자를 통해 라이트 명령(Control), 데이터를 라이트 할 슬레이브 장치의 어드레스, 및 데이터를 순차로 조합하여 전송하는 것을 특징으로 하는 에스피아이 통신 장치.
4. The apparatus according to claim 3,
When transmitting the data write command to the slave device,
And a write command (Control) through an SDI (Serial Data In) terminal, an address of a slave device to which data is to be written, and data are sequentially combined and transmitted.
상기 슬레이브 장치에 라이트 리드 명령의 전송 시,
SDI(Serial Data In) 단자를 통해 리드 명령(Control), 및 데이터를 리드 할 슬레이브 장치의 어드레스를 순차로 조합하여 전송하는 것을 특징으로 하는 에스피아이 통신 장치.
4. The apparatus according to claim 3,
When transmitting a write read command to the slave device,
A read command (Control) via an SDI (Serial Data In) terminal, and an address of a slave device from which data is to be read are successively combined and transmitted.
상기 마스터 장치에서 상기 슬레이브 장치에 전송하는 명령의 어드레스 위치에 동기되어 전송되는 것을 특징으로 하는 에스피아이 통신 장치.
2. The method of claim 1, wherein the second CRC value transmitted from the slave device comprises:
And the master device transmits the information in synchronization with an address position of a command to be transmitted from the master device to the slave device.
상기 마스터 장치가 이전 명령 전송 단계에서 상기 슬레이브 장치에 전송한 데이터에 대하여 생성한 제1 CRC 값과, 상기 마스터 장치가 현재 명령 전송 단계에서 상기 슬레이브 장치로부터 수신한 제2 CRC 값을 상기 CRC 비교부를 통해 비교하여,
상기 제1,2 CRC 값이 동일하면 에러가 발생하지 않은 것으로 판단하고, 상기 제1,2 CRC 값이 동일하지 않으면 에러가 발생한 것으로 판단하는 것을 특징으로 하는 에스피아이 통신 장치.
The apparatus according to claim 1,
A first CRC value generated for the data transmitted to the slave device by the master device in the previous command transmission step and a second CRC value received from the slave device in the current command transmission step by the master device, By comparison,
And determines that an error has not occurred if the first and second CRC values are the same, and determines that an error has occurred if the first and second CRC values are not identical.
상기 마스터 장치가, 마스터 CRC 발생부를 통해 상기 슬레이브 장치에 전송할 데이터에 대한 제1 CRC 값을 생성하는 단계;
상기 슬레이브 장치로부터 현재 명령 전송 단계에서 수신되는 제2 CRC 값과 이전 명령 전송 단계에 생성된 제1 CRC 값을 CRC 비교부를 통해 비교하는 단계; 및
마스터 SPI 제어부를 통해 상기 제1,2 CRC 값의 비교 결과에 기초하여 이전 명령 전송 단계에 전송한 데이터에 대한 에러 발생 여부를 판별하는 단계;를 포함하고,
상기 슬레이브 장치가, 상기 마스터 장치로부터 이전 명령 수신 단계에 전송받은 데이터에 대한 제2 CRC 값을 슬레이브 CRC 발생부를 통해 생성하는 단계; 및
슬레이브 SPI 제어부를 통해 상기 생성된 제2 CRC 값을 현재 명령 수신 단계에 상기 마스터 장치에 전송하는 단계;를 포함하는 것을 특징으로 하는 에스피아이 통신 방법.
1. A method for communicating between a master device and a slave device in an SPIE protocol,
The master device generating a first CRC value for data to be transmitted to the slave device via a master CRC generator;
Comparing a second CRC value received in the current command transmission step and a first CRC value generated in the previous command transmission step from the slave device through a CRC comparison unit; And
And determining whether an error has occurred with respect to data transmitted to the previous command transmission step based on a result of the comparison of the first and second CRC values through the master SPI control unit,
Generating, by the slave CRC generator, a second CRC value for data received in the previous command receiving step from the master device; And
And transmitting the generated second CRC value to the master device via a slave SPI control unit in a current command reception step.
상기 슬레이브 장치에 데이터 라이트 명령을 전송할 경우,
상기 마스터 장치는,
SDI(Serial Data In) 단자를 통해 라이트 명령(Control), 데이터를 라이트 할 슬레이브 장치의 어드레스, 및 데이터를 순차로 조합하여 전송하는 것을 특징으로 하는 에스피아이 통신 방법.
9. The method of claim 8,
When a data write command is transmitted to the slave device,
The master device comprises:
Wherein a write command (Control), an address of a slave device to which data is to be written, and data are successively combined and transmitted through an SDI (Serial Data In) terminal.
상기 슬레이브 장치에 데이터 리드 명령을 전송할 경우,
상기 마스터 장치는,
SDI(Serial Data In) 단자를 통해 리드 명령(Control), 및 데이터를 리드 할 슬레이브 장치의 어드레스를 순차로 조합하여 전송하는 것을 특징으로 하는 에스피아이 통신 방법.
9. The method of claim 8,
When a data read command is transmitted to the slave device,
The master device comprises:
A read command (Control) through an SDI (Serial Data In) terminal, and an address of a slave device from which data is to be read are successively combined and transmitted.
상기 마스터 장치에서 상기 슬레이브 장치에 전송하는 명령의 어드레스 위치에 동기되는 것을 특징으로 하는 에스피아이 통신 방법.
9. The method of claim 8, wherein the second CRC value transmitted from the slave device comprises:
Wherein the master device is synchronized with an address position of a command transmitted from the master device to the slave device.
상기 마스터 장치는,
상기 마스터 장치가 이전 명령 전송 단계에서 상기 슬레이브 장치에 전송한 데이터에 대하여 생성한 제1 CRC 값과, 상기 마스터 장치가 현재 명령 전송 단계에서 상기 슬레이브 장치로부터 수신한 제2 CRC 값을 CRC 비교부를 통해 비교하여,
상기 제1,2 CRC 값이 동일하면 에러가 발생하지 않은 것으로 판별하고, 상기 제1,2 CRC 값이 동일하지 않으면 에러가 발생한 것으로 판별하는 것을 특징으로 하는 에스피아이 통신 방법.9. The method of claim 8, wherein, in the step of determining whether the error occurs,
The master device comprises:
A first CRC value generated for the data transmitted to the slave device by the master device in the previous command transmission step and a second CRC value received from the slave device in the current command transmission step by the master device, By comparison,
Determines that no error has occurred if the first and second CRC values are the same, and determines that an error has occurred if the first and second CRC values are not identical.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020140161326A KR101637998B1 (en) | 2014-11-19 | 2014-11-19 | Communication apparatus and method for serial peripheral interface |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020140161326A KR101637998B1 (en) | 2014-11-19 | 2014-11-19 | Communication apparatus and method for serial peripheral interface |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20160060181A true KR20160060181A (en) | 2016-05-30 |
KR101637998B1 KR101637998B1 (en) | 2016-07-12 |
Family
ID=56505317
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020140161326A KR101637998B1 (en) | 2014-11-19 | 2014-11-19 | Communication apparatus and method for serial peripheral interface |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101637998B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11449381B2 (en) | 2017-12-21 | 2022-09-20 | Lg Energy Solution, Ltd. | Apparatus and method for diagnosing communication fault |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11663100B2 (en) | 2020-06-02 | 2023-05-30 | Analog Devices International Unlimited Company | Serial interface with improved diagnostic coverage |
US11860730B2 (en) | 2021-12-06 | 2024-01-02 | Waymo Llc | Low-overhead, bidirectional error checking for a serial peripheral interface |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120226965A1 (en) * | 2011-03-04 | 2012-09-06 | Infineon Technologies Austria Ag | Reliable Data Transmission with Reduced Bit Error Rate |
JP2013131836A (en) * | 2011-12-20 | 2013-07-04 | Azbil Corp | Serial communication method, communication device, and serial communication system |
-
2014
- 2014-11-19 KR KR1020140161326A patent/KR101637998B1/en active IP Right Grant
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120226965A1 (en) * | 2011-03-04 | 2012-09-06 | Infineon Technologies Austria Ag | Reliable Data Transmission with Reduced Bit Error Rate |
JP2013131836A (en) * | 2011-12-20 | 2013-07-04 | Azbil Corp | Serial communication method, communication device, and serial communication system |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11449381B2 (en) | 2017-12-21 | 2022-09-20 | Lg Energy Solution, Ltd. | Apparatus and method for diagnosing communication fault |
Also Published As
Publication number | Publication date |
---|---|
KR101637998B1 (en) | 2016-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4917671B2 (en) | Data transmission method between master device and slave device | |
JP5258343B2 (en) | Semiconductor device and semiconductor integrated circuit | |
US6982922B2 (en) | Single-clock, strobeless signaling system | |
US8069274B2 (en) | System and method for serial data communications between host and communications devices, and communications device employed in the system and method | |
JP6280359B2 (en) | Programmable controller | |
KR101558687B1 (en) | Serial communication test device, system including the same and method thereof | |
KR101637998B1 (en) | Communication apparatus and method for serial peripheral interface | |
US20060277339A1 (en) | Communication apparatus, switching method, and switching program | |
US8626972B2 (en) | I2C multi-slot circuit system and method for transmitting I2C signals | |
KR100778114B1 (en) | Communication method to improve communication error and electron device to be applied the method | |
US20130258906A1 (en) | Communication configuration and method for debugging, respectively for programming one or more participants of the communication configuration | |
CN109995548B (en) | Device management method and system, data transmission method and system and terminal device | |
US9128831B2 (en) | Electrical device and method of setting address | |
JP5839713B2 (en) | Electronic terminal device and electronic interlocking device | |
US8291270B2 (en) | Request processing device, request processing system, and access testing method | |
JP5279818B2 (en) | Test module, test apparatus and test method | |
KR101703756B1 (en) | Scheduling apparatus of local interconnect network and method thereof | |
US7920433B2 (en) | Method and apparatus for storage device with a logic unit and method for manufacturing same | |
US11700144B2 (en) | Master slave communication system and control method for master slave communication system | |
US8843687B2 (en) | Semiconductor device controlling outbound and inbound path switching sections based on a setting state and controlling method thereof | |
US20160173418A1 (en) | Method and apparatus for transmitting can frame | |
CN117527637B (en) | Method and device for detecting link failure, storage medium and electronic equipment | |
US20230032989A1 (en) | Serial data communication with in-frame response | |
JP5604799B2 (en) | Fault tolerant computer | |
KR102120044B1 (en) | Controller comprising plurality of software levels and operating method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20190625 Year of fee payment: 4 |