KR20220082533A - Serial communication apparatus and method - Google Patents

Serial communication apparatus and method Download PDF

Info

Publication number
KR20220082533A
KR20220082533A KR1020200172511A KR20200172511A KR20220082533A KR 20220082533 A KR20220082533 A KR 20220082533A KR 1020200172511 A KR1020200172511 A KR 1020200172511A KR 20200172511 A KR20200172511 A KR 20200172511A KR 20220082533 A KR20220082533 A KR 20220082533A
Authority
KR
South Korea
Prior art keywords
slave
communication
clock signal
communication line
master device
Prior art date
Application number
KR1020200172511A
Other languages
Korean (ko)
Other versions
KR102430232B1 (en
Inventor
장동온
Original Assignee
현대모비스 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 현대모비스 주식회사 filed Critical 현대모비스 주식회사
Priority to KR1020200172511A priority Critical patent/KR102430232B1/en
Publication of KR20220082533A publication Critical patent/KR20220082533A/en
Application granted granted Critical
Publication of KR102430232B1 publication Critical patent/KR102430232B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4291Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0016Inter-integrated circuit (I2C)
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

더욱 많은 개수의 슬레이브 장치가 마스터 장치와 연결되어 직렬 통신할 수 있는 장치 및 통신 방법이 제공된다. 본 발명의 일 실시예에 따른 직렬 통신 장치는 마스터 장치와 복수의 통신 라인을 형성하여 직렬 통신을 수행하는 복수의 슬레이브 장치; 및 상기 복수의 슬레이브 장치들이 공용으로 이용하는 CS(Chip Select) 통신 라인을 통하여 클럭 신호를 상기 복수의 슬레이브 장치로 송신하고, 상기 복수의 슬레이브 장치 중에서 어느 하나와 통신하기 위한 연산 대상 데이터를 MOSI(Master Output Slave Input) 통신 라인을 통하여 상기 복수의 슬레이브 장치로 송신하여, 상기 클럭 신호와 연산 대상 데이터를 이용하여 연산된 결과 값에 기초로 응답한 슬레이브 장치를 통신 대상 장치인 것으로 식별하고, 상기 식별된 슬레이브 장치와 통신을 수행하는 상기 마스터 장치를 포함한다. 상기 슬레이브 장치는, 상기 CS 통신 라인을 통해서 수신한 상기 클럭 신호의 주파수가 미리 설정된 주파수 범위에 포함되는지 여부를 확인하여 상기 클럭 신호의 이상 유무를 체크할 수 있다.A device and a communication method are provided in which a greater number of slave devices can be connected to a master device for serial communication. A serial communication device according to an embodiment of the present invention includes: a plurality of slave devices for performing serial communication by forming a plurality of communication lines with a master device; and transmits a clock signal to the plurality of slave devices through a Chip Select (CS) communication line commonly used by the plurality of slave devices, and transmits operation target data for communication with any one of the plurality of slave devices. Output Slave Input) transmits to the plurality of slave devices through a communication line, and identifies a slave device that responds based on a result value calculated using the clock signal and calculation target data as a communication target device, and the identified and the master device communicating with the slave device. The slave device may check whether the clock signal is abnormal by checking whether a frequency of the clock signal received through the CS communication line is included in a preset frequency range.

Description

직렬 통신 장치 및 방법{SERIAL COMMUNICATION APPARATUS AND METHOD}SERIAL COMMUNICATION APPARATUS AND METHOD

본 발명은 확장에 용이한 직렬 통신 장치 및 방법에 관한 것이다. 보다 자세하게는, 더욱 많은 개수의 슬레이브 장치가 마스터 장치와 연결되어 직렬 통신할 수 있는 장치 및 통신 방법에 관한 것이다.The present invention relates to a serial communication device and method that is easy to expand. More particularly, it relates to a device and a communication method capable of serial communication by connecting a greater number of slave devices to a master device.

SPI(Serial Peripheral Interface)는 4개의 통신 라인(line)을 이용하여 전이중 동기식 통신을 수행하는 방식이다. 상기 SPI에 마스터 장치와 복수의 슬레이브 장치로 구분되는데, 마스터 장치는 슬레이브 장치와 4개의 통신 라인을 형성한다. 즉, 마스터 장치와 슬레이브 장치 간에는 CS(Chip Select) 통신 라인, SCK(SPI Clock) 통신 라인, MOSI(Master Output Slave Input) 통신 라인, MISO(Master Input Slave Output) 통신 라인과 같이 4개의 통신 라인이 형성된다.SPI (Serial Peripheral Interface) is a method of performing full-duplex synchronous communication using four communication lines. The SPI is divided into a master device and a plurality of slave devices, and the master device forms four communication lines with the slave device. That is, there are four communication lines between the master device and the slave device: a CS (Chip Select) communication line, an SCK (SPI Clock) communication line, a MOSI (Master Output Slave Input) communication line, and a MISO (Master Input Slave Output) communication line. is formed

상기 SCK 통신 라인, MOSI 통신 라인, MISO 통신 라인은, 복수의 슬레이브 장치에서 공통으로 사용될 수 있다. 그런데 CS 통신 라인은 마스터 장치와 하나의 슬레이브 장치에만 연결되어 독립된 전용 라인으로 이용된다. 이에 따라, 슬레이브 장치의 개수만큼 CS 통신 라인이 구축되어야 한다.The SCK communication line, the MOSI communication line, and the MISO communication line may be commonly used in a plurality of slave devices. However, the CS communication line is connected only to the master device and one slave device and is used as an independent dedicated line. Accordingly, as many CS communication lines as the number of slave devices must be established.

그런데 새로운 슬레이브 장치를 추가하고자 할 때, 마스터 장치에서부터 연결할 수 있는 CS 통신 라인을 부족하면, 더 이상의 슬레이브 장치를 추가로 연결할 수 없게 되는 문제가 발생한다. 이 경우, 마스터 장치에 새로운 CS 핀을 추가해야 되는 등의 마스터 장치의 설계 변경이 필요하다. 그런데 이러한 마스터 장치의 설계 변경은 시간과 비용을 많이 필요하다.However, when adding a new slave device, if the CS communication line that can be connected from the master device is insufficient, there is a problem that additional slave devices cannot be connected. In this case, it is necessary to change the design of the master device, such as adding a new CS pin to the master device. However, such a design change of the master device requires a lot of time and money.

한국공개특허 제10-2001-0084862호 (2001.09.06)Korea Patent Publication No. 10-2001-0084862 (2001.09.06)

본 발명이 해결하고자 하는 기술적 과제는, 마스터 장치의 물리적인 설계 변경 없이 보다 많은 개수의 슬레이브 장치가 마스터 장치에 연결되어 직렬 통신할 수 있는 직렬 통신 장치 및 방법을 제공하는데 있다.The technical problem to be solved by the present invention is to provide a serial communication device and method capable of serial communication by connecting a greater number of slave devices to the master device without changing the physical design of the master device.

본 발명이 해결하고자 하는 다른 기술적 과제는, 마스터 장치의 클럭 신호의 에러를 검증하여 안정적으로 직렬 통신을 수행하는 직렬 통신 장치 및 방법을 제공하는데 있다.Another technical problem to be solved by the present invention is to provide a serial communication device and method for stably performing serial communication by verifying an error in a clock signal of a master device.

본 발명이 해결하고자 하는 또 다른 기술적 과제는, CS 통신 라인을 공용으로 이용하더라도 데이터 충돌 없이 직렬 통신을 수행하게 하는 직렬 통신 장치 및 방법을 제공하는데 있다.Another technical problem to be solved by the present invention is to provide a serial communication device and method for performing serial communication without data collision even when a CS communication line is commonly used.

본 발명의 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급되지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 발명의 기술분야에서의 통상의 기술자에게 명확하게 이해 될 수 있을 것이다.The technical problems of the present invention are not limited to the technical problems mentioned above, and other technical problems not mentioned will be clearly understood by those skilled in the art from the following description.

상기 기술적 과제를 해결하기 위한, 본 발명의 일 실시예에 따른 직렬 통신 장치는, 마스터 장치와 복수의 통신 라인을 형성하여 직렬 통신을 수행하는 복수의 슬레이브 장치; 및 상기 복수의 슬레이브 장치들이 공용으로 이용하는 CS(Chip Select) 통신 라인을 통하여 클럭 신호를 상기 복수의 슬레이브 장치로 송신하고, 상기 복수의 슬레이브 장치 중에서 어느 하나와 통신하기 위한 연산 대상 데이터를 MOSI(Master Output Slave Input) 통신 라인을 통하여 상기 복수의 슬레이브 장치로 송신하여, 상기 클럭 신호와 연산 대상 데이터를 이용하여 연산된 결과 값에 기초로 응답한 슬레이브 장치를 통신 대상 장치인 것으로 식별하고, 상기 식별된 슬레이브 장치와 통신을 수행하는 상기 마스터 장치를 포함할 수 있다. In order to solve the above technical problem, a serial communication device according to an embodiment of the present invention includes: a plurality of slave devices for performing serial communication by forming a plurality of communication lines with a master device; and transmits a clock signal to the plurality of slave devices through a Chip Select (CS) communication line commonly used by the plurality of slave devices, and transmits operation target data for communication with any one of the plurality of slave devices. Output Slave Input) transmits to the plurality of slave devices through a communication line, and identifies a slave device that responds based on a result value calculated using the clock signal and calculation target data as a communication target device, and the identified It may include the master device communicating with the slave device.

일 실시예에서, 상기 슬레이브 장치는, 상기 CS 통신 라인을 통해서 수신한 상기 클럭 신호의 주파수가 미리 설정된 주파수 범위에 포함되는지 여부를 확인하여 상기 클럭 신호의 이상 유무를 체크할 수 있다.In an embodiment, the slave device may check whether the clock signal is abnormal by checking whether a frequency of the clock signal received through the CS communication line is included in a preset frequency range.

다른 실시예에서, 상기 슬레이브 장치는 상기 클럭 신호를 분주하고, 상기 분주된 클럭 신호가 상기 미리 설정된 주파수 범위에 포함되는지 여부를 확인하여 상기 클럭 신호의 이상 유무를 체크할 수 있다.In another embodiment, the slave device may check whether the clock signal is abnormal by dividing the clock signal and checking whether the divided clock signal is included in the preset frequency range.

몇몇 실시예에서, 상기 슬레이브 장치는 상기 클럭 신호의 이상이 체크된 경우, 클럭 에러를 나타내는 코드를 MISO(Master Input Slave Output) 통신 라인을 통해서 상기 마스터 장치로 송신할 수 있다.In some embodiments, when an abnormality of the clock signal is checked, the slave device may transmit a code indicating a clock error to the master device through a Master Input Slave Output (MISO) communication line.

상기 슬레이브 장치는 상기 연산 대상 데이터를 미리 설정된 논리 연산자를 이용하여 연산하고 연산된 결과값이 보유중인 정보에 부합되는 경우에, 상기 마스터 장치로 응답하여 상기 마스터 장치와 통신할 수 있다.The slave device may communicate with the master device in response to the master device when the operation target data is calculated using a preset logical operator and the calculated result matches the retained information.

상기 마스터 장치는 통신 성립을 위한 장치 선택 주기 동안에, 클럭 신호를 상기 복수의 슬레이브 장치로 송신하고, 상기 연산 대상 데이터를 상기 복수의 슬레이브 장치로 송신할 수 있다.The master device may transmit a clock signal to the plurality of slave devices and transmit the operation target data to the plurality of slave devices during a device selection period for establishing communication.

상기 기술적 과제를 해결하기 위한 본 발명의 다른 실시예에 따른 슬레이브 장치가 마스터 장치와 직렬 통신을 수행하는 방법은, CS(Chip Select) 통신 라인을 통하여 클럭 신호를 마스터 장치로부터 수신하고, MOSI(Master Output Slave Input) 통신 라인을 통하여 연산 대상 데이터를 상기 마스터 장치로부터 수신하는 단계; 상기 클럭 신호를 기초하여 상기 MOSI 통신 라인을 통해서 수신되는 연산 대상 데이터를 획득하고, 상기 연산 대상 데이터를 기초로 연산 결과값을 획득하는 단계; 및 상기 연산 결과값이 미리 저장중인 정보에 부합되면 상기 마스터 장치와 통신을 수행하는 단계를 포함할 수 있다.In a method for a slave device to perform serial communication with a master device according to another embodiment of the present invention for solving the above technical problem, a clock signal is received from the master device through a CS (Chip Select) communication line, and MOSI (Master Output Slave Input) receiving operation target data from the master device through a communication line; obtaining operation target data received through the MOSI communication line based on the clock signal, and obtaining an operation result value based on the operation target data; and performing communication with the master device when the result of the calculation matches information being stored in advance.

도 1은 본 발명의 일 실시예에 따른 직렬 통신 장치를 나타내는 도면이다.
도 2는 도 1에 개시된 마스터 장치와 슬레이브 장치 간에 형성된 통신 라인을 나타내는 도면이다.
도 3은 연산 대상 데이터와 연산 결과를 예시하는 도면이다.
도 4는 각각의 통신 라인에서 발생하는 신호를 예시하는 도면이다.
도 5는 비정상적으로 확인된 클럭 신호를 예시하는 도면이다.
도 6은 본 발명의 또 다른 실시예에 따른, 슬레이브 장치에서 직렬 통신을 수행하는 방법을 설명하는 흐름도이다.
1 is a diagram illustrating a serial communication device according to an embodiment of the present invention.
FIG. 2 is a diagram illustrating a communication line formed between the master device and the slave device disclosed in FIG. 1 .
3 is a diagram illustrating calculation target data and calculation results.
4 is a diagram illustrating a signal generated in each communication line.
5 is a diagram illustrating an abnormally confirmed clock signal.
6 is a flowchart illustrating a method of performing serial communication in a slave device according to another embodiment of the present invention.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예들을 상세히 설명한다. 본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시 예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 게시되는 실시 예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시 예들은 본 발명의 게시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. Advantages and features of the present invention, and a method for achieving them will become apparent with reference to the embodiments described below in detail in conjunction with the accompanying drawings. However, the present invention is not limited to the embodiments published below, but may be implemented in various different forms, and only these embodiments allow the publication of the present invention to be complete, and common knowledge in the technical field to which the present invention pertains It is provided to fully inform the possessor of the scope of the invention, and the present invention is only defined by the scope of the claims. Like reference numerals refer to like elements throughout.

다른 정의가 없다면, 본 명세서에서 사용되는 모든 용어(기술 및 과학적 용어를 포함)는 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 공통적으로 이해될 수 있는 의미로 사용될 수 있다. 또 일반적으로 사용되는 사전에 정의되어 있는 용어들은 명백하게 특별히 정의되어 있지 않는 한 이상적으로 또는 과도하게 해석되지 않는다. 본 명세서에서 사용된 용어는 실시예들을 설명하기 위한 것이며 본 발명을 제한하고자 하는 것은 아니다. 본 명세서에서, 단수형은 문구에서 특별히 언급하지 않는 한 복수형도 포함한다.Unless otherwise defined, all terms (including technical and scientific terms) used herein may be used with the meaning commonly understood by those of ordinary skill in the art to which the present invention belongs. In addition, terms defined in a commonly used dictionary are not to be interpreted ideally or excessively unless clearly defined in particular. The terminology used herein is for the purpose of describing the embodiments and is not intended to limit the present invention. In this specification, the singular also includes the plural unless specifically stated otherwise in the phrase.

이하, 도면들을 참조하여 본 발명의 몇몇 실시예들을 설명한다.Hereinafter, some embodiments of the present invention will be described with reference to the drawings.

도 1은 본 발명의 일 실시예에 따른 직렬 통신 장치를 나타내는 도면이다.1 is a diagram illustrating a serial communication device according to an embodiment of the present invention.

도 2는 도 1에 개시된 마스터 장치와 슬레이브 장치 간에 형성된 통신 라인을 나타내는 도면이다.FIG. 2 is a diagram illustrating a communication line formed between the master device and the slave device disclosed in FIG. 1 .

도 1 및 도 2에 도시된 바와 같이, 본 발명의 일 실시예에 따른 직렬 통신 장치(100)는 적어도 하나의 마스터 장치(110)와 복수의 슬레이브 장치(120-N)를 포함할 수 있고, 상기 마스터 장치(110)와 상기 복수의 슬레이브 장치(120-N)는 SPI 기반의 직렬 통신을 수행할 수 있다. 상기 마스터 장치(110)는 통신하고자 하는 슬레이브 장치(120-N)를 선택하고, 상기 선택된 슬레이브 장치(120-N)와 직렬 통신을 수행할 수 있다. 1 and 2, the serial communication device 100 according to an embodiment of the present invention may include at least one master device 110 and a plurality of slave devices 120-N, The master device 110 and the plurality of slave devices 120 -N may perform SPI-based serial communication. The master device 110 may select a slave device 120 -N with which to communicate, and may perform serial communication with the selected slave device 120 -N.

마스터 장치(110)와 각각의 슬레이브 장치(120-N) 간에는 복수의 통신 라인이 형성될 수 있다. 복수의 통신 라인으로서, 4개의 통신 라인이 마스터 장치(110)와 슬레이브 장치(120-N) 간에 형성될 수 있다. 일 실시예로서, 제1 통신 라인으로서 CS(Chip Select) 통신 라인, 제2 통신 라인으로서 MOSI(Master Output Slave Input) 통신 라인, 제3 통신 라인으로서 MISO(Master Input Slave Output) 통신 라인 및 제4 통신 라인으로서 SCK(SPI Clock) 통신 라인이 마스터 장치(110)와 슬레이브 장치(120-N) 간에 형성될 수 있다. A plurality of communication lines may be formed between the master device 110 and each of the slave devices 120 -N. As a plurality of communication lines, four communication lines may be formed between the master device 110 and the slave device 120 -N. As an embodiment, a CS (Chip Select) communication line as a first communication line, a MOSI (Master Output Slave Input) communication line as a second communication line, a MISO (Master Input Slave Output) communication line as a third communication line, and a fourth communication line As a communication line, an SCK (SPI Clock) communication line may be formed between the master device 110 and the slave device 120 -N.

MOSI 통신 라인, MISO 통신 라인, SCK 통신 라인 각각은 각각의 슬레이브 장치(120-N)로 분기되어, 각각 슬레이브 장치(120-N)가 공용으로 이용할 수 있다. Each of the MOSI communication line, the MISO communication line, and the SCK communication line is branched to each slave device 120-N, and each of the slave devices 120-N can use it in common.

상기 MOSI 통신 라인은 마스터 장치(110)에서 송신되어 슬레이브 장치(120-N)가 수신하는 데이터가 경유하는 통신 라인이다. The MOSI communication line is a communication line through which data transmitted from the master device 110 and received by the slave device 120-N passes.

상기 MISO 통신 라인은 슬레이브 장치(120-N)에서 송신되어 마스터 장치(110)가 수신하는 데이터가 경유하는 통신 라인이다.The MISO communication line is a communication line through which data transmitted from the slave device 120-N and received by the master device 110 passes.

SCK 통신 라인은 MOSI 통신 라인과 MISO 통신 라인에서 송수신되는 데이터를 동기화하기 위한 SPI 클럭 신호가 경유하는 통신 라인이다. SPI 클럭 신호는 후술하는 장치 선택 기간 동안에는 발생되지 않고, 데이터 전송 기간 동안에 마스터 장치(110)에서 생성되어 각각의 슬레이브 장치(120-N)로 송신될 수 있다. 여기서, 장치 선택 기간은 실질적인 데이터가 전송되기 전에 슬레이브 장치(120-N)를 선택하기 위해서 시간으로서, 상기 데이터 전송 기간 전에 상기 장치 선택에 따른 프로세스가 마스터 장치(110)와 슬레이브 장치(120-N) 간에 진행될 수 있다.The SCK communication line is a communication line through which the SPI clock signal for synchronizing data transmitted and received between the MOSI communication line and the MISO communication line passes. The SPI clock signal may not be generated during the device selection period to be described later, but may be generated in the master device 110 during the data transmission period and transmitted to each slave device 120 -N. Here, the device selection period is a time for selecting the slave device 120-N before actual data is transmitted, and the process according to the device selection before the data transmission period is performed between the master device 110 and the slave device 120-N. ) can progress between

CS 통신 라인이 슬레이브 확장에 이용되지 않은 경우에, 상기 CS 통신 라인은 특정 슬레이브 장치(120-N)에게만 단독으로 사용할 수 있다. 반면에, CS 통신 라인이 확장에 이용되는 경우, 상기 CS 통신 라인은 복수의 슬레이브 장치(120-N)로 분기되어 2개 이상의 슬레이브 장치(120-N)가 공통으로 이용할 수 있다. When the CS communication line is not used for slave extension, the CS communication line can be used exclusively for a specific slave device 120 -N. On the other hand, when the CS communication line is used for expansion, the CS communication line is branched into a plurality of slave devices 120 -N and can be commonly used by two or more slave devices 120 -N.

도 2를 예를 들어 설명하면, 제1 슬레이브 장치(120-1)와 제2 슬레이브 장치(120-2) 각각은 CS 통신 라인을 공유하지 않고, 자신만 사용할 수 있은 전용의 CS 통신 라인을 마스터 장치(110)와 형성할 수 있다. 한편, 제3 슬레이브 장치(120-3)와 제4 슬레이브 장치(120-4)는 CS 통신 라인을 공유한다. 즉, 마스터 장치(110)에서 3번째 채널에 형성하는 CS 통신 라인은 a 지점에서 분기되어 제4 슬레이브 장치(120-N)로도 연결될 수 있다. 슬레이브 확장에 이용되고 더불어 복수의 슬레이브 장치(120-3, 120-4)가 공유하는 CS 통신 라인은 도 2에서 참조 부호 11로 예시하고 있다. 부연하면, 도 2에서는 제1 슬레이브 장치(120-1), 제2 슬레이브 장치(120-2) 각각이 단독으로 이용하는 CS 통신 라인은 확장에 이용되지 않으나, 제3 슬레이브 장치(120-3)에서 이용하는 CS 통신 라인(11)은 제4 슬레이브 장치(120-4)에게 공유됨으로써 확장에 이용되고 있다.2 as an example, each of the first slave device 120-1 and the second slave device 120-2 does not share a CS communication line and masters a dedicated CS communication line that can only be used by itself. It can be formed with the device 110 . Meanwhile, the third slave device 120 - 3 and the fourth slave device 120 - 4 share a CS communication line. That is, the CS communication line formed in the third channel in the master device 110 may be branched at point a and also connected to the fourth slave device 120 -N. A CS communication line used for slave extension and shared by a plurality of slave devices 120-3 and 120-4 is exemplified by reference numeral 11 in FIG. 2 . In other words, in FIG. 2 , the CS communication line used exclusively by the first slave device 120-1 and the second slave device 120-2 is not used for expansion, but in the third slave device 120-3 The used CS communication line 11 is used for expansion by being shared with the fourth slave device 120-4.

기존에는 전용 CS 통신 라인 개수만큼 슬레이브 장치가 연결될 수 있었으나, 본 실시예에 따르면 추가되는 슬레이브 장치가 이미 형성된 SCK 통신 라인, MOSI 통신 라인 및 MISO 통신 라인을 연결되어 세 개의 통신 라인을 공통으로 사용할 뿐만 아니라, CS 통신 라인도 공통으로 사용할 수 있다. 이에 따라, CS 통신 라인이 복수의 슬레이브 장치(120-N)로 분기될 수 있어, 마스터 장치(110)에 추가적인 핀을 생성하지 않고도 더욱 많은 개수의 슬레이브 장치(120-N)가 마스터 장치(110)로 연결될 수 있다. In the past, as many slave devices as the number of dedicated CS communication lines could be connected, according to this embodiment, the SCK communication line, the MOSI communication line, and the MISO communication line, in which the additional slave devices are already formed, are connected to use the three communication lines in common. Instead, the CS communication line can also be used in common. Accordingly, the CS communication line can be branched to a plurality of slave devices 120-N, so that a greater number of slave devices 120-N can be connected to the master device 110 without creating additional pins in the master device 110 . ) can be connected.

하나의 CS 통신 라인(11)을 공유하고 있는 슬레이브 장치들 중에서 어느 하나를 선택하기 위하여, 마스터 장치(110)는 슬레이브 장치(120-N)로 연산을 위한 클럭 신호 및 통신 대상을 특정하기 위한 연산 대상 데이터를 송신할 수 있다. 일 실시예에서, 하나의 CS 통신 라인을 복수의 슬레이브 장치(120-3, 120-4)가 공유하는 경우, 마스터 장치(110)는 장치 선택 기간 동안에 상기 CS 통신 라인(11)을 통하여, 연산을 위한 클럭 신호를 제3 슬레이브 장치(120-N)와 제4 슬레이브 장치(120-N)로 송신할 수 있다. 또한, 마스터 장치(110)는 제3 슬레이브 장치(120-N)와 제4 슬레이브 장치(120-N) 중에서 통신 대상으로 선택된 슬레이브 장치를 확인하고, 상기 선택된 슬레이브 장치와 관련된 연산 대상 데이터를 확인한 후, MOSI 통신 라인을 통하여 상기 연산 대상 데이터를 각각의 슬레이브 장치(120-N)로 송신할 수 있다. 상기 연산 대상 데이터는 상기 선택된 슬레이브 장치에서 보유중인 정보와 부합되는 결과값을 도출하는데 관련되는 데이터일 수 있다. 상기 연산 대상 데이터는 소정 개수에 해당하는 복수의 비트일 수 있다. 상기 비트의 개수에 비례하여, 확장 가능한 슬레이브 장치(120-N)의 개수도 늘어날 수 있다.In order to select any one of the slave devices sharing one CS communication line 11, the master device 110 performs an operation to specify a clock signal for operation and a communication target to the slave device 120-N. Target data can be transmitted. In one embodiment, when a plurality of slave devices 120-3 and 120-4 share one CS communication line, the master device 110 operates through the CS communication line 11 during the device selection period. A clock signal for , may be transmitted to the third slave device 120 -N and the fourth slave device 120 -N. In addition, the master device 110 checks a slave device selected as a communication target among the third slave device 120-N and the fourth slave device 120-N, and checks the calculation target data related to the selected slave device. , the operation target data may be transmitted to each slave device 120 -N through the MOSI communication line. The calculation target data may be data related to deriving a result value consistent with information held by the selected slave device. The operation target data may be a plurality of bits corresponding to a predetermined number. In proportion to the number of bits, the number of expandable slave devices 120 -N may also increase.

마스터 장치(110)는 상기 연산을 위한 클럭 신호와 연산 대상 데이터를 기초로 응답한 슬레이브 장치(120-N)를 통신 대상 장치로서 식별하고, 상기 식별한 슬레이브 장치(120-N)와 와 SPI 기반의 직렬 통신을 수행할 수 있다. 상기 응답은 MISO 통신 라인을 통해서 수신될 수 있으며, 상기 연산 대상 데이터를 기초로 슬레이브 장치(120-N)에서 연산한 결과값일 수 있다. 마스터 장치(110)는 상기 결과값이 정확한지 여부를 검증하여, 정확한 경우에 상기 응답을 송신한 슬레이브 장치(120-N)와 통신하고, 상기 응답이 정확하지 않으면 응답을 송신하는 슬레이브 장치(120-N)에 장애가 발생한 것으로 판단하여, 상기 슬레이브 장치(120-N)와 통신을 진행하는 것을 보류할 수 있다. 상기 마스터 장치(110)는 MCU(microcontroller unit) 등과 같은 프로세서일 수 있다. The master device 110 identifies the slave device 120-N responding based on the clock signal for the calculation and the calculation target data as the communication target device, and the identified slave device 120-N and SPI based serial communication can be performed. The response may be received through the MISO communication line, and may be a result value calculated by the slave device 120-N based on the operation target data. The master device 110 verifies whether the result value is correct, communicates with the slave device 120-N that has transmitted the response if it is correct, and transmits the response if the response is not correct. It is determined that a failure has occurred in N), and communication with the slave device 120 -N may be suspended. The master device 110 may be a processor such as a microcontroller unit (MCU).

한편, 마스터 장치(110)는 MISO 통신 라인을 통해서, 상기 클럭 신호에 에러가 있음을 나타내는 에러 코드를 슬레이브 장치(120-N)로부터 수신할 수 있다. 이 경우, 마스터 장치(110)는 직렬 통신 장치(100)에 에러가 발생한 것으로 판단하여, 에러 메시지를 출력할 수 있다. 이때, 마스터 장치(110)는 에러 메시지를 디스플레이 수단 등에 출력할 수 있다. Meanwhile, the master device 110 may receive an error code indicating that there is an error in the clock signal from the slave device 120 -N through the MISO communication line. In this case, the master device 110 may determine that an error has occurred in the serial communication device 100 and output an error message. In this case, the master device 110 may output an error message to a display means or the like.

마스터 장치(110)는 응답한 슬레이브 장치(120-N)와 통신을 수행하면, SCK 통신 라인을 통해서 SPI 클럭을 각각의 슬레이브 장치(120-N)로 송신하고, MOSI 통신 라인으로 통해서 해당 슬레이브 장치(120-N)로 데이터를 송신하고, MISO 통신 라인을 통해서 해당 슬레이브 장치(120-N)로부터 수신할 수 있다. When the master device 110 communicates with the responding slave device 120-N, it transmits the SPI clock to each slave device 120-N through the SCK communication line, and the corresponding slave device through the MOSI communication line. Data can be transmitted to (120-N) and received from the corresponding slave device (120-N) through the MISO communication line.

CS 통신 라인(11)을 공통으로 이용중인 슬레이브 장치(120-3, 120-4)는 CS 통신 라인에서 클럭 신호가 발생하면 장치 선택 기간중임을 인식하여, MOSI 통신 라인을 통해서 수신되는 연산 대상 데이터를 확인하고, 상기 연산 대상 데이터를 기초로 연산을 수행하여 결과값을 획득할 수 있다. 일 실시예로서, 상기 슬레이브 장치(120-N)는 상기 연산 대상 데이터를 미리 설정된 연산 방식에 대입하여, 연산을 수행하여 상기 결과값을 획득할 수 있다. 상기 연산 대상 데이터는 소정 개수의 비트일 수 있으며, 상기 연산 방식은 하나 이상의 논리 연산자를 이용한 연산 방식일 수 있다. 상기 연산 방식에서 미리 저장된 데이터와 상기 연산 대상 데이터가 상기 하나 이상의 논리 연산자에 의해서 연산될 수 있다. 상기 논리 연산자로서, XOR, OR, AND, NOR 등 중에서 하나 이상이 이용될 수 있다.When a clock signal is generated from the CS communication line, the slave devices 120-3 and 120-4 using the CS communication line 11 in common recognize that the device selection period is in progress, and the operation target data received through the MOSI communication line. may be checked, and a result may be obtained by performing an operation based on the operation target data. As an embodiment, the slave device 120 -N may obtain the result value by performing an operation by substituting the operation target data into a preset operation method. The operation target data may be a predetermined number of bits, and the operation method may be an operation method using one or more logical operators. In the calculation method, the previously stored data and the calculation target data may be calculated by the one or more logical operators. As the logical operator, one or more of XOR, OR, AND, NOR, and the like may be used.

도 3은 연산 대상 데이터와 연산 결과를 예시하는 도면이다. 3 is a diagram illustrating calculation target data and calculation results.

도 3에 예시된 바와 같이, 연산 대상 데이터의 값에 따라 연산 결과 값이 달라질 수 있다. 즉, 연산 대상 데이터에 따라 연산 결과 값이 서로 상이할 수 있다. 연산 대상 데이터에 따라 서로 상이한 연산 결과가 나타날 수 있도록 상기 연산 방식이 설정될 수 있다. As illustrated in FIG. 3 , the calculation result value may vary according to the value of the calculation target data. That is, calculation result values may be different depending on the calculation target data. The calculation method may be set so that different calculation results may appear according to calculation target data.

도 3를 예를 들어 설명하면, 연산 대상 데이터가, '000'이면, 슬레이브 장치(120-N)는 연산 결과값으로서 '011'을 획득할 수 있으며, 연산 대상 데이터가 '101'인 경우, 슬레이브 장치(120-N)는 연산 결과로서 '010'을 획득할 수 있다. 3 as an example, if the calculation target data is '000', the slave device 120-N may obtain '011' as the calculation result value, and when the calculation target data is '101', The slave device 120 -N may obtain '010' as a result of the operation.

슬레이브 장치(120-N)는 연산 결과값이 이미 보유중인 정보와 부합되는지 여부를 확인하여 부합되면, MISO 통신 라인을 이용하여 마스터 장치(110)로 응답을 송신하여, 마스터 장치(110)와 통신을 수행할 수 있다. 이때, 슬레이브 장치(120-N)는 SCK 통신 라인을 통해서, 수신되는 SPI 클럭을 통해서 마스터 장치(110)와 동기화를 되고, MOSI 통신 라인을 통해서 데이터를 마스터 장치(110)로부터 수신하고, MISO 통신 라인을 통해서 데이터를 마스터 장치(110)로 송신할 수 있다. 상기 슬레이브 장치(120-N)는 전원 반도체, 구동 반도체, 센서 반도체, EEPROM(electrically erasable programmable ROM) 등일 수 있다.The slave device (120-N) checks whether the operation result matches the information already held, and if it matches, transmits a response to the master device 110 using the MISO communication line, and communicates with the master device 110 can be performed. At this time, the slave device 120-N is synchronized with the master device 110 through the SPI clock received through the SCK communication line, and receives data from the master device 110 through the MOSI communication line, and MISO communication Data may be transmitted to the master device 110 through the line. The slave device 120 -N may be a power semiconductor, a driving semiconductor, a sensor semiconductor, an electrically erasable programmable ROM (EEPROM), or the like.

한편, 슬레이브 장치(120-N)는 연산 결과값이 이미 보유중인 정보와 부합되는지 않으면, 응답을 마스터 장치(110)로 송신하지 않고 마스터 장치(110)로 반응하지 않을 수 있다. 이 경우, 슬레이브 장치(120-N)는 MOSI를 통해서 마스터 장치(110)로부터 수신되는 데이터를 무시할 수 있다. 상기 부합되는 것은, 연산한 결과값이 상기 슬레이브 장치(120-N)가 보유중인 정보와 일치하거나, 상기 보유중인 정보의 일부분에 해당하는 것일 수 있다. On the other hand, the slave device 120 -N may not respond to the master device 110 without transmitting a response to the master device 110 if the calculation result does not match the information already held. In this case, the slave device 120 -N may ignore data received from the master device 110 through the MOSI. The matching may mean that the calculated result value matches the information held by the slave device 120 -N or corresponds to a part of the held information.

일 실시예에서, 보유중인 정보는 슬레이브 장치(120-N)의 식별정보일 수 있으며, 상기 슬레이브 장치(120-N)는 상기 연산한 결과값이 자신의 식별정보와 부합되는 경우에 MISO 통신 라인을 통해서, 응답을 마스터 장치(110)로 송신할 수 있다. In an embodiment, the retained information may be identification information of the slave device 120-N, and when the calculated result value matches its own identification information, the slave device 120-N uses the MISO communication line Through , a response may be transmitted to the master device 110 .

몇몇 실시예에서, 상기 슬레이브 장치(120-N)는 상기 응답으로서, 상기 연산된 결과값을 마스터 장치(110)로 송신할 수 있으며, 이 경우 마스터 장치(110)에서 상기 연산된 결과값에 대한 검증이 수행되어 검증에 성공되면 마스터 장치(110)와 직렬 통신을 수행할 수 있다.In some embodiments, the slave device 120-N may transmit the calculated result value to the master device 110 as the response. In this case, the master device 110 responds to the calculated result value. If the verification is performed and the verification is successful, serial communication with the master device 110 may be performed.

도 4는 각각의 통신 라인에서 발생하는 신호를 예시하는 도면이다.4 is a diagram illustrating a signal generated in each communication line.

도 4에서는, 참조부호'T1'가 장치 선택 기간에 해당하는 구간을 나타내는 것을 예시하고 있다. 도 4에 예시된 바와 같이, 상기 장치 선택 기간(T1) 동안에, 마스터 장치(110)를 통해서 CS 통신 라인에 클럭 신호가 발생될 수 있으며, MOSI 통신 라인에 소정 개수 비트의 연산 대상 데이터가 발생될 수 있다. In FIG. 4, reference numeral 'T1' exemplifies a section corresponding to the device selection period. As illustrated in FIG. 4 , during the device selection period T1 , a clock signal may be generated on the CS communication line through the master device 110 , and a predetermined number of bits of operation target data may be generated on the MOSI communication line. can

또한, 상기 장치 선택 기간(T1) 동안에, 통신 대상이 되는 슬레이브 장치(120-N)를 통해서 MISO 통신 라인에 소정 개수 비트의 응답이 발생할 수 있다. 상기 응답은 상기 슬레이브 장치(120-N)에서 연산된 결과값일 수 있다.Also, during the device selection period T1 , a response of a predetermined number of bits may occur in the MISO communication line through the slave device 120 -N as a communication target. The response may be a result value calculated by the slave device 120 -N.

도 4에 도시된 바와 같이, 데이터 전송 기간 중에 발생하는 전체 클럭 중에서 앞 부분의 첫 번째 라이징 에지(rising edge)부터 세 번째 라이징 에지까지는 MOSI을 위한 구간으로 설정하고, 네 번째 라이징 에지부터 여섯 번째 라이징 에지까지는 MISO를 위한 구간으로 설정할 수 있다. As shown in FIG. 4, among all clocks generated during the data transmission period, from the first rising edge to the third rising edge of the front part is set as a section for MOSI, and from the fourth rising edge to the sixth rising edge Up to the edge can be set as a section for MISO.

CS 통신 라인을 공유중인 슬레이브 장치(120-N)와 마스터 장치(110)는 클럭의 라이징 에지(rising edge) 타이밍에 데이터를 확인하여 타이밍을 동기화할 수 있다. 즉, CS 통신 라인을 공유중인 슬레이브 장치(120-N)는 라이징 에지 타이밍에 연산 대상 데이터에 해당하는 비트들을 확인할 수 있으며, 마스터 장치(110)는 라이징 에지 타이밍에 응답에 해당하는 비트들을 확인할 수 있다. 도 4에서는 비트열 '101'이 연산 대상 데이터로서 MOSI 통신 라인에 발생한 것으로 예시하고 있으며, 상기 연산 대상 데이터에 대한 응답으로서 비트열 '001'이 MISO에 발생한 것을 예시하고 있다. The slave device 120 -N and the master device 110 sharing the CS communication line may synchronize timing by checking data at the timing of a rising edge of a clock. That is, the slave device 120-N sharing the CS communication line can check the bits corresponding to the operation target data at the rising edge timing, and the master device 110 can check the bits corresponding to the response at the rising edge timing. have. In FIG. 4, it is exemplified that the bit string '101' is generated in the MOSI communication line as the operation target data, and the bit string '001' is generated in the MISO as a response to the operation target data.

슬레이브 장치(120-N)는 장치 선택 기간(T1) 동안에 CS 통신 라인을 통하여 수신되는 클럭 신호의 주파수 확인하고, 상기 클럭 신호의 주파수 미리 설정된 주파수 범위에 포함되는지 여부를 확인함으로써, 상기 클럭 신호의 이상 유무를 체크할 수 있다. 상기 슬레이브 장치(120-N)는 상기 클럭 신호를 n(n은 정수)으로 분주하고, 분주된 클럭 신호의 주파수가 미리 설정된 주파수 범위에 포함되는지 여부를 확인함으로써, 상기 클럭 신호의 이상 유무를 체크할 수 있다. The slave device 120-N checks the frequency of the clock signal received through the CS communication line during the device selection period T1, and checks whether the frequency of the clock signal is included in a preset frequency range. You can check for any abnormalities. The slave device 120-N divides the clock signal by n (n is an integer) and checks whether the clock signal is abnormal by checking whether the frequency of the divided clock signal is within a preset frequency range. can do.

도 5는 비정상적으로 확인된 클럭 신호를 예시하는 도면이다.5 is a diagram illustrating an abnormally confirmed clock signal.

도 5에 예시된 바와 같이, 장치 선택 기간(T2) 동안에 발생한 클럭 발생 주기가 도 4의 클럭과 비교하여 비정상적으로 늘어남을 확인할 수 있다. 슬레이브 장치(120-N)는 클럭 신호의 주파수를 n(n은 정수)으로 분주하고, 분주된 클럭 신호의 주파수가 미리 설정된 주파수 범위에 이탈하는지 여부를 확인함으로써, 도 5와 같은 비정상적인 클럭 신호를 검출할 수 있다. 비정상적인 클럭 신호를 검출한 슬레이브 장치(120-N)는 클럭 신호의 에러를 나타내는 코드를 MISO 통신 라인을 통해서 마스터 장치(110)로 송신할 수 있다. 도 5에서는 '111'의 에러코드가 MISO 통신 라인에서 발생한 것으로 예시하고 있다. As illustrated in FIG. 5 , it can be seen that the clock generation period generated during the device selection period T2 is abnormally increased compared to the clock of FIG. 4 . The slave device 120-N divides the frequency of the clock signal by n (n is an integer) and checks whether the frequency of the divided clock signal deviates from a preset frequency range, thereby generating an abnormal clock signal as shown in FIG. can be detected. The slave device 120 -N that has detected the abnormal clock signal may transmit a code indicating an error of the clock signal to the master device 110 through the MISO communication line. 5 exemplifies that an error code of '111' is generated in the MISO communication line.

도 6은 본 발명의 또 다른 실시예에 따른, 슬레이브 장치에서 직렬 통신을 수행하는 방법을 설명하는 흐름도이다.6 is a flowchart illustrating a method of performing serial communication in a slave device according to another embodiment of the present invention.

도 6을 참조하면, CS 통신 라인(11)을 공통으로 이용중인 슬레이브 장치(120-N)는 장치 선택 기간 동안에 CS 통신 라인을 통해서 마스터 장치(110)로부터 클럭 신호를 수신할 수 있다(S101). 이어서, 슬레이브 장치(120-N)는 MOSI 통신 라인을 통해서 마스터 장치(110)로부터 연산 대상 데이터를 수신할 수 있다(S103). 상기 슬레이브 장치(120-N)는 상기 클럭 신호를 기초로 MOSI 통신 라인에서 발생한 연산 대상 데이터를 확인할 수 있다. 일 실시예에서, 상기 슬레이브 장치(120-N)는 상기 클럭 신호의 라이징 에지 타이밍을 기초로, 연산 대상 데이터에 해당하는 비트들을 상기 MOSI 통신 라인에서 확인할 수 있다.Referring to FIG. 6 , the slave device 120 -N using the CS communication line 11 in common may receive a clock signal from the master device 110 through the CS communication line during the device selection period ( S101 ). . Subsequently, the slave device 120 -N may receive the operation target data from the master device 110 through the MOSI communication line ( S103 ). The slave device 120 -N may check the operation target data generated in the MOSI communication line based on the clock signal. In an embodiment, the slave device 120 -N may identify bits corresponding to the operation target data in the MOSI communication line based on the timing of the rising edge of the clock signal.

다음으로, 슬레이브 장치(120-N)는 상기 연산 대상 데이터를 미리 설정된 연산 방식을 대입하여, 연산 결과값을 획득할 수 있다(S105). 상기 연산 방식은 하나 이상의 논리 연산자와 상기 연산 대상 데이터와 함께 연산되는 또 다른 데이터를 포함할 수 있다. Next, the slave device 120 -N may obtain an operation result value by substituting a preset operation method for the operation target data ( S105 ). The operation method may include one or more logical operators and another data to be calculated together with the operation target data.

이어서, 슬레이브 장치(120-N)는 상기 연산 결과값이 이미 보유중인 정보와 부합되는지 여부를 확인할 수 있다(S107). 상기 보유중인 정보는 슬레이브 장치(120-N)의 식별정보일 수 있다. Next, the slave device 120 -N may check whether the operation result matches the information already held ( S107 ). The retained information may be identification information of the slave device 120 -N.

슬레이브 장치(120-N)는 연산 결과값이 이미 보유중인 정보와 부합되는지 않으면, 응답을 마스터 장치(110)로 송신하지 않고, 이후에 MOSI를 통해서 마스터 장치(110)로부터 수신되는 데이터를 무시할 수 있다. 즉, 슬레이브 장치(120-N)은 상기 연산 결과값이 보유중인 정보와 부합되지 않은 경우, 통신 대상 장치가 자신이 아닌 것으로 판단하여 응답을 마스터 장치(110)로 송신하지 않을 수 있다.The slave device 120-N does not transmit a response to the master device 110 if the operation result value does not match the information already held, and then ignores the data received from the master device 110 through the MOSI. have. That is, the slave device 120 -N may not transmit a response to the master device 110 by determining that the communication target device is not itself, when the operation result value does not match the retained information.

반면에, 슬레이브 장치(120-N)는 연산 결과값이 이미 보유중인 정보와 부합되면, MISO 통신 라인을 이용하여 마스터 장치(110)로 응답을 할 수 있다(S109). 상기 슬레이브 장치(120-N)는 상기 응답으로서 상기 연산 결과값을 마스터 장치(110)로 송신할 수 있다. On the other hand, the slave device 120-N may respond to the master device 110 using the MISO communication line when the operation result value matches the information already held (S109). The slave device 120 -N may transmit the operation result value to the master device 110 as the response.

다음으로, 슬레이브 장치(120-N)는 장치 선택 기간 동안에 CS 통신 라인을 통하여 수신되는 클럭 신호의 주파수 확인할 수 있다(S111). 이어서, 슬레이브 장치(120-N)는 상기 클럭 신호의 주파수 미리 설정된 주파수 정상 범위에 포함되는지 여부를 확인함으로써, 상기 클럭 신호의 이상 유무를 체크할 수 있다(S113). 상기 슬레이브 장치(120-N)는 상기 클럭 신호를 n(n은 정수)으로 분주하고, 분주된 클럭 신호의 주파수가 미리 설정된 주파수 범위에 포함되는지 여부를 확인함으로써, 상기 클럭 신호의 이상 유무를 체크할 수 있다. Next, the slave device 120 -N may check the frequency of the clock signal received through the CS communication line during the device selection period ( S111 ). Next, the slave device 120 -N may check whether the clock signal is abnormal by checking whether the frequency of the clock signal is included in a preset frequency normal range ( S113 ). The slave device 120-N divides the clock signal by n (n is an integer) and checks whether the clock signal is abnormal by checking whether the frequency of the divided clock signal is within a preset frequency range. can do.

다음으로, 슬레이브 장치(120-N)는 상기 클럭 신호의 주파수가 정상범위에 포함되면, 마스터 장치(110)와 통신을 수행할 수 있다(S115). 이때, 슬레이브 장치(120-N)는 SCK 통신 라인을 통해서, 수신되는 SPI 클럭을 통해서 마스터 장치(110)와 동기화를 되고, MOSI 통신 라인을 통해서 데이터를 마스터 장치(110)로부터 수신하고, MISO 통신 라인을 통해서 데이터를 마스터 장치(110)로 송신할 수 있다. Next, when the frequency of the clock signal is within the normal range, the slave device 120 -N may communicate with the master device 110 ( S115 ). At this time, the slave device 120-N is synchronized with the master device 110 through the SPI clock received through the SCK communication line, and receives data from the master device 110 through the MOSI communication line, and MISO communication Data may be transmitted to the master device 110 through the line.

반면에, 슬레이브 장치(120-N)는 상기 클럭 신호의 주파수가 정상범위에서 이탈되면, 마스터 장치(110)와 통신을 수행하지 않고, 클럭 신호의 에러를 나타내는 코드를 MISO 통신 라인을 통해서 마스터 장치(110)로 송신할 수 있다(S117).On the other hand, when the frequency of the clock signal deviates from the normal range, the slave device 120-N does not communicate with the master device 110 and transmits a code indicating an error of the clock signal to the master device through the MISO communication line. It can be transmitted to (110) (S117).

본 실시예에 따르면, 슬레이브 장치(120-N)가 CS 통신 라인을 공통으로 이용하더라도, 연산된 결과값을 통하여 자신이 선택되었는지 여부를 정확하게 확인하여, 데이터 충돌없이 마스터 장치(110)와 통신하는 효과를 발휘할 수 있다. 또한, 본 실시예에 따르면, CS 통신 라인을 통해서 수신된 클럭 신호의 정상 유무를 체크함으로써, 마스터 장치의 장애를 검증할 수 있는 장점을 발휘할 수 있다. According to this embodiment, even if the slave device 120-N uses the CS communication line in common, it is precisely checked whether or not it is selected through the calculated result value, and communicates with the master device 110 without data collision. can be effective. In addition, according to this embodiment, by checking whether the clock signal received through the CS communication line is normal, it is possible to exhibit the advantage of verifying the failure of the master device.

지금까지 설명된 본 발명의 실시예에 따른 방법들은 컴퓨터가 읽을 수 있는 코드로 구현된 컴퓨터프로그램의 실행에 의하여 수행될 수 있다. 상기 컴퓨터프로그램은 인터넷 등의 네트워크를 통하여 제1 컴퓨팅 장치로부터 제2 컴퓨팅 장치에 전송되어 상기 제2 컴퓨팅 장치에 설치될 수 있고, 이로써 상기 제2 컴퓨팅 장치에서 사용될 수 있다. 상기 제1 컴퓨팅 장치 및 상기 제2 컴퓨팅 장치는, 서버 장치, 클라우드 서비스를 위한 서버 풀에 속한 물리 서버, 데스크탑 피씨와 같은 고정식 컴퓨팅 장치를 모두 포함한다.The methods according to the embodiments of the present invention described so far may be performed by executing a computer program embodied as computer readable code. The computer program may be transmitted from the first computing device to the second computing device through a network such as the Internet and installed in the second computing device, thereby being used in the second computing device. The first computing device and the second computing device include all of a server device, a physical server belonging to a server pool for a cloud service, and a stationary computing device such as a desktop PC.

상기 컴퓨터프로그램은 DVD-ROM, 플래시 메모리 장치 등의 기록매체에 저장된 것일 수도 있다.The computer program may be stored in a recording medium such as a DVD-ROM or a flash memory device.

이상 첨부된 도면을 참조하여 본 발명의 실시예들을 설명하였지만, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적인 것이 아닌 것으로 이해해야만 한다.Although embodiments of the present invention have been described above with reference to the accompanying drawings, those of ordinary skill in the art to which the present invention pertains can realize that the present invention can be embodied in other specific forms without changing its technical spirit or essential features. can understand Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive.

Claims (12)

마스터 장치와 복수의 통신 라인을 형성하여 직렬 통신을 수행하는 복수의 슬레이브 장치; 및
상기 복수의 슬레이브 장치들이 공용으로 이용하는 CS(Chip Select) 통신 라인을 통하여 클럭 신호를 상기 복수의 슬레이브 장치로 송신하고, 상기 복수의 슬레이브 장치 중에서 어느 하나와 통신하기 위한 연산 대상 데이터를 MOSI(Master Output Slave Input) 통신 라인을 통하여 상기 복수의 슬레이브 장치로 송신하여, 상기 클럭 신호와 연산 대상 데이터를 이용하여 연산된 결과 값에 기초로 응답한 슬레이브 장치를 통신 대상 장치인 것으로 식별하고, 상기 식별된 슬레이브 장치와 통신을 수행하는 상기 마스터 장치를 포함하고,
상기 슬레이브 장치는, 상기 CS 통신 라인을 통해서 수신한 상기 클럭 신호의 주파수가 미리 설정된 주파수 범위에 포함되는지 여부를 확인하여 상기 클럭 신호의 이상 유무를 체크하는,
직렬 통신 장치.
a plurality of slave devices for performing serial communication by forming a plurality of communication lines with the master device; and
A clock signal is transmitted to the plurality of slave devices through a CS (Chip Select) communication line commonly used by the plurality of slave devices, and operation target data for communication with any one of the plurality of slave devices is transmitted to a Master Output (MOSI). Slave Input) transmits to the plurality of slave devices through a communication line, identifies a slave device that responds based on a result value calculated using the clock signal and calculation target data as a communication target device, and identifies the identified slave comprising the master device communicating with the device;
The slave device checks whether the clock signal is abnormal by checking whether a frequency of the clock signal received through the CS communication line is included in a preset frequency range,
serial communication device.
제1 항에 있어서,
상기 슬레이브 장치는,
상기 클럭 신호를 분주하고, 상기 분주된 클럭 신호가 상기 미리 설정된 주파수 범위에 포함되는지 여부를 확인하여 상기 클럭 신호의 이상 유무를 체크하는,
직렬 통신 장치.
According to claim 1,
The slave device is
dividing the clock signal and checking whether the clock signal is abnormal by checking whether the divided clock signal is included in the preset frequency range;
serial communication device.
제1 항에 있어서,
상기 슬레이브 장치는,
상기 클럭 신호의 이상이 체크된 경우, 클럭 에러를 나타내는 코드를 MISO(Master Input Slave Output) 통신 라인을 통해서 상기 마스터 장치로 송신하는,
직렬 통신 장치.
According to claim 1,
The slave device is
When an abnormality of the clock signal is checked, a code indicating a clock error is transmitted to the master device through a MISO (Master Input Slave Output) communication line,
serial communication device.
제1 항에 있어서,
상기 슬레이브 장치는,
상기 연산 대상 데이터를 미리 설정된 논리 연산자를 이용하여 연산하고 연산된 결과값이 보유중인 정보에 부합되는 경우에, 상기 마스터 장치로 응답하여 상기 마스터 장치와 통신하는,
직렬 통신 장치.
According to claim 1,
The slave device is
Computing the data to be calculated using a preset logical operator and communicating with the master device in response to the master device when the calculated result matches the retained information,
serial communication device.
제4 항에 있어서,
상기 슬레이브 장치는, 상기 연산한 결과값이 식별정보와 부합되면, 상기 응답으로서 상기 연산된 결과값을 MISO(Master Input Slave Output) 통신 라인을 통해서 상기 마스터 장치로 송신하고,
상기 마스터 장치는, 상기 MISO 통신 라인으로부터 수신한 상기 결과값이 정확한지 여부를 확인하여 정확한 경우에 상기 슬레이브 장치와 통신을 수행하는,
직렬 통신 장치.
5. The method of claim 4,
The slave device, when the calculated result value matches the identification information, transmits the calculated result value as the response to the master device through a MISO (Master Input Slave Output) communication line,
The master device checks whether the result value received from the MISO communication line is correct, and performs communication with the slave device if it is correct,
serial communication device.
제1 항에 있어서,
상기 마스터 장치는,
소정의 비트에 해당하는 상기 연산 대상 데이터를 상기 복수의 슬레이브 장치로 송신하는,
직렬 통신 장치.
According to claim 1,
The master device is
Transmitting the operation target data corresponding to a predetermined bit to the plurality of slave devices,
serial communication device.
제1 항에 있어서,
상기 마스터 장치는,
통신 성립을 위한 장치 선택 주기 동안에, 클럭 신호를 상기 복수의 슬레이브 장치로 송신하고, 상기 연산 대상 데이터를 상기 복수의 슬레이브 장치로 송신하는,
직렬 통신 장치.
According to claim 1,
The master device is
transmitting a clock signal to the plurality of slave devices and transmitting the operation target data to the plurality of slave devices during a device selection period for establishing communication;
serial communication device.
슬레이브 장치가 마스터 장치와 직렬 통신을 수행하는 방법에 있어서,
CS(Chip Select) 통신 라인을 통하여 클럭 신호를 마스터 장치로부터 수신하고, MOSI(Master Output Slave Input) 통신 라인을 통하여 연산 대상 데이터를 상기 마스터 장치로부터 수신하는 단계;
상기 클럭 신호를 기초하여 상기 MOSI 통신 라인을 통해서 수신되는 연산 대상 데이터를 획득하고, 상기 연산 대상 데이터를 기초로 연산 결과값을 획득하는 단계; 및
상기 연산 결과값이 미리 저장중인 정보에 부합되면 상기 마스터 장치와 통신을 수행하는 단계를 포함하는,
직렬 통신 방법.
A method for a slave device to perform serial communication with a master device, the method comprising:
Receiving a clock signal from the master device through a CS (Chip Select) communication line, and receiving operation target data from the master device through a MOSI (Master Output Slave Input) communication line;
obtaining operation target data received through the MOSI communication line based on the clock signal, and obtaining an operation result value based on the operation target data; and
Comprising the step of performing communication with the master device when the calculation result matches the information being stored in advance,
Serial communication method.
제8 항에 있어서,
상기 통신을 수행하는 단계는,
상기 CS 통신 라인을 통해서 수신한 상기 클럭 신호의 주파수가 미리 설정된 주파수 범위에 포함하는지 여부를 확인하는 단계; 및
상기 클럭 신호의 주파수가 상기 미리 설정된 주파수 범위에서 이탈하면, 상기 MOSI 통신 라인을 통해서 상기 마스터 장치로부터 수신되는 데이터를 무시하고, 클럭 에러를 나타내는 코드를 MISO(Master Input Slave Output) 통신 라인을 통해서 상기 마스터 장치로 송신하는 단계를 포함하는,
직렬 통신 방법.
9. The method of claim 8,
The step of performing the communication comprises:
checking whether a frequency of the clock signal received through the CS communication line is included in a preset frequency range; and
When the frequency of the clock signal deviates from the preset frequency range, data received from the master device through the MOSI communication line is ignored, and a code indicating a clock error is transmitted through the MISO (Master Input Slave Output) communication line. sending to the master device;
Serial communication method.
제9 항에 있어서,
상기 주파수 범위에 포함하는지 여부를 확인하는 단계는,
상기 클럭 신호를 분주하고, 상기 분주된 클럭 신호가 상기 미리 설정된 주파수 범위에 포함되는지 여부를 확인하는 단계를 포함하는,
직렬 통신 방법.
10. The method of claim 9,
The step of checking whether it is included in the frequency range,
frequency-dividing the clock signal, comprising the step of checking whether the divided clock signal is included in the preset frequency range,
Serial communication method.
제8 항에 있어서,
상기 연산 결과값을 획득하는 단계는,
상기 연산 대상 데이터를 미리 설정된 논리 연산자를 이용하여 연산하는 단계; 및
상기 연산한 결과값이 보유중인 정보와 부합되는 경우에, MISO(Master Input Slave Output) 통신 라인을 통해서 통신 수행을 위한 응답 신호를 상기 마스터 장치로 전송하는 단계를 포함하는,
직렬 통신 방법.
9. The method of claim 8,
The step of obtaining the result of the calculation includes:
calculating the operation target data using a preset logical operator; and
Comprising the step of transmitting a response signal for performing communication to the master device through a MISO (Master Input Slave Output) communication line when the calculated result value matches the retained information,
Serial communication method.
제11 항에 있어서,
상기 응답 신호를 상기 마스터 장치로 전송하는 단계는,
상기 연산된 결과값을 상기 응답 신호로서 상기 마스터 장치로 전송하는 단계를 포함하는,
직렬 통신 방법.
12. The method of claim 11,
Transmitting the response signal to the master device comprises:
Comprising the step of transmitting the calculated result value to the master device as the response signal,
Serial communication method.
KR1020200172511A 2020-12-10 2020-12-10 Serial communication apparatus and method KR102430232B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200172511A KR102430232B1 (en) 2020-12-10 2020-12-10 Serial communication apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200172511A KR102430232B1 (en) 2020-12-10 2020-12-10 Serial communication apparatus and method

Publications (2)

Publication Number Publication Date
KR20220082533A true KR20220082533A (en) 2022-06-17
KR102430232B1 KR102430232B1 (en) 2022-08-09

Family

ID=82268801

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200172511A KR102430232B1 (en) 2020-12-10 2020-12-10 Serial communication apparatus and method

Country Status (1)

Country Link
KR (1) KR102430232B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115987835A (en) * 2022-12-26 2023-04-18 上海新华控制技术集团科技有限公司 Communication state detection method, system and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010084862A (en) 2000-02-29 2001-09-06 박종섭 Multi-Function Serial Communication Interface Device
JP2005536809A (en) * 2002-08-22 2005-12-02 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Control device
JP2013517486A (en) * 2010-01-18 2013-05-16 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Method and apparatus for monitoring frequency signals
KR20140089799A (en) * 2013-01-07 2014-07-16 엘지전자 주식회사 Apparatus for Serial Peripheral Interface
KR20150062793A (en) * 2013-11-29 2015-06-08 삼성전자주식회사 Serial communication method and serial communication apparatus
US20200371977A1 (en) * 2019-05-20 2020-11-26 Nxp Usa, Inc. Spi protocol for burst read/write mode

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20010084862A (en) 2000-02-29 2001-09-06 박종섭 Multi-Function Serial Communication Interface Device
JP2005536809A (en) * 2002-08-22 2005-12-02 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Control device
JP2013517486A (en) * 2010-01-18 2013-05-16 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Method and apparatus for monitoring frequency signals
KR20140089799A (en) * 2013-01-07 2014-07-16 엘지전자 주식회사 Apparatus for Serial Peripheral Interface
KR20150062793A (en) * 2013-11-29 2015-06-08 삼성전자주식회사 Serial communication method and serial communication apparatus
US20200371977A1 (en) * 2019-05-20 2020-11-26 Nxp Usa, Inc. Spi protocol for burst read/write mode

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115987835A (en) * 2022-12-26 2023-04-18 上海新华控制技术集团科技有限公司 Communication state detection method, system and device and electronic equipment
CN115987835B (en) * 2022-12-26 2024-04-05 上海新华控制技术集团科技有限公司 Communication state detection method, system and device and electronic equipment

Also Published As

Publication number Publication date
KR102430232B1 (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN102663301B (en) Trusted computer and credibility detection method
CN108279910B (en) Program code programming method and device, computer equipment and storage medium
US20080192645A1 (en) Methods and Arrangements to Model an Asynchronous Interface
CN106055361B (en) Integrated firmware implementation method and system for multiple different types based on BMC (baseboard management controller)
CN104317694B (en) Whole machine testing method and device
CN111063386A (en) DDR chip testing method and device
KR102430232B1 (en) Serial communication apparatus and method
TWI701558B (en) Apparatus, method and system for port selection
TWI598819B (en) Computer system and method for testing hardware device based on virtual machine
CN108346404B (en) Parameter debugging method for time schedule controller and screen driving circuit
US20180041330A1 (en) Method and apparatus for automatic skew compensation
CN105243042A (en) Data burning method and data burning apparatus
CN114995860A (en) Method for upgrading firmware of graphic processor and graphic processor
CN103729218A (en) ID (identity) programming method
CN109154925A (en) Communication equipment, communication means, program and communication system
CN111937359A (en) Communication address setting method of detection equipment, unmanned aerial vehicle and storage medium
JP2009145298A (en) Failure pattern estimation method, failure pattern estimation device, and program
JP2021128773A (en) Method for hardware verification by storage device, and storage device therefor
JP2013045154A (en) Information processing apparatus, information processing system, abnormality sign detection method for information processing apparatus, and abnormality sign detection program
CN115629825B (en) Server and asset information acquisition method, asset information providing method and asset information providing device
US20110144771A1 (en) Safety control apparatus
US20070220296A1 (en) Data processing apparatus
EP3564691B1 (en) Test device, test method, and test program
CN113986600B (en) Test method and device for chip serial interface and chip
CN101990662B (en) Program execution device and method for controlling the same

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant