KR100526938B1 - Method for receiving differential code at micom - Google Patents

Method for receiving differential code at micom Download PDF

Info

Publication number
KR100526938B1
KR100526938B1 KR1019970068623A KR19970068623A KR100526938B1 KR 100526938 B1 KR100526938 B1 KR 100526938B1 KR 1019970068623 A KR1019970068623 A KR 1019970068623A KR 19970068623 A KR19970068623 A KR 19970068623A KR 100526938 B1 KR100526938 B1 KR 100526938B1
Authority
KR
South Korea
Prior art keywords
time
data
microcomputer
pulse
received bits
Prior art date
Application number
KR1019970068623A
Other languages
Korean (ko)
Other versions
KR19990049651A (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 KR1019970068623A priority Critical patent/KR100526938B1/en
Publication of KR19990049651A publication Critical patent/KR19990049651A/en
Application granted granted Critical
Publication of KR100526938B1 publication Critical patent/KR100526938B1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L27/00Modulated-carrier systems
    • H04L27/18Phase-modulated carrier systems, i.e. using phase-shift keying
    • H04L27/20Modulator circuits; Transmitter circuits
    • H04L27/2032Modulator circuits; Transmitter circuits for discrete phase modulation, e.g. in which the phase of the carrier is modulated in a nominally instantaneous manner
    • H04L27/2053Modulator circuits; Transmitter circuits for discrete phase modulation, e.g. in which the phase of the carrier is modulated in a nominally instantaneous manner using more than one carrier, e.g. carriers with different phases
    • H04L27/206Modulator circuits; Transmitter circuits for discrete phase modulation, e.g. in which the phase of the carrier is modulated in a nominally instantaneous manner using more than one carrier, e.g. carriers with different phases using a pair of orthogonal carriers, e.g. quadrature carriers
    • H04L27/2067Modulator circuits; Transmitter circuits for discrete phase modulation, e.g. in which the phase of the carrier is modulated in a nominally instantaneous manner using more than one carrier, e.g. carriers with different phases using a pair of orthogonal carriers, e.g. quadrature carriers with more than two phase states
    • H04L27/2071Modulator circuits; Transmitter circuits for discrete phase modulation, e.g. in which the phase of the carrier is modulated in a nominally instantaneous manner using more than one carrier, e.g. carriers with different phases using a pair of orthogonal carriers, e.g. quadrature carriers with more than two phase states in which the data are represented by the carrier phase, e.g. systems with differential coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q2213/00Indexing scheme relating to selecting arrangements in general and for multiplex systems
    • H04Q2213/13031Pulse code modulation, PCM

Abstract

본 발명은 디퍼런셜 코드를 마이컴에서 수신하는 방법에 관한 것으로써, 입력데이터의 에지를 검출하여 펄스의 주기를 검출하는 제 1단계와, 카운터 버퍼가 설정된 시간이 되어 로우 인터럽트(overflow interrupt)가 발생하는 시간이 도달하기 전에 기준주파수의 2배인 펄스시간(T0)까지 측정할 수 있도록 상기 펄스시간과 증분시간을 합한 시간(T0+

Figure pat00001
)으로 타이머를 초기화하는 제 2단계와, 상기 제 1단계에서 출력되는 펄스에 의해 마이컴의 인터럽트단자에 신호가 인가되고 다음 인터럽트단자에 신호가 인가될 때까지의 시간을 계수하고, 계수한 시간을 마이컴(4)에서 읽는 제 3단계와 상기 제 3단계에서 읽은 시간을 비교하여 마이컴(4)에서 읽은 시간이 기준주파수 시간(TO/2)과 증분시간(
Figure pat00002
)을 합한 시간보다 크면 데이터값을 1로 인식하고, 읽은 시간이 기준주파수 시간(TO/2)과 증분시간(
Figure pat00003
)을 합한 시간보다 작으면 데이터값을 0으로 인식하여 인식한 데이터 값을 어큐뮤레이터(accumulator)에 전송하는 제 4단계와, 상기 4단계의 어큐뮤레이터에 기록되어 있는 데이터를 직렬 데이터 버퍼(serial data buffer)에 저장하는 제 5단계로 구성되어 있고, 입력 데이터의 각 에지를 검출하여 에지에서 다음 에지까지의 주기를 측정하여 측정불능 영역이 생기지 않고 모든 펄스를 입력받아 정확하게 입력데이터를 수신할 수 있다.The present invention relates to a method of receiving a differential code from a microcomputer, and includes a first step of detecting an edge of input data to detect a period of a pulse, and a low interrupt (overflow interrupt) when a counter buffer is set. The sum of the pulse time and the incremental time (T0 +) so that the pulse time (T0), which is twice the reference frequency, can be measured before the time reaches.
Figure pat00001
In step 2 of initializing the timer and counting the time until the signal is applied to the interrupt terminal of the microcomputer and the signal is applied to the next interrupt terminal by the pulse output in the first step. The time read by the microcomputer 4 is compared with the time read by the microcomputer 4 and the third step, and the reference frequency time TO / 2 and the incremental time (
Figure pat00002
) Is greater than the combined time, the data value is recognized as 1, and the read time is the reference frequency time (TO / 2) and the incremental time (
Figure pat00003
) Is less than the sum of the time, the fourth step of recognizing the data value as 0 and transmitting the recognized data value to the accumulator, and the data recorded in the accumulator of the step 4 to the serial data buffer ( serial data buffer), and it detects each edge of the input data and measures the period from edge to next edge to receive all input pulses accurately without receiving an unmeasurable area. Can be.

Description

디퍼런셜 코드를 마이컴에서 수신하는 방법{Method for receiving differential code at MICOM}How to receive differential code at MICOM {Method for receiving differential code at MICOM}

본 발명은 디퍼런셜 코드를 마이컴에서 수신하는 방법에 관한 것으로써, 보다 상세하게는 입력데이터의 에지에서 발생하는 펄스를 생성하여 마이컴의 인터럽트단자에 입력시키고, 다음 인터럽트까지의 시간을 측정하여 데이터를 구별하여 원하는 데이터를 수신할 수 있는 디퍼런셜 코드를 마이컴에서 수신방법에 관한 것이다.The present invention relates to a method of receiving a differential code from a microcomputer. More specifically, a pulse generated at an edge of input data is generated, inputted to an interrupt terminal of a microcomputer, and data is distinguished by measuring a time until the next interrupt. The present invention relates to a method of receiving a differential code from a microcomputer capable of receiving desired data.

메시지 신호를 표본화할 때 나이퀴스트율보다 좀더 빠르게 표본화시키면 결과적으로 인접하는 표본 사이의 상관 관계를 높혀주게 된다. 이러한 사실은 표본을 표준 PCM 방식으로 부호화한다면 결과적으로 부호화된 신호는 과잉한 정보를 포함하게 된다.When sampling message signals, sampling faster than the Nyquist rate results in higher correlation between adjacent samples. This fact means that if the sample is encoded using the standard PCM method, the resulting encoded signal will contain excess information.

이것은 변화가 거의 없는 공통된 신호부분까지 부호화한 결과로 생긴 과잉부호 할당을 의미하며 정보 전송에 있어서 꼭 필요하지 않는 신호부분이 부호화되어 있음을 나타낸다. 이 과잉한 정보를 부호화하기 전에 제거함으로써 더욱 효과적인 부호화를 얻는다. 즉 인접한 표본 펄스 사이의 차이만을 부호화하므로써 이와 같은 불필요한 정보를 배제할 수 있음과 동시에 상관이 높은 표본 사이의 차만을 양자화하고 부호화하므로써 효율화를 기대할 수 있다.This means that the over-signal assignment resulting from the encoding of the common signal part with little change, and the signal part which is not essential for information transmission, is encoded. More efficient encoding is obtained by removing this excess information before encoding. In other words, by only encoding the difference between adjacent sample pulses, such unnecessary information can be eliminated and efficiency can be expected by quantizing and encoding only the difference between samples having a high correlation.

이와 같이 특별히 어떤 시간까지 신호 크기의 변화 과정을 안다면 앞으로 변화될 신호 크기를 추론하는 것이 가능해진다. 이러한 과정을 예측이라 하는데 이와 같은 예측 방법을 이용하여 표본 신호를 변조하는 방식이 차분 부호변조(DPCM:differential PCM)방식이다. 적응 델타 변조나 적응 차분 부호변조도 이 방식에 속한다.In this way, it is possible to deduce the magnitude of the signal to be changed in the future if the signal amplitude is changed by a certain time. This process is called prediction, and a differential code modulation (DPCM) method is used to modulate a sample signal using this prediction method. Adaptive delta modulation or adaptive differential code modulation are also included in this scheme.

펄스 위상 변조 및 복조는 주로 디지탈 시스템 사이에 단선을 통하여 데이터를 전송하는데 사용되며, 본 발명은 디퍼런셜(differential) 코드에 관한 것이다. Pulse phase modulation and demodulation are mainly used to transfer data over a single wire between digital systems, and the present invention relates to differential codes.

디퍼런셜 코드의 동작을 도 1을 참조하여 설명하면 다음과 같다.The operation of the differential code is described with reference to FIG. 1 as follows.

디퍼런셜 코드의 구성도가 도 1에 도시된 바와 같이, 전송 선로로 부터 송신된 데이터 신호가 " 000111" 이라고 가정하여 설명한다.As shown in FIG. 1, the structure of the differential code is assumed on the assumption that the data signal transmitted from the transmission line is "000111".

0은 동기 클럭과 동일한 주파수(즉, 2배의 baud rate)로 표현되며, 바로 앞단이 0이었으면 파형은 하이에서 로우로 표현되고 앞단 1이었으면 로우에서 하이로 표현된다.Zero is represented at the same frequency as the synchronous clock (i.e. twice the baud rate), with the waveform leading from high to low if the leading edge was zero and from low to high if it was leading one.

1은 동기 클럭의 반주파수(동일 baud rate)로 표현되며, 0과 마찬가지로 앞단이 0이었으면 파형은 하이로 표현되고 앞단이 1이었으면 로우로 레벨변화만 하도록 동작한다.1 is represented by the half frequency (same baud rate) of the synchronous clock. Like 0, the waveform is expressed as high when the leading edge is 0, and when the leading edge is 1, only the level changes to low.

즉, 0일 때는 동일 주파수를 출력하고 1일 때는 반주파수만을 출력하면서 교대로 보수화(complement)시키도록 작용한다.In other words, when it is 0, the same frequency is output, and when it is 1, only half frequency is output and it is alternately complemented.

마이컴에 수신되는 데이터는 두 가지 형태로 전송되는데 하나는 데이터 통신에서 직렬전송의 변조 속도를 1초간에 전송되는 신호의 수로 나타낸 값인 보 레이트(baud rate)와 동일한 주파수로 이루어진 펄스열로 전송되고, 다른 하나는 보 레이트의 2배의 주파수로 이루어진 펄스열로 전송된다. 전자는 디코딩 후에 1로 변환되고, 후자는 디코딩 후에 0으로 변환된다.The data received by the microcomputer is transmitted in two forms, one in the data communication and the other in a pulse train composed of the same frequency as the baud rate, which represents the modulation rate of the serial transmission as the number of signals transmitted in one second. One is transmitted as a pulse train consisting of twice the frequency of the baud rate. The former is converted to 1 after decoding and the latter is converted to 0 after decoding.

상기의 두 가지 형태로 전송되는 데이터를 수신하여 0과 1를 구별하는 방법은 각 펄스의 주기를 판단하여 데이터를 구별하는 방법이 사용된다.As a method of distinguishing 0 and 1 by receiving data transmitted in the above two forms, a method of distinguishing data by determining a period of each pulse is used.

각 펄스의 주기를 판단하는 방법으로 가장 간단하면서 널리 이용되는 것은 마이컴내의 이벤트 카운터(event counter)의 펄스폭 측정모드를 이용한 방법이 있다. 이 방법은 펄스의 라이징 에지(rising edge)에서 폴링 에지(falling edge)까지의 폭을 측정하여 데이터의 주기를 판단하도록 동작한다.The simplest and most widely used method of determining the period of each pulse is the method using the pulse width measurement mode of the event counter in the microcomputer. The method operates to determine the period of data by measuring the width from the rising edge of the pulse to the falling edge.

그러나, 상기의 방법으로 각 펄스의 주기를 판단하는 방법은 펄스의 라이징 에지에서 폴링 에지까지의 폭만을 측정할 수 있으므로, 폴링 에지에서 라이징에지까지의 펄스의 폭 즉, (-)부분은 측정할 수 없는 문제점이 발생하고 있다. However, the method of determining the period of each pulse by the above method can measure only the width from the rising edge to the falling edge of the pulse, so that the width of the pulse from the falling edge to the rising edge, that is, the negative portion, is measured. Unexpected problems are occurring.

이에 본 발명은 이같은 문제점을 해결하기 위해 안출된 것으로써, 본 발명의 목적은 데이터의 펄스를 측정할 수 없는 부분이 발생되지 않도록 데이터의 모든 에지를 검출하여 에지에서 다음 에지까지의 주기를 측정할 수 있는 디퍼런셜 코드를 마이컴에서 수신하는 방법을 제공하는 데 있다.Therefore, the present invention has been devised to solve such a problem, and an object of the present invention is to detect all edges of data so that a period from which a pulse of data cannot be measured cannot be detected, and a period from edge to next edge is measured. It is to provide a way to receive differential code from microcomputer.

본 발명의 또 다른 목적은 입력데이터의 에지에서 발생하는 펄스파형을 마이컴의 인터럽트단자에 입력하고, 인터럽트가 발생하고 다음 인터럽트가 발생할 때까지의 시간을 계수하여 데이터를 구별하여 원하는 데이터를 수신할 수 있는 디퍼런셜 코드를 마이컴에서 수신하는 방법을 제공하는 데 있다.Another object of the present invention is to input the pulse waveform generated at the edge of the input data to the interrupt terminal of the microcomputer, count the time until the interrupt occurs and the next interrupt to distinguish the data to receive the desired data It is to provide a way to receive the differential code in the microcomputer.

상기의 목적을 달성하기 위한 본 발명은 전송되는 데이터 패킷을 입력받아 원하는 데이터를 출력하도록 프로그램되어진 코드를 마이컴에서 생성하는 방법에 있어서, 입력데이터의 에지를 검출하여 펄스의 주기를 검출하는 제 1단계와 카운터 버퍼가 풀되어 오버플로우 인터럽트(overflow interrupt)가 발생하는 시간이 도달하기 전에 기준주파수의 2배되는 펄스시간(T0)까지 측정할 수 있도록 충분한 시간(T0+

Figure pat00004
)으로 타이머를 초기화하는 제 2단계와 상기 제 1단계에서 출력되는 펄스에 의해 마이컴의 인터럽트단자에 신호가 인가되고 다음 인터럽트단자에 신호가 인가될 때까지의 시간을 계수하고, 계수한 시간을 마이컴에서 읽는 제 3단계와 상기 제 3단계에서 읽은 시간을 비교하여 마이컴에서 읽은 시간이 T0/2+
Figure pat00005
보다 크면 데이터 값을 1로 인식하고, 읽은 시간이 T0/2+
Figure pat00006
보다 작으면 데이터값을 0으로 인식하여 인식한 데이터 값을 어큐뮤레이터에 전송하는 제 4단계와 상기 4단계의 어큐뮤레이터에 기록되어 있는 데이터를 직렬 데이터 버퍼에 저장하는 제 5단계로 이루어진 것을 특징으로 한다.According to an aspect of the present invention, a microcomputer generates a code programmed to receive a transmitted data packet and output desired data, the method comprising: detecting a edge of input data to detect a period of a pulse; And enough time (T0 +) to measure up to a pulse time (T0) twice the reference frequency before the counter buffer is full and the time for overflow interrupt is reached.
Figure pat00004
The time until the signal is applied to the interrupt terminal of the microcomputer and the signal is applied to the next interrupt terminal by the pulse output in the first stage and the first stage of initializing the timer. The time read from the microcomputer is compared with the time read from the third step and the third step read from T0 / 2 +
Figure pat00005
Greater than 1, the data is recognized as 1, and the read time is T0 / 2 +
Figure pat00006
If it is smaller than 0, the data value is recognized as 0, and the fourth step of transmitting the recognized data value to the accumulator and the fifth step of storing data recorded in the accumulator of the fourth step in the serial data buffer. It features.

이하 본 발명의 바람직한 실시예를 첨부도면을 참조로 하여 상세히 설명한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 2는 본 발명에 따른 입력데이터의 에지를 검출하여 펄스의 주기를 검출하기 위한 회로도이다.2 is a circuit diagram for detecting the period of the pulse by detecting the edge of the input data according to the present invention.

도면부호 1은 입력데이터를 반전시키기 위한 버퍼용으로 쓰인 인버터이고, 도면부호 2는 저항(R)과 커패시터(C)에 의한 시정수를 만들어 파형을 시정수만큼 지연시켜주기 위한 적분기이고, 도면부호 3은 상기 인버터를 통과한 파형과 상기 적분기를 통과한 신호를 배타적 논리합하기 위한 배타적 오아게이트이고, 도면부호 4는 상기 배타적 오아게이트를 통과한 파형을 입력받아 펄스의 주기를 측정하여 디퍼런셜 코드를 수신하도록 프로그램 되어진 마이컴이다.Reference numeral 1 is an inverter used for a buffer for inverting input data, reference 2 is an integrator for delaying a waveform by the time constant by making time constants by resistors R and capacitors C. 3 is an exclusive ogate for exclusive OR of the waveform passing through the inverter and the signal passing through the integrator, and the reference numeral 4 receives a differential code by measuring a period of a pulse by receiving a waveform passing through the exclusive oragate. Microcomputer programmed to

도 3은 본 발명에 따른 입력데이터의 에지를 검출하여 펄스의 주기를 검출하기 위한 회로의 각 구간의 동작을 설명하기 위한 타이밍도이다.3 is a timing diagram illustrating an operation of each section of a circuit for detecting an edge of input data and detecting a period of a pulse according to the present invention.

입력데이터가 파형 a가고 가정하면, 인버터를 통과하면서 반전되고(b파형), 반전된 파형은 저항(R)과 커패시터(C)에 의한 시정수만큼 지연되어 출력된다(c파형). 인버터를 통과하면서 반전된 파형(b파형)과 이 파형(b파형)이 적분기를 통과하면서 시정수만큼 지연되어 출력된 파형(c파형)을 배타적 오아게이트에 연결하여 배타적 논리합하면, 입력데이터의 각 에지에서 시정수만큼의 펄스가 생성된다(d파형).If the input data is assumed to be waveform a, it is inverted while passing through the inverter (b waveform), and the inverted waveform is delayed by the time constant by the resistor R and the capacitor C and outputted (c waveform). When the inverted waveform (b waveform) and the waveform (b waveform) inverted while passing through the inverter are delayed by the time constant while passing through the integrator, the output waveform (c waveform) is connected to exclusive oragate and is logically exclusive. Time constant pulses are generated at the edge (d waveform).

이하에는 상기한 구성을 가지는 본 발명의 동작을 도 4를 참조하여 상세하게 설명한다.Hereinafter, the operation of the present invention having the above configuration will be described in detail with reference to FIG.

도 4는 본 발명에 따른 디퍼런셜 코드를 마이컴에서 수신하는 방법의 동작을 설명하기 위한 흐름도이다.4 is a flowchart illustrating an operation of a method of receiving a differential code in a microcomputer according to the present invention.

상기 도 4는 도면의 간략화를 위해 약어를 사용하였으며, 각 블록을 이루는 약어들의 설명은 아래와 같다.In FIG. 4, abbreviations are used for simplicity of the drawings, and descriptions of the abbreviations constituting each block are as follows.

A: AccumulatorA: Accumulator

CF: Carry FlagCF: Carry Flag

SBUF: Scrial data bufferSBUF: Scrial data buffer

CNT: " 0"(2f0 주파수)을 받은 횟수를 계수하기 위한 카운터 버퍼(counter buffer)CNT: counter buffer to count the number of times "0" (2f0 frequency) is received

CNT-ROT: 스타트(start) 비트에서 스탑(stop) 비트까지 수신된 비트의 횟수CNT-ROT: Number of bits received from start bit to stop bit

도 4에 도시된 바와 같이, 402단계에서는 입력데이터의 에지를 검출하는 단계이고, 404단계는 타이머를 초기화하는 단계로써, 타이머를 초기화하는 방법은 카운터 버퍼가 설정된 시간이 되어 오버플로우 인터럽트(overflow interrupt)가 발생의 횟수가 10인가를 판단한다.As shown in FIG. 4, in step 402, an edge of input data is detected, and in step 404, a timer is initialized. The method of initializing the timer is a time when a counter buffer is set. Determines whether the number of occurrences is 10.

상기 426단계에서 판단된 수신비트의 횟수가 10이면 스탑비트이므로 수신비트의 횟수를 클리어(428단계)시켜 상기 406단계로 진행하여 다음 데이터의 인터럽트를 수신하기 위해 준비하고, 수신비트의 횟수가 10이 아니면 데이터 비트이므로 캐리 플래그를 세트한다(430단계).If the number of received bits determined in step 426 is a stop bit, the stop bit is cleared (step 428) and the process proceeds to step 406 to prepare for receiving the next data interrupt, and the number of received bits is 10. Otherwise, the carry flag is set because it is a data bit (step 430).

반면, 상기 420단계에서 인터럽트간의 읽은시간이 T0/2+

Figure pat00007
보다도 적으면 이 데이터 값은 0이므로 432단계로 진행하여 0을 받은 횟수를 1증가시키고, 434단계로 진행하여 0을 받은 횟수가 2인가를 판단한다. 여기서,
Figure pat00008
는 증분시간을 의미하며, 그 시간은
Figure pat00009
이다.On the other hand, in step 420, the read time between interrupts is T0 / 2 +.
Figure pat00007
If the number is less than 0, the data value is 0, so the process proceeds to step 432 and the number of times of receiving zero is increased by one. here,
Figure pat00008
Means incremental time, which is
Figure pat00009
to be.

상기 434단계에서 판단에 의해 0을 받은 횟수가 2가 아니면 상기 406단계로 진행하여 다음 데이터의 인터럽트를 수신하기 위해 준비하고, 0을 받은 횟수가 2이면 436단계로 진행하여 카운터 버퍼를 클리어하고 수신비트의 횟수를 1증가(438단계) 시키고, 440단계로 진행하여 수신비트의 횟수가 1인가를 판단한다. 수신비트의 횟수가 1이면 상기 406단계로 진행하고, 수신비트의 횟수가 1이 아니면 442단계로 진행하여 수신비트의 횟수가 10인가를 판단한다. If the number of times 0 is determined to be 2 is not 2 in step 434, the process proceeds to step 406 to prepare for receiving an interrupt of the next data. The number of bits is increased by one (step 438), and the process proceeds to step 440 to determine whether the number of received bits is one. If the number of received bits is 1, the process proceeds to step 406. If the number of received bits is not 1, the process proceeds to step 442 and determines whether the number of received bits is 10.

상기 수신비트의 횟수가 10이면 데이터의 종료를 알리는 스탑비트이므로 에러를 발생시키고, 수신비트의 횟수가 10이 아니면 데이터 비트이므로 446단계로 행하여 캐리 플래그를 클리어시킨다.If the number of the received bits is 10, it is a stop bit for notifying the end of the data, and an error is generated. If the number of the received bits is not 10, the error is generated. In step 446, the carry flag is cleared.

그런 다음, 상기 430단계에서 세트된 캐리 플래그와 상기 446단계에서 클리어된 캐리 플래그를 입력받아 어큐뮤레이터를 왼쪽으로 쉬프트(448단계)시키고, 다시 한 번 수신비트의 횟수가 10인가를 판단한다(450단계). 수신비트의 횟수가 10이 아니면 입력될 데이터값이 더 있으므로 상기 406단계로 진행하여 다음 데이터를 받을 준비를 하고, 수신비트의 횟수가 10이면 어큐뮤레이터 값이 데이터 값이므로 다음 데이터를 수신하기 위해 수신비트의 횟수를 클리어(452단계)시키고, 어큐뮤레이터 값을 직렬 데이터 버퍼(serial data buffer)에 저장한다(454단계). Then, the carry flag set in step 430 and the carry flag cleared in step 446 are inputted, and the accumulator is shifted to the left (step 448), and it is determined whether the number of received bits is 10 again. Step 450). If the number of received bits is not 10, there are more data values to be input, so the process proceeds to step 406 to receive the next data. If the number of received bits is 10, the accumulator value is a data value to receive the next data. The number of received bits is cleared (step 452), and the accumulator value is stored in a serial data buffer (step 454).

이처럼, 입력데이터의 에지에서 발생하는 펄스파형을 인터럽트단자에 입력하고, 상기 인터럽트가 발생하고 다음 인터럽트가 발생할 때까지의 시간을 계수하여 데이터를 구별하여 수신할 수 있어 필요한 데이터의 모든 에지를 검출하여 다음 에지까지의 주기를 측정한다.In this way, the pulse waveform generated at the edge of the input data is input to the interrupt terminal, the time from the occurrence of the interrupt to the next interrupt can be counted, and the data can be distinguished and received. Measure the period to the next edge.

이상에서와 같이 본 발명에 따른 디퍼런셜 코드를 마이컴에서 수신하는 방법에 의하면, 입력데이터의 각 에지를 검출하여 에지에서 다음 에지까지의 주기를 측정하여 측정불능영역이 생기지 않고 모든 펄스를 입력받아 정확하게 입력데이터를 수신할 수 있다.As described above, according to the method of receiving the differential code according to the present invention, the microcomputer detects each edge of the input data and measures the period from the edge to the next edge to receive all pulses without inputting an accurate measurement region. Data can be received.

또한, 마이컴을 이용하여 디퍼런셜 코드를 수신하기 때문에 디퍼런셜 코드가 수신되는 시간을 최소화할 수 있고, 보다 정확한 데이터를 수신할 수 있는 효과가 있다.In addition, since the differential code is received using the microcomputer, the time for receiving the differential code can be minimized, and more accurate data can be received.

도 1은 디퍼런셜 코드의 구성도.1 is a configuration diagram of a differential code.

도 2는 본 발명에 따른 입력데이터의 에지를 검출하기 위한 회로도.2 is a circuit diagram for detecting an edge of input data according to the present invention;

도 3은 상기 도 2의 타이밍도.3 is a timing diagram of FIG.

도 4a는 본 발명에 따른 디퍼런셜 코드를 마이컴에서 수신하는 방법의 동작을 설명하기 위한 흐름도.4A is a flowchart for explaining an operation of a method for receiving a differential code at a microcomputer according to the present invention;

도 4b는 본 발명에 따른 디퍼런셜 코드를 마이컴에서 수신하는 방법의 동작을 설명하기 위한 흐름도.4B is a flowchart for explaining an operation of a method of receiving a differential code at a microcomputer according to the present invention;

<도면의 주요 부분에 대한 부호의 설명><Description of the code | symbol about the principal part of drawing>

1: 버퍼용 인버터 2: 적분기1: buffer inverter 2: integrator

3: 배타적 오아게이트 4: 마이컴3: exclusive oragate 4: micom

Claims (4)

프로그램되어진 코드를 마이컴에서 생성할 수 있도록 디퍼런셜 코드를 마이컴에서 수신하는 방법에 있어서, In the method of receiving the differential code in the microcomputer to generate the programmed code in the microcomputer, 입력데이터의 에지를 검출하여 펄스의 주기를 검출하는 제 1단계와,A first step of detecting a period of a pulse by detecting an edge of the input data; 카운터 버퍼가 설정된 시간이 되어 로우 인터럽트(overflow interrupt)가 발생하는 시간이 도달하기 전에 기준주파수의 2배인 펄스시간(TO)까지 측정할 수 있도록 상기 펄스시간과 증분시간을 합한 시간(TO+
Figure pat00010
)으로 타이머를 초기화하는 제 2단계와,
The sum of the pulse time and the incremental time (TO +) so that the counter buffer can measure up to the pulse time (TO), which is twice the reference frequency, before the time when the overflow interrupt occurs is reached.
Figure pat00010
A second step of initializing the timer,
상기 제 1단계에서 출력되는 펄스에 의해 마이컴의 인터럽트단자에 신호가 인가되고 다음 인터럽트단자에 신호가 인가될 때까지의 시간을 계수하고, 계수한 시간을 마이컴(4)에서 읽는 제 3단계와,A third step of counting the time until the signal is applied to the interrupt terminal of the microcomputer by the pulse output in the first step and the signal is applied to the next interrupt terminal, and reading the counted time by the microcomputer 4; 상기 제 3단계에서 읽은 시간을 비교하여 마이컴(4)에서 읽은 시간이 기준주파수 시간(T0/2)과 증분시간(
Figure pat00011
)을 합한 시간보다 크면 데이터값을 1로 인식하고, 읽은 시간이 기준주파수 시간(TO+2)과 증분시간(
Figure pat00012
)을 합한 시간보다 작으면 데이터값을 0으로 인식하여 인식한 데이터 값을 어큐뮤레이터(accumulator)에 전송하는 제 4단계와,
The time read by the microcomputer 4 is compared with the time read in the third step so that the reference frequency time (T0 / 2) and the increment time (
Figure pat00011
) Is greater than the combined time, and the data value is recognized as 1, and the read time is the reference frequency time (TO + 2) and the incremental time (
Figure pat00012
) Is less than the sum of the time and the fourth step of recognizing the data value as 0 and transmitting the recognized data value to the accumulator,
상기 4단계의 어큐뮤레이터에 기록되어 있는 데이터를 직렬 데이터 버퍼(serial data buffer)에 저장하는 제 5단계A fifth step of storing data recorded in the accumulator of step 4 in a serial data buffer; 로 이루어진 것을 특징으로 하는 디퍼런셜 코드를 마이컴에서 수신하는 방법.Receiving a differential code from the microcomputer, characterized in that consisting of. (여기서,
Figure pat00013
는 증분시간을 의미하며, 그 시간은
Figure pat00014
임.)
(here,
Figure pat00013
Means incremental time, which is
Figure pat00014
being.)
제 1항에 있어서, 상기 제 1단계는The method of claim 1, wherein the first step 버퍼용으로 쓰인 인버터(1)를 이용하여 입력데이터를 반전시키는 단계와,Inverting the input data using the inverter 1 used for the buffer, 상기 인버터(1)에서 반전된 파형을 저항(R)과 커패시터(C)로 이루어진 적분기(2)에 의해 시정수만큼 파형을 지연시키는 단계와,Delaying the waveform by the time constant by the integrator (2) consisting of the resistor (R) and the capacitor (C); 상기 인버터(1)를 통과한 파형과 상기 적분기(2)를 통과한 신호를 배타적 오아게이트(3)에 연결하여 입력데이터의 에지에서 상기 적분기(2)의 시정수에 해당하는 펄스폭만큼의 펄스를 발생하여 이 출력파형을 마이컴(4)의 인터럽트단자에 연결하는 단계The waveform passing through the inverter 1 and the signal passing through the integrator 2 are connected to an exclusive oar gate 3 so that a pulse width corresponding to the time constant of the integrator 2 at the edge of the input data is obtained. Generating and connecting this output waveform to the interrupt terminal of the microcomputer (4). 로 이루어진 것을 특징으로 하는 디퍼런셜 코드를 마이컴에서 수신하는 방법.Receiving a differential code from the microcomputer, characterized in that consisting of. 제 1항에 있어서, 상기 제 4단계는The method of claim 1, wherein the fourth step (a) 데이터 값이 1일 때 수신비트의 수를 1증가시키고, 수신비트의 횟수를 판단하는 단계와,(a) increasing the number of received bits by 1 when the data value is 1, and determining the number of received bits; (b) 상기 (a)단계에서 판단된 수신비트의 횟수가 1일 때 스타트 비트로 인식하고, 다음 데이터의 인터럽트 신호를 수신하기 위해 대기하는 단계와,(b) recognizing as a start bit when the number of received bits determined in step (a) is 1, and waiting to receive an interrupt signal of the next data; (c) 상기 (a)단계에서 판단된 수신비트의 횟수가 10일 때 스탑 비트로 인식하고, 수신비트의 횟수를 클리어시켜 다음 데이터의 인터럽트 신호를 수신하기 위해 대기하는 단계와,(c) recognizing a stop bit when the number of received bits determined in step (a) is 10, clearing the number of received bits, and waiting to receive an interrupt signal of the next data; (d) 상기 (a)단계에서 판단된 수신비트의 횟수가 2~9일 때 데이터 비트로 인식하고, 캐리 플래그를 1로 세트하는 단계(d) recognizing data bits when the number of received bits determined in step (a) is 2 to 9 and setting the carry flag to 1 로 이루어진 것을 특징으로 하는 디퍼런셜 코드를 마이컴에서 수신하는 방법. Receiving a differential code from the microcomputer, characterized in that consisting of. 제 1항에 있어서, 상기 제 4단계는The method of claim 1, wherein the fourth step (e) 데이터 값이 0일 때 카운터 버퍼에서 0을 받은 횟수를 판단하는 단계와,(e) determining the number of times 0 is received from the counter buffer when the data value is 0; (f) 수신비트의 수를 1증가시키고, 수신비트의 횟수를 판단하는 단계와,(f) increasing the number of received bits by one and determining the number of received bits; (g) 상기 (f)단계에서 판단된 수신비트의 횟수가 1일 때 스타트 비트로 인식하고, 다음 데이터의 인터럽트 신호를 수신하기 위해 대기하는 단계와,(g) recognizing it as a start bit when the number of received bits determined in step (f) is 1, and waiting to receive an interrupt signal of the next data; (h) 상기 (f)단계에서 판단된 수신비트의 횟수가 10일 때 스탑 비트로 인식하고, 에러를 발생하는 단계와,(h) recognizing a stop bit when the number of received bits determined in step (f) is 10 and generating an error; 상기 (e)단계에서 수신비트의 횟수가 2∼9일 때 데이터 비트로 인식하고, 캐리 플래그를 0으로 세트하는 단계로 이루어진 것을 특징으로 하는 디퍼런셜 코드를 마이컴에서 수신하는 방법. And recognizing the data bits when the number of the received bits is 2 to 9 in the step (e), and setting the carry flag to 0.
KR1019970068623A 1997-12-13 1997-12-13 Method for receiving differential code at micom KR100526938B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1019970068623A KR100526938B1 (en) 1997-12-13 1997-12-13 Method for receiving differential code at micom

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1019970068623A KR100526938B1 (en) 1997-12-13 1997-12-13 Method for receiving differential code at micom

Publications (2)

Publication Number Publication Date
KR19990049651A KR19990049651A (en) 1999-07-05
KR100526938B1 true KR100526938B1 (en) 2006-02-13

Family

ID=37178731

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1019970068623A KR100526938B1 (en) 1997-12-13 1997-12-13 Method for receiving differential code at micom

Country Status (1)

Country Link
KR (1) KR100526938B1 (en)

Also Published As

Publication number Publication date
KR19990049651A (en) 1999-07-05

Similar Documents

Publication Publication Date Title
US5903613A (en) Data reception device, data reception method and electronic equipment
GB1578635A (en) Dc free encoding for data transmission system
KR100526938B1 (en) Method for receiving differential code at micom
CA1215781A (en) Biphase signal receiver
US6928569B2 (en) Automatic output delay timing adjustment for programmable glitch filter
KR100435559B1 (en) Method for receiving differential code in micom, especially time of receiving differential code is minimized
JP3347848B2 (en) Multi-level signal decoding circuit
US4578720A (en) Self-clocking code demodulator with error detecting capability
KR20000003082A (en) Differential code receiving method in mycom
EP0371357B1 (en) Method of determination of signal reception time by means of correlation technique
KR100435560B1 (en) Method for receiving differential code in micom, especially data inputted into int1 and int2 is separated
EP0049059B1 (en) Pulse code demodulator for frequency shift keyed data
KR19990049644A (en) How to generate differential code in microcomputer
JPH0738630B2 (en) Digital pattern decoder and decoding method
SU1672581A1 (en) Device for receiving monitoring information
KR100257372B1 (en) A restorative circuit of signal using differential code
US7064686B2 (en) Method of determining a data rate and apparatus therefor
SU946005A1 (en) Device for measuring quantization characteristic of pulse-code modulated signal transmitter
JPS6363949B2 (en)
RU1795446C (en) Multichannel device for code comparison
SU856023A1 (en) Device for quality control of communication channel
US20020114399A1 (en) Method and apparatus for bit-wise synchronous decoding of serial communication data
JP2003298663A (en) Data communication equipment and method therefor
SU1075424A1 (en) Device for quality control of communication channel
SU924641A1 (en) Device for measuring physical values with digital registration of results

Legal Events

Date Code Title Description
N231 Notification of change of applicant
A201 Request for examination
E902 Notification of reason for refusal
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: 20101102

Year of fee payment: 6

LAPS Lapse due to unpaid annual fee