KR100567033B1 - Method for operating synchronous serial communication in which master and slave are fixed - Google Patents

Method for operating synchronous serial communication in which master and slave are fixed Download PDF

Info

Publication number
KR100567033B1
KR100567033B1 KR1020030075049A KR20030075049A KR100567033B1 KR 100567033 B1 KR100567033 B1 KR 100567033B1 KR 1020030075049 A KR1020030075049 A KR 1020030075049A KR 20030075049 A KR20030075049 A KR 20030075049A KR 100567033 B1 KR100567033 B1 KR 100567033B1
Authority
KR
South Korea
Prior art keywords
slave
master
communication
data
transmitted
Prior art date
Application number
KR1020030075049A
Other languages
Korean (ko)
Other versions
KR20050039957A (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 KR1020030075049A priority Critical patent/KR100567033B1/en
Publication of KR20050039957A publication Critical patent/KR20050039957A/en
Application granted granted Critical
Publication of KR100567033B1 publication Critical patent/KR100567033B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0008Synchronisation information channels, e.g. clock distribution lines
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • H04L12/40019Details regarding a bus master
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/4026Bus for use in automation systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Information Transfer Systems (AREA)

Abstract

장치간의 통신이 매우 중요한 시스템에서 통신 속도를 향상시키고, 통신의 안정도를 높여서 시스템의 성능을 향상시키기 위하여, 마스터와 슬레이브는 마스터에서 발생되는 클럭 신호에 따라 소정 주기마다 통신이 동시에 이루어지며, 마스터에서는 슬레이브를 제어하기 위한 명령 메시지(Cn)와 함께 이전 주기(n-1)에서 슬레이브로부터 전송된 결과 메시지(Rn-2)에 대한 통신 응답 확인을 포함한 데이터를 슬레이브로 전송함과 동시에, 슬레이브에서는 이전 주기(n-1)에서 마스터로부터 전송된 명령 메시지(Cn-1)에 대한 통신 응답 확인과 함께 명령 메시지(Cn-1)를 수행하여 얻은 결과값을 포함한 결과 메시지(Rn-1)를 포함한 데이터를 전송하는 것을 특징으로 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법이 제공된다.In a system where device-to-device communication is very important, in order to improve the communication speed and improve the stability of the communication system, the master and the slave communicate simultaneously at predetermined intervals according to the clock signal generated from the master. In addition to the command message (C n ) for controlling the slave, the data including the communication response confirmation for the result message (R n-2 ) transmitted from the slave in the previous period (n-1) is transmitted to the slave, and the slave Is a result message (R n-) containing the result obtained by performing the command message (C n-1 ) with acknowledgment of the communication response to the command message (C n-1 ) sent from the master in the previous period (n-1). 1 ) A synchronous serial communication method in which a master and a slave are fixed is provided.

동기 시리얼 통신, 마스터, 슬레이브Synchronous serial communication, master, slave

Description

마스터와 슬레이브가 고정된 동기 시리얼 통신 방법 {METHOD FOR OPERATING SYNCHRONOUS SERIAL COMMUNICATION IN WHICH MASTER AND SLAVE ARE FIXED}Synchronous serial communication with fixed master and slave {METHOD FOR OPERATING SYNCHRONOUS SERIAL COMMUNICATION IN WHICH MASTER AND SLAVE ARE FIXED}

도 1은 종래 기술의 시리얼 통신 방법에 따른 데이터 전송의 처리 흐름도.1 is a process flow diagram of data transmission according to a prior art serial communication method.

도 2는 본 발명에 따른 바이트 단위의 동기 시리얼 통신 포맷을 나타낸 도.2 illustrates a synchronous serial communication format in bytes according to the present invention.

도 3은 본 발명에 따른 패킷 단위의 동기 시리얼 통신 포맷을 나타낸 도.3 illustrates a synchronous serial communication format on a packet basis according to the present invention.

도 4는 본 발명에 따른 데이터 전송의 처리 흐름도.4 is a process flow diagram of data transmission in accordance with the present invention;

도 5는 본 발명에 따른 데이터 전송시 슬레이브측의 데이터 구조.5 is a data structure of a slave side in data transmission according to the present invention.

*도면의 주요 부분에 대한 부호의 설명** Description of the symbols for the main parts of the drawings *

CS# : 칩 셀렉트 CLK : 클럭신호CS #: Chip Select CLK: Clock Signal

MOSI : 마스터 출력/슬레이브 입력 MISO : 마스터 입력/슬레이브 출력MOSI: Master Output / Slave Input MISO: Master Input / Slave Output

Cn : 명령 메시지 N : 널 메시지Cn: command message N: null message

Rn : 결과 메시지Rn: result message

본 발명은 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법에 관한 것으로서, 보다 상세하게는 ATSC 수신 모듈(이하 '디코더 모듈'이라 함)과 TV SET 마이 콤(이하 '마이콤'라 함)의 통신에 있어서 마스터(주)와 슬레이브(종)를 고정시킨 동시 시리얼 통신 방법에 관한 것이다.The present invention relates to a synchronous serial communication method in which a master and a slave are fixed, and more particularly, in communication between an ATSC receiving module (hereinafter referred to as a 'decoder module') and a TV SET microcomputer (hereinafter referred to as a 'microcom'). The present invention relates to a simultaneous serial communication method in which a master and a slave are fixed.

디지털 장치와 IC, 프로세서들의 처리 속도가 빨라짐에 따라 전체 시스템의 속도와 성능이 향상되고 있으며, 시스템의 특성상 각 장치간의 통신이 중요한 시스템은 통신 속도의 고속화의 요구에 직면해 있다. As the processing speed of digital devices, ICs, and processors increases, the speed and performance of the entire system are improving. Due to the characteristics of the system, systems in which communication between devices is important are faced with the demand for higher communication speed.

시리얼 통신에는 동기 시리얼 통신과 비동기 시리얼 통신의 2종류의 통신 방식이 있다. 동기 통신의 경우, 2개의 디바이스 사이에서 동기를 취하고, 그 타이밍에 따라 데이터를 송수신하며, 데이터의 교환이 없는 사이에도 제어용의 신호가 흐르고 있으므로, 상대와의 동기를 유지하는 것이 가능하다. 실 데이터를 송신한 때는 그것을 수신하고, 데이터가 없는 때에는 대기 상태를 나타내는 신호를 교환한다. 이처럼 통신이 확립되면, 실 데이터를 송수신한 것에 데이터의 시작과 종료를 나타내는 신호가 존재하지 않기 때문에 데이터 전송 속도는 빨라지게 된다.There are two types of serial communication, synchronous serial communication and asynchronous serial communication. In the case of synchronous communication, synchronization is performed between two devices, data is transmitted and received according to the timing, and a control signal flows even when there is no data exchange, so that it is possible to maintain synchronization with the other party. When real data is transmitted, it is received. When there is no data, a signal indicating a waiting state is exchanged. When communication is established in this manner, the data transfer speed is increased because no signal indicating the start and end of data exists in the transmission and reception of real data.

비동기 통신의 경우, 송신과 수신 아이들(idle) 문자가 필요 없다. 그러나 데이터의 처음과 끝에는 반드시, 스타트 비트와 스톱 비트가 붙게 된다. 스타트 비트는 데이터의 개시를 나타내고, 스톱 비트는 데이터의 종료를 나타내는 것이다. 따라서, 이들 두 비트의 추가 때문에 비동기 통신의 속도는 동기 통신에 비하여 약간 늦어지게 된다.For asynchronous communication, there is no need for send and receive idle characters. However, at the beginning and end of the data, there is a start bit and a stop bit. The start bit indicates the start of data and the stop bit indicates the end of data. Thus, the addition of these two bits slows the speed of asynchronous communication slightly compared to synchronous communication.

상기에서 살펴본 바와 같이, 이러한 통신 속도는 시스템의 성능에 큰 기여를 하고 있으며, 이로 인하여 시리얼 통신에서도 비동기 통신 방법보다는 동기 통신 방법에 대한 요구가 높아지고 있다.As described above, such a communication speed contributes greatly to the performance of the system, thereby increasing the demand for a synchronous communication method rather than an asynchronous communication method in serial communication.

도 1을 참조하여, 종래 기술의 시리얼 통신 방법에 따른 데이터 전송의 처리 흐름을 살펴보면 다음과 같다.Referring to FIG. 1, the processing flow of data transmission according to the conventional serial communication method is as follows.

마스터(예를 들면, 디코더 모듈)가 슬레이브(예를 들면, TV SET(마이콤))로 통신 명령(C1)을 보내면, 디코더 모듈은 곧 이어 슬레이브 모드로 전환하게 되며, 전환시에는 통신 전환 시간이 필요하게 된다. 상기 마이콤은 슬레이브 모드에서 통신 명령(C1)을 받으면 통신 상태를 슬레이브 모드에서 마스터 모드로 전환한다.When the master (e.g., the decoder module) sends a communication command (C1) to the slave (e.g., TV SET (microcomm)), the decoder module soon switches to the slave mode. It is necessary. When the microcomputer receives the communication command C1 in the slave mode, the microcomputer switches the communication state from the slave mode to the master mode.

디코더 모듈의 미리 설정된 타임 아웃 구간 내에 마이콤은 통신 응답 확인(ACK1-C1)을 전송해야 하며, 만일 디코더 모듈이 미리 설정된 타임 아웃 구간 내에 ACK를 받지 못하면 디코더 모듈은 재전송 모드로 전환해야 한다.The microcomputer should transmit a communication response acknowledgment (ACK1-C1) within the preset timeout period of the decoder module. If the decoder module does not receive an ACK within the preset timeout period, the decoder module should switch to the retransmission mode.

통신 응답 확인(ACK1-C1)을 보낸 마이콤은 명령에 대한 수행을 하고 이에 대한 결과값(R1)을 송신하고, 그리고 나서 통신을 다시 슬레이브 모드로 전환한다. 마이콤은 이렇게 슬레이브 모드로 전환하여, 디코더 모듈이 결과값(R1)을 제대로 수신했는지에 대한 통신 응답 확인(ACK1-R1)을 수신할 준비를 하며, 디코더 모듈은 마스터로 전환하여 통신 응답 확인(ACK1-R1)을 전달하게 된다. 이에 대한 통신 역시 정해진 타임 아웃 구간 내에 이루어지지 않게 되면, 마이콤은 명령 수행에 대한 결과값을 재전송하게 된다.The microcomputer sending the communication response acknowledgment (ACK1-C1) performs the command and transmits the result value R1, and then switches the communication back to the slave mode. The microcomputer switches to the slave mode in this way, and prepares to receive the communication response confirmation (ACK1-R1) regarding whether the decoder module has properly received the result value R1, and the decoder module switches to the master to confirm the communication response (ACK1). -R1). If communication for this also does not occur within a predetermined timeout period, the microcomputer retransmits the result of executing the command.

상기에서 살펴본 바와 같이, 마스터로부터 슬레이브로의 명령과 이에 대한 슬레이브로부터 마스터로의 통신 응답 확인 및 명령에 대한 결과 송신, 이에 대한 마스터로부터 슬레이브로의 통신 응답 확인 등과 같은 마스터와 슬레이브간의 비주기적인 동기 시리얼 통신에 의하면, 마스터와 슬레이브간의 통신 전환 시간이 항상 필요하게 되며, 통신 응답 확인을 받지 못했을 때 통신 오류 처리로 판단하기 위한 시간 간격을 두어야 하므로 통신 효율이 매우 나빠지게 되어, 시스템 성능이 매우 저하된다.As described above, aperiodic synchronization between the master and the slave, such as confirming the command from the master to the slave, confirming the communication response from the slave to the master and transmitting the result of the command, confirming the communication response from the master to the slave, etc. According to the serial communication, communication switching time between the master and the slave is always required, and when the communication response is not acknowledged, a time interval for determining the communication error processing must be set, so communication efficiency becomes very poor, and system performance is very degraded. do.

또한, 슬레이브가 마스터에 비해 상대적으로 느린 경우, 마스터와 슬레이브의 통신이 주를 이루는 시스템에서는 통신 속도가 더욱 느려지게 되고, 시스템의 전체 성능을 저하시키는 결과를 초래하게 되며, 슬레이브의 프로그램 메모리 부담이 늘어나게 되고, 통신 오류에 대한 처리 테스트가 곤란하게 된다.In addition, if the slave is relatively slower than the master, the communication speed becomes slower in the system where the master and slave communication is the main, resulting in lowering the overall performance of the system. This makes it difficult to test processing for communication errors.

본 발명은 상술한 종래의 문제점을 극복하기 위한 것으로서, 본 발명의 목적은 장치간의 통신이 매우 중요한 시스템에서 통신 속도를 향상시키고, 통신의 안정도를 높여서 시스템의 성능을 향상시키기 위하여, 마스터와 슬레이브가 고정된 주기적인 동기 시리얼 통신 방법을 제공하기 위한 것이다.The present invention is to overcome the above-mentioned problems, the object of the present invention is to improve the performance of the system by improving the communication speed, the stability of the communication in a system where the communication between devices is very important, It is to provide a fixed periodic synchronous serial communication method.

상기 본 발명의 목적을 달성하기 위한 본 발명의 일 측면에 따르면, 마스터와 슬레이브가 고정되어 상기 마스터와 슬레이브가 상기 마스터에서 발생되는 클럭 신호에 따라 소정 주기마다 동시에 통신이 이루어지는 동기 시리얼 통신 방법에 있어서, 상기 마스터에서는 상기 슬레이브를 제어하기 위한 명령 메시지(Cn)와 함께 이전 주기(n-1)에서 상기 슬레이브로부터 전송된 결과 메시지(Rn-2)에 대한 통신 응답 확인을 포함한 데이터를 상기 슬레이브로 전송함과 동시에, 상기 슬레이브에서는 이전 주기(n-1)에서 상기 마스터로부터 전송된 명령 메시지(Cn-1)에 대한 통신 응답 확인과 함께 상기 명령 메시지(Cn-1)를 수행하여 얻은 결과값을 포함한 결과 메시지(Rn-1)를 포함한 데이터를 전송하는 것을 특징으로 한다.According to an aspect of the present invention for achieving the object of the present invention, in the synchronous serial communication method in which the master and slave is fixed so that the master and slave communication at the same time every predetermined period in accordance with the clock signal generated from the master The master includes data including a communication response confirmation for the result message R n-2 transmitted from the slave in a previous period n-1 together with a command message C n for controlling the slave. At the same time, the slave obtains a communication response to the command message (C n-1 ) transmitted from the master in the previous period ( n-1 ) and performs the command message (C n-1 ). And transmitting data including a result message (R n-1 ) including a result value.

마스터로부터 상기 슬레이브로 전송되는 데이터는 데이터 군을 구분하기 위한 헤더와, 명령메시지와, 이전 주기에 대한 통신 응답 확인과 현재 주기의 데이터군의 체크섬으로 구성된 형태로 마스터로부터 슬레이브로 전송되는 것을 특징으로 한다.Data transmitted from the master to the slave is transmitted from the master to the slave in the form of a header for distinguishing the data group, a command message, confirming the communication response to the previous period and the checksum of the data group of the current period. do.

슬레이브로부터 마스터로 전송되는 데이터는 데이터 군을 구분하기 위한 헤더와, 결과메시지와, 이전 주기에 대한 통신 응답 확인과, 현재 주기의 데이터군의 체크섬 및 슬레이브가 전송하는 데이터의 유효 여부를 의미하는 밸리더티(validity)로 구성된 형태로 슬레이브로부터 마스터로 전송되는 것을 특징으로 한다.The data transmitted from the slave to the master includes a header for identifying the data group, a result message, a confirmation of the communication response for the previous period, a checksum of the data group of the current period, and a validity of the data transmitted by the slave. It is characterized by being transmitted from the slave to the master in the form of a (validity).

마스터와 슬레이브간에 전송되는 데이터는 프레임 또는 패킷 단위로 전송되는 것을 특징으로 한다.The data transmitted between the master and the slave may be transmitted in frame or packet units.

상기 마스터는 디코더 모듈이고, 상기 슬레이브는 TV SET 마이콤인 것을 특징으로 한다.The master is a decoder module, and the slave is a TV SET microcomputer.

이하, 본 발명의 실시예를 첨부한 도면을 참조하여 설명하기로 한다.Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.

도 2를 참조하여, 본 발명에 따른 바이트 단위의 동기 시리얼 통신 포맷을 나타낸 도면을 설명하면 다음과 같다.Referring to FIG. 2, a diagram illustrating a synchronous serial communication format in byte units according to the present invention will be described.

SPI(Serial Peripheral Interface; 직렬 주변장치 인터페이스) 통신은 주변장치와 연결하는 전이중 동기식 직렬 인터페이스로서, 통신은 4개의 라인을 통하여 이루어진다. 각각의 라인은 칩 셀렉트(CS#), 클럭(CLK), 마스터 출력/슬레이브 입력(MOSI)과 마스터 입력/슬레이브 출력(MISO)으로, 칩 셀렉트와 클럭은 제어 회선이며, MOSI와 MISO는 데이터 회선이다.Serial Peripheral Interface (SPI) communication is a full-duplex synchronous serial interface that connects to a peripheral device. Communication is through four lines. Each line is Chip Select (CS #), Clock (CLK), Master Output / Slave Input (MOSI) and Master Input / Slave Output (MISO). Chip Select and Clock are Control Lines. MOSI and MISO are Data Lines. to be.

상기 도 2에 도시된 바와 같이, 마스터가 칩 셀렉트(CS#) 핀을 인에이블 시키면, 마스터(본 실시예의 경우, 디코더 모듈)에서는 클럭이 발생된다. 상기 마스터에서 발생된 클럭에 따라 MOSI와 MISO를 통하여 마스터로부터 슬레이브(본 실시예의 경우, TV SET 마이콤)로, 그리고 슬레이브로부터 마스터로 데이터가 동시에 전송된다.As shown in FIG. 2, when the master enables the chip select (CS #) pin, a clock is generated in the master (decoder module in this embodiment). According to the clock generated in the master, data is simultaneously transmitted from the master to the slave (TV SET micom in this embodiment) and from the slave to the master via MOSI and MISO.

도 3은 본 발명에 따른 패킷 단위의 동기 시리얼 통신 포맷을 나타낸 도면이 도시되는데, 상기 도 3은 하나의 패킷이 어떻게 구성되는지를 보이기 위한 것으로서, 나머지는 상기 도 2와 동일하다.FIG. 3 is a diagram illustrating a synchronous serial communication format in a packet unit according to the present invention. FIG. 3 is a diagram illustrating how one packet is configured, and the rest is the same as that of FIG.

하나의 패킷을 전송하기 위해서는 디코더 모듈이 칩 셀렉트(CS#)핀을 인에이블(LOW) 시키고 다수의 바이트에 대한 클럭을 발생시킨다. 클럭 발생에 따라, 디코더 모듈로부터 명령 바이트가 TV SET 마이콤으로 전송되고, 동시에 TV SET 마이콤으로부터도 데이터가 디코더 모듈로 전송된다. 도 3에 도시된 1 패킷을 구성하는 바이트수나 데이터 전송 시간 등은 예시에 불과한 것이다.To send one packet, the decoder module enables the chip select (CS #) pin (LOW) and generates a clock for multiple bytes. In accordance with the clock generation, the command byte is transmitted from the decoder module to the TV SET microcomputer, and at the same time, the data is transmitted from the TV SET microcomputer to the decoder module. The number of bytes, data transmission time, etc. that constitute one packet shown in FIG. 3 are merely examples.

도 4를 참조하여, 본 발명에 따른 데이터 전송의 처리 흐름을 설명하면 다음과 같다. 디코더 모듈을 마스터, TV SET 마이콤을 슬레이브로 가정하면, 디코더 모듈이 마스터로 동작하므로 TV SET의 상태를 알기 위하여 소정 주기(예를 들면, 100ms)마다 TV SET 마이콤과 주기적으로 통신을 하게 된다.Referring to Figure 4, the flow of data transmission processing according to the present invention will be described. When the decoder module is assumed to be a master and the TV SET micom is a slave, the decoder module operates as a master, so that the decoder module periodically communicates with the TV SET micom every predetermined period (for example, 100 ms) to know the state of the TV SET.

디코더 모듈은 필요한 경우에는 명령 메시지를 보내고, 만약 보낼 메시지가 없는 경우에는 NULL 메시지를 전송하게 된다. 여기서, 명령 메시지란 디코더 모듈이 TV SET 마이콤을 제어하기 위하여 보내는 데이터를 의미한다.The decoder module sends a command message if necessary and a NULL message if there is no message to send. Here, the command message refers to data sent by the decoder module to control the TV SET microcomputer.

TV SET 마이콤은 통신할 때 기본적으로 TV SET 상태를 알려주는 상태 메시지를 디코더 모듈로 전송하며, 상기 디코더 모듈에서 받은 명령 메시지를 수행하여 얻은 결과값이 발생하는 경우에는 상태 메시지가 아닌 결과 메시지를 전송하게 된다. 여기서, 상태 메시지란 TV SET의 상태, 즉 리모콘, 프론트 키 값 및 외부 입력 상태 등을 포함하며, 디코더 모듈로부터의 명령이 없어도 항상 전송하는 데이터를 의미하며, 결과 메시지란 디코더 모듈로부터 받은 명령을 수행하여 얻은 결과값을 의미한다. 따라서, 디코더 모듈로부터 명령 메시지를 받기 전까지는 결과 메시지를 전송할 수 없다.When the TV SET micom communicates, it basically sends a status message indicating the TV SET status to the decoder module, and when a result value obtained by performing a command message received from the decoder module occurs, the TV SET micom transmits a result message instead of a status message. Done. Here, the status message includes a TV SET status, that is, a remote controller, a front key value, and an external input status, and means data that is always transmitted even without a command from the decoder module, and the result message is a command received from the decoder module. Means the result obtained. Therefore, the result message cannot be transmitted until the command message is received from the decoder module.

디코더 모듈에서 최초의 명령 메시지(C1)를 마이콤으로 전송하게 되면, 마이콤에서는 현재 명령을 수신하기 전 까지는 통신 응답 확인을 전송할 수 없으므로 현재 시점에서는 우선 널 메시지(N)를 송신하게 된다. 따라서, 디코더 모듈로부터 마이콤으로는 명령 메시지(C1)가 전송됨과 동시에, 마이콤에서는 디코더 모듈로 널 메시지(N)가 전송된다. When the decoder module transmits the first command message C1 to the microcomputer, the microcomputer cannot transmit the communication response acknowledgment until the current computer receives the current command. Therefore, the command message C1 is transmitted from the decoder module to the micom, and the null message N is transmitted from the decoder module to the decoder module.

그 다음에, 디코더 모듈은 명령 메시지(C2)를 마이콤으로 전송하며, 마이콤은 이전의 명령 메시지(C1)에 대한 통신 응답 확인과 상기 C1을 수행하여 얻은 결 과값을 포함한 결과 메시지(R1)를 전송하게 된다.Then, the decoder module sends a command message C2 to the microcomputer, and the microcomputer transmits a result message R1 including the confirmation of the communication response to the previous command message C1 and the result value obtained by performing the C1. Done.

그리고 나서, 디코더 모듈은 상기 결과 메시지(R1)에 대한 통신 응답 확인을 포함한 명령 메시지(C3)를 마이콤으로 전송함과 동시에, 마이콤은 이전의 명령 메시지(C2)에 대한 통신 응답 확인과 상기 C2를 수행하여 얻은 결과값을 포함한 결과 메시지(R2)를 전송하게 된다.Then, the decoder module sends a command message C3 including the communication response confirmation to the result message R1 to the microcomputer, and at the same time, the microcomputer sends the communication response confirmation to the previous command message C2 and the C2. The result message R2 including the result value obtained by the execution is transmitted.

이와 같이, 디코더 모듈은 마이콤으로부터 전송된 결과 메시지에 대한 통신 응답 확인을 그 다음 명령 메시지(또는 널 메시지)를 전송할 때 함께 전송하며, 마이콤은 디코더 모듈로부터 받은 명령 메시지에 대한 통신 응답 확인과 상기 명령 메시지에 대한 결과값을 디코더 모듈로부터 다음 명령 메시지(또는 널 메시지)를 받을 때 전송하게 된다. 그 결과, 통신 전환 시간이 필요 없게 되어 통신 효율이 매우 향상된다.As such, the decoder module sends a communication response acknowledgment for the result message sent from the microcomputer at the next command message (or null message) transmission, and the microcomputer transmits a communication response acknowledgment for the command message received from the decoder module and the command. The result of the message is transmitted when the next command message (or null message) is received from the decoder module. As a result, communication switching time is not required, and communication efficiency is greatly improved.

도 5는 본 발명에 따른 데이터 전송시 슬레이브측의 데이터 구조이다. 상기 도 4에 도시된 바와 같이, 마스터(디코더 모듈)와 슬레이브(마이콤)가 고정되어, 동시에 데이터를 통신하는 경우에는 슬레이브의 입장에서는 언제 통신이 일어날지 모르는 상황이 된다. 즉, 마스터가 클럭을 보내면, 슬레이브는 그러한 클럭 신호에 따라 MISO를 통하여 데이터를 전송해야 하므로, 슬레이브가 보내는 데이터의 유효여부를 함께 보내는 것이 필요하게 된다.5 is a data structure of a slave side in data transmission according to the present invention. As shown in FIG. 4, when the master (decoder module) and the slave (microcom) are fixed and communicate data at the same time, the situation of the slave may not be known when the communication will occur. That is, when the master sends a clock, the slave needs to send data through the MISO according to the clock signal, so it is necessary to send the validity of the data sent by the slave.

이를 위하여, 슬레이브측에서 마스터로 보내는 데이터 구조는 데이터군을 구분하는 헤더(Header), 실제로 보내는 각 바이트에 대한 유효성을 의미하는 밸리더티(Validity)와 이전 통신에 대한 응답을 확인하기 위한 통신 응답 확인(Ack)과 현 재 데이터군의 체크섬(CS)으로 구성된다. 여기서, 밸리더티는 각 바이트의 결과값이 유효한 값인지를 의미하므로 마스터측에서 데이터를 받아서 처리할 때 유효하게 처리할 것인지를 알 수 있게 된다.To this end, the data structure sent from the slave side to the master includes a header that distinguishes the data group, a validity that indicates the validity of each byte sent, and a communication response confirmation for confirming a response to the previous communication. (Ack) and the checksum (CS) of the current data group. In this case, the validity means that the result value of each byte is a valid value, and thus it is possible to know whether to process the data effectively when receiving and processing data from the master side.

도 5에 도시된 밸리더티 B0∼B7은 데이터 1 ∼ 데이터 8까지의 데이터 유효성을 나타내게 된다. 예를 들면, B7이 1이라면 데이터 1은 유효하며, 0라면 유효하지 않은 경우를 의미하게 된다.The validity B0-B7 shown in FIG. 5 shows the data validity from data 1-data 8. For example, if B7 is 1, data 1 is valid. If B7 is 0, it means that it is invalid.

한편, 마스터측의 데이터 구조를 살펴보면 밸리더티가 제외된 헤더, 통신 응답 확인과 현재 데이터군의 체크섬으로 구성된다.On the other hand, the data structure of the master side consists of a header without validity, a communication response confirmation, and a checksum of the current data group.

이상에서 설명한 것은 본 발명에 따른 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법의 예시적인 실시예에 불과한 것으로서, 본 발명은 상기한 실시예에 한정되지 않고, 이하의 특허청구범위에서 청구하는 바와 같이, 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 분야에서 통상의 지식을 가진 자라면 누구든지 다양한 변경 실시가 가능한 범위까지 본 발명의 기술적 정신이 있다고 할 것이다.What has been described above is only an exemplary embodiment of a synchronous serial communication method in which a master and a slave are fixed according to the present invention, and the present invention is not limited to the above-described embodiment, and as claimed in the following claims, Without departing from the gist of the present invention, anyone of ordinary skill in the art will have the technical spirit of the present invention to the extent that various modifications can be made.

상술한 바와 같이, 본 발명의 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법에 따르면, 통신의 마스터/슬레이브(주/종)가 고정되어 전환하는 시간이 절감되며, 통신의 유효확인은 다음 주기의 통신때 체크섬 결과를 전송하는 것으로 이루어지므로 응답 확인을 추가적인 통신량을 절감하게 된다.As described above, according to the fixed synchronous serial communication method of the master and the slave of the present invention, the master / slave (main / slave) of the communication is fixed and switching time is reduced, and the validity of the communication is the communication of the next cycle. When the checksum results are sent, the response confirmation saves additional traffic.

또한, 마스터는 속도가 매우 빠르므로 주기적인 통신이 부담되지 않고, 슬레이브는 통신에 의한 명령을 수행한 후의 결과 송신이므로 통신에 대한 작업 할당이 많은 경우에도 크게 부담이 되지 않게 되며, 슬레이브의 통신 오류 처리에 대한 프로그램 메모리가 적게 소요되고, 테스트도 용이해진다.In addition, since the master is very fast, periodic communication is not burdened. Slave is the result transmission after executing the command by the communication. Therefore, even if there is a lot of work assignment for communication, it is not a burden. Less program memory is required for processing and testing is easier.

Claims (5)

마스터와 슬레이브가 고정되어 상기 마스터와 슬레이브가 상기 마스터에서 발생되는 클럭 신호에 따라 소정 주기마다 동시에 통신이 이루어지는 동기 시리얼 통신 방법에 있어서, In the synchronous serial communication method in which the master and the slave is fixed so that the master and the slave communicates at the same time every predetermined period in accordance with the clock signal generated from the master, 상기 마스터에서는 상기 슬레이브를 제어하기 위한 명령 메시지(Cn)와 함께 이전 주기(n-1)에서 상기 슬레이브로부터 전송된 결과 메시지(Rn-2)에 대한 통신 응답 확인을 포함한 데이터를 상기 슬레이브로 전송함과 동시에, 상기 슬레이브에서는 이전 주기(n-1)에서 상기 마스터로부터 전송된 명령 메시지(Cn-1)에 대한 통신 응답 확인과 함께 상기 명령 메시지(Cn-1)를 수행하여 얻은 결과값을 포함한 결과 메시지(Rn-1)를 포함한 데이터를 전송하는 것을 특징으로 하는 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법.The master transmits data including acknowledgment of communication response to the result message (R n-2 ) transmitted from the slave in the previous period (n-1) together with a command message (C n ) for controlling the slave to the slave. Simultaneously with the transmission, a result obtained by performing the command message (C n-1 ) together with acknowledgment of the communication response to the command message (C n-1 ) transmitted from the master in the previous period (n-1) A fixed synchronous serial communication method in which a master and a slave are transmitted with data including a result message R n-1 including a value. 제 1항에 있어서, 상기 마스터로부터 상기 슬레이브로 전송되는 데이터는 데이터 군을 구분하기 위한 헤더와, 명령메시지와, 이전 주기에 대한 통신 응답 확인과 현재 주기의 데이터군의 체크섬으로 구성된 형태로 마스터로부터 슬레이브로 전송되는 것을 특징으로 하는 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법.The data transmitted from the master to the slave comprises a header for distinguishing a data group, a command message, a communication response confirmation for a previous period, and a checksum of a data group of a current period. A synchronous serial communication method in which a master and a slave are fixed to the slave. 제 1항에 있어서, 상기 슬레이브로부터 상기 마스터로 전송되는 데이터는 데이터 군을 구분하기 위한 헤더와, 결과메시지와, 이전 주기에 대한 통신 응답 확인과, 현재 주기의 데이터군의 체크섬 및 상기 슬레이브가 전송하는 데이터의 유효 여부를 의미하는 밸리더티(validity)로 구성된 형태로 슬레이브로부터 마스터로 전송되는 것을 특징으로 하는 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법.The data of claim 1, wherein the data transmitted from the slave to the master includes a header for identifying a data group, a result message, a communication response confirmation for a previous period, a checksum of a data group of a current period, and the slave. A fixed serial communication method of a master and a slave, wherein the master and the slave are transmitted from the slave to the master in a form of validity indicating the validity of the data. 제 1항 내지 제 3항중 어느 한 항에 있어서, 상기 마스터와 슬레이브간에 전송되는 데이터는 프레임 또는 패킷 단위로 전송되는 것을 특징으로 하는 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법.The method according to any one of claims 1 to 3, wherein the data transmitted between the master and the slave is transmitted in a frame or packet unit. 제 4항에 있어서, 상기 마스터는 디코더 모듈이고, 상기 슬레이브는 TV SET 마이콤인 것을 특징으로 하는 마스터와 슬레이브가 고정된 동기 시리얼 통신 방법.5. The method of claim 4, wherein the master is a decoder module and the slave is a TV SET microcomputer.
KR1020030075049A 2003-10-27 2003-10-27 Method for operating synchronous serial communication in which master and slave are fixed KR100567033B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030075049A KR100567033B1 (en) 2003-10-27 2003-10-27 Method for operating synchronous serial communication in which master and slave are fixed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030075049A KR100567033B1 (en) 2003-10-27 2003-10-27 Method for operating synchronous serial communication in which master and slave are fixed

Publications (2)

Publication Number Publication Date
KR20050039957A KR20050039957A (en) 2005-05-03
KR100567033B1 true KR100567033B1 (en) 2006-04-03

Family

ID=37241873

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030075049A KR100567033B1 (en) 2003-10-27 2003-10-27 Method for operating synchronous serial communication in which master and slave are fixed

Country Status (1)

Country Link
KR (1) KR100567033B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113467222A (en) * 2020-03-30 2021-10-01 南京南瑞继保电气有限公司 Data synchronization method and device for master-slave redundancy control system

Also Published As

Publication number Publication date
KR20050039957A (en) 2005-05-03

Similar Documents

Publication Publication Date Title
CN100366029C (en) Communication controller, host-side controller, communication equipment, communication system and method
US20070174608A1 (en) Distributed (modular) internal architecture
AU598917B2 (en) Improvements in or relating to data transmission systems and methods of transmitting data
RU2139636C1 (en) Batch data transmission protocol for radio communications
KR19990067626A (en) Packet transmitter and receiver
CN103814550A (en) Method for operating communications assembly
CN109688555B (en) Real-time signal data acquisition and communication system and method
KR101001074B1 (en) Method for transmittng data on a bus
US6452946B1 (en) Apparatus and method for improving performance in master and slave communications systems
CN115868184A (en) Accelerating control procedures on services oriented to BLE connections
CN1264234A (en) Priority enhanced information transfer device and its method
JP4210993B2 (en) USB hub device, USB peripheral device and data transmission / reception method
KR100567033B1 (en) Method for operating synchronous serial communication in which master and slave are fixed
EP0589509B1 (en) Polling-type digital communications system having pseudo-balanced mode
US6912210B1 (en) Data communication system and communication device used
Alves et al. On the adaptation of broadcast transactions in token-passing fieldbus networks with heterogeneous transmission media
KR0165440B1 (en) Polling communication method
KR20060017035A (en) Method for transmitting multiple sensors data with a can message
JP4258334B2 (en) Communication device
EP1032177B1 (en) Signal processing apparatus with three layer processing sections
WO1992013414A1 (en) Packet transmission system and method utilizing both a data bus and dedicated control lines
CN112737761B (en) Apparatus and method for acknowledging communications via bus
US20230037840A1 (en) Communication device and communication method
CN117149678A (en) RS485 bus arbitration system and method with multiple masters and multiple slaves
KR100514620B1 (en) Control method for air conditioner

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: 20110302

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee