KR100555644B1 - transmitting/receiving method of bit stream - Google Patents

transmitting/receiving method of bit stream Download PDF

Info

Publication number
KR100555644B1
KR100555644B1 KR1020030065383A KR20030065383A KR100555644B1 KR 100555644 B1 KR100555644 B1 KR 100555644B1 KR 1020030065383 A KR1020030065383 A KR 1020030065383A KR 20030065383 A KR20030065383 A KR 20030065383A KR 100555644 B1 KR100555644 B1 KR 100555644B1
Authority
KR
South Korea
Prior art keywords
bit
bit stream
interrupt signal
interrupt
host device
Prior art date
Application number
KR1020030065383A
Other languages
Korean (ko)
Other versions
KR20050029065A (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 KR1020030065383A priority Critical patent/KR100555644B1/en
Publication of KR20050029065A publication Critical patent/KR20050029065A/en
Application granted granted Critical
Publication of KR100555644B1 publication Critical patent/KR100555644B1/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/382Information transfer, e.g. on bus using universal interface adapter
    • 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/10Program control for peripheral devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)

Abstract

비트 스트림 송/수신방법이 개시된다. 본 발명에 따른 비트 스트림 수신방법은, 일 비트 스트림이 범용 입력단자로 입력된 경우, 입력된 첫번째 비트가 시작비트인지 여부를 판단하는 단계, 판단 결과 시작비트인 경우 호스트장치 및 슬레이브장치 사이의 비트당 전송시간마다 인터럽트 신호를 발생하도록 인터럽트 발생수단을 인에이블링하여 조정하는 단계, 및 조정된 인터럽트 발생수단의 각 인터럽트 신호에 기초하여 비트 스트림의 전송대상 비트인 데이터비트를 검출하는 단계를 포함한다. 본 발명에 의하면, UART를 구비하지 않아도 되므로 슬레이브장치의 생산원가를 절감할 수 있다. A bit stream transmission / reception method is disclosed. In the bit stream receiving method according to the present invention, when one bit stream is input to a general-purpose input terminal, determining whether the first bit input is a start bit, and if the start bit is a result, a bit between the host device and the slave device. Enabling and adjusting the interrupt generating means to generate an interrupt signal at each transmission time, and detecting a data bit that is a transmission target bit of the bit stream based on each interrupt signal of the adjusted interrupt generating means; . According to the present invention, since the UART does not need to be provided, the production cost of the slave device can be reduced.

비트 스트림, 호스트장치, 슬레이브장치 Bit stream, host device, slave device

Description

비트 스트림 송/수신방법{transmitting/receiving method of bit stream}Bitstream transmission / receiving method of bit stream

도 1은 본 발명에 따른 비트 스트림 송/수신방법이 적용될 호스트장치 및 슬레이브장치의 블록도,1 is a block diagram of a host device and a slave device to which a bit stream transmission / reception method according to the present invention is applied;

도 2는 도 1의 마이컴의 내부 블록도,2 is an internal block diagram of the microcomputer of FIG. 1;

도 3은 본 발명에 따른 비트 스트림 수신방법을 설명하기 위한 플로우 차트,3 is a flowchart illustrating a method of receiving a bit stream according to the present invention;

도 4는 도 3의 수신방법에 따라 비트 스트림의 검출시점을 설명하기 위한 타이밍도,4 is a timing diagram for explaining a detection point of a bit stream according to the reception method of FIG. 3.

도 5는 본 발명에 따른 비트 스트림 송신방법을 설명하기 위한 플로우 차트, 그리고5 is a flowchart illustrating a bit stream transmission method according to the present invention;

도 6은 도 5의 송신방법에 따라 비트 스트림의 송신시점을 설명하기 위한 타이밍도이다.FIG. 6 is a timing diagram illustrating a timing of transmitting a bit stream according to the transmitting method of FIG. 5.

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

110 : 마이컴 111 : 입력단자 110: microcomputer 111: input terminal

112 : 레지스터 113 : 타이머/카운터 112: Register 113: Timer / Counter

114 : 인터럽트 신호 발생기 115 : 출력단자 114: interrupt signal generator 115: output terminal

116 : 제어 회로116: control circuit

본 발명은 비트 스트림 송/수신방법에 관한 것으로, 보다 상세하게는 범용 비동기 송/수신기(Universal Asynchronous Receiver and Transmitter:UART,이하 'UART'라고 함)가 구비된 호스트장치 및 범용 입/출력단자(general purpose input/output terminal)와 인터럽트 발생수단이 구비된 슬레이브장치 사이에서 비트 스트림을 송/수신하는 방법에 관한 것이다.The present invention relates to a bit stream transmission / reception method, and more particularly, a host device and a universal input / output terminal equipped with a universal asynchronous receiver and transmitter (UART, hereinafter referred to as “UART”). The present invention relates to a method for transmitting / receiving a bit stream between a general purpose input / output terminal) and a slave device having interrupt generating means.

일반적으로 컴퓨터와 같은 호스트장치와 이의 주변기기와 같은 슬레이브장 치는 각각 UART를 구비한다. 일반적으로 UART는 UART 규약에 의하여 시작비트, 정지비트, 패리티(parity)비트를 생성하고 제거한다. 또한 비트 스트림을 송신할 때 UART는 병렬/직렬 변환을 통해 바이트(byte) 병렬 데이터를 직렬 비트 스트림으로 변환한다. 반면에 직렬 비트 스트림을 수신할 때 UART는 채널을 통해 수신된 직렬 비트 스트림을 직렬/병렬 변환하여 바이트 병렬 데이터로 변환하고, 이를 CPU로 전송한다. In general, host devices such as computers and slave devices such as peripherals each have a UART. In general, UART generates and removes start bit, stop bit, and parity bit according to UART protocol. Also, when transmitting a bit stream, the UART converts byte parallel data into a serial bit stream through parallel / serial conversion. On the other hand, when receiving a serial bit stream, the UART converts the serial bit stream received through the channel into serial parallel data and converts it into byte parallel data, and transmits it to the CPU.

종래에는 UART이 호스트장치 및 슬레이브장치에 모두 구비되었다. 따라서 제품이 대량으로 생산되고 있는 요즘의 추세를 고려한다면 양 장치에서의 UART는 생산원가를 높인다는 문제점이 있다. 특히 요즘과 같이 제품에 많은 기능이 요구되어 슬레이브장치가 하나 이상 구비되는 경우에 각 장치마다 UART을 구비한다는 것은 생산원가를 더욱 높이게 될 것이다. 그리고 각 슬레이브장치마다 UART가 구비될 경우 PCB(printed circuit board)를 복잡한다는 문제점이 있으며 또한 인터페이스를 위한 UART 규약이 하드웨어적으로 미리 결정되므로 규약의 변화를 위해서는 하드웨어적인 변경이 있어야 한다는 복잡함이 있다. Conventionally, the UART is provided in both the host device and the slave device. Therefore, considering the current trend of mass production of products, there is a problem that the UART in both devices increases the production cost. In particular, when a lot of functions are required in a product such as nowadays, when one or more slave devices are provided, the provision of a UART for each device will further increase the production cost. In addition, there is a problem in that a printed circuit board (PCB) is complicated when a UART is provided for each slave device. Also, since a UART protocol for an interface is predetermined in hardware, there is a complexity that a hardware change is required for the protocol change.

본 발명은 상기한 바와 같은 문제를 해소하기 위해 안출된 것으로, 본 발명의 목적은 슬레이브장치 내에 UART를 별도로 구비하지 않고, 소정시간 간격으로 발생되는 인터럽트 신호를 이용하여 호스트장치의 UART로부터 수신된 비트 스트림 내의 각 비트를 검출할 수 있으며, 소정시간 간격으로 발생되는 인터럽트 신호를 이용하여 소정 비트 스트림을 전송할 수 있는 비트 스트림 송/수신방법을 제공하는 데 있다. The present invention has been made to solve the above problems, and an object of the present invention is to provide a bit received from a UART of a host device using an interrupt signal generated at predetermined time intervals without a separate UART in a slave device. The present invention provides a bit stream transmitting / receiving method capable of detecting each bit in a stream and transmitting a predetermined bit stream using an interrupt signal generated at predetermined time intervals.

상기와 같은 기술적 과제를 달성하기 위해서, 본 발명은 범용 비동기 송/수신기(Universal Asynchronous Receiver and Transmitter)가 구비된 호스트장치로부터 범용 입력단자(general purpose input terminal)와 인터럽트 발생수단이 구비된 슬레이브장치로 비트 스트림을 전송하는 방법에 있어서, 일 비트 스트림이 상기 범용 입력단자로 입력된 경우, 입력된 첫번째 비트가 시작비트인지 여부를 판단하는 단계, 판단 결과 상기 시작비트인 경우, 상기 호스트장치 및 상기 슬레이브장치 사이의 비트당 전송시간마다 인터럽트 신호를 발생하도록 상기 인터럽트 발생수단을 인에이블링하여 조정하는 단계 및 조정된 상기 인터럽트 발생수단의 각 인터럽트 신호에 기초하여 상기 비트 스트림의 전송대상 비트인 데이터비트를 검출하는 단계를 포함한다.In order to achieve the above technical problem, the present invention provides a slave device having a general purpose input terminal and an interrupt generating means from a host device equipped with a universal asynchronous receiver and a transmitter. In the method for transmitting a bit stream, if one bit stream is input to the general-purpose input terminal, determining whether the input first bit is a start bit, if the determination result is the start bit, the host device and the slave Enabling and adjusting the interrupt generating means to generate an interrupt signal at each transmission time per bit between devices and based on each interrupt signal of the adjusted interrupt generating means, a data bit which is a transmission target bit of the bit stream. Detecting.

상기 조정 단계는, 판단 결과 상기 시작비트인 경우, 상기 호스트장치로부터 상기 슬레이브장치로의 데이터 전송속도에 기초하여 상기 비트당 전송시간을 연산하는 단계, 및 연산된 상기 비트당 전송시간마다 인터럽트 신호를 발생하도록 상기 인터럽트 발생수단을 인에이블링하여 조정하는 단계를 포함한다.In the adjusting step, when the start bit is the start bit, calculating the transmission time per bit based on the data transmission rate from the host device to the slave device, and generating an interrupt signal for each calculated transmission time per bit. Enabling and adjusting said interrupt generating means to generate.

상기 검출 단계에서, 첫번째 인터럽트 신호는 상기 시작비트의 검출시점으로부터 상기 비트당 전송시간에 기초한 비트검출 조정시간이 경과한 후에 발생하며,상기 비트검출 조정시간은 상기 비트당 전송시간의 1.5배에 해당하는 시간인 것이 바람직하다.In the detecting step, the first interrupt signal is generated after the bit detection adjustment time based on the transmission time per bit has elapsed from the detection time of the start bit, and the bit detection adjustment time corresponds to 1.5 times the transmission time per bit. It is preferable that it is time to make.

이하, 본 발명의 바람직한 일실시예로서 비트 스트림 송/수신방법을 첨부도면과 관련하여 상세히 설명하기로 한다. Hereinafter, as a preferred embodiment of the present invention, a bit stream transmission / reception method will be described in detail with reference to the accompanying drawings.

도 1은 본 발명에 따른 비트 스트림 송/수신방법이 적용되는 호스트장치(200) 및 슬레이블장치(100)의 블록도이다. 본 발명에 따르면, 호스트장치(200) 및 슬레이브장치(100) 사이에서 각 채널을 통해 비트 스트림을 송/수신하는 경우, 호스트장치(200)에만 UART(220)가 구비되어 비트 스트림을 송/수신한다. 호스트장치(200)로부터 소정 데이터를 송신할 때 호스트장치(200) 내 CPU(210)로부터의 병렬 데이터는 UART(220)로 전달되고, 전달된 병렬 데이터는 UART(220)에 의해 병렬/직렬 변환을 하여 슬레이브장치(100)로 전송된다. 이에 슬레이브장치(100)의 마이컴(110)은 전송된 비트 스트림을 수신하여 본 발명에 따른 데이터 수신방법에 따라 비트 스트림의 각 비트를 검출한다. 또한 호스트장치(200)로 소정 데이터를 송신할 때 슬레이브장치(100) 내 마이컴(110)으로부터의 병렬 데이터는 본 발명 에 따른 비트 스트림 송신방법에 따라 호스트장치(200)로 전송된다. 즉 본 발명에 따르면 슬레이브장치(100)의 경우에는 UART(220)가 구비되지 않고 슬레이브장치(100) 내 마이컴(110)이 본 발명에 따른 송신방법을 수행하도록 프로그램밍되어 UART(220)를 대신한다.1 is a block diagram of a host device 200 and a slave device 100 to which a bit stream transmission / reception method according to the present invention is applied. According to the present invention, when the bit stream is transmitted / received through each channel between the host device 200 and the slave device 100, only the host device 200 is provided with a UART 220 to transmit / receive the bit stream. do. When transmitting predetermined data from the host device 200, the parallel data from the CPU 210 in the host device 200 is transferred to the UART 220, and the transferred parallel data is parallel / serial converted by the UART 220. Is transmitted to the slave device (100). The microcomputer 110 of the slave device 100 receives the transmitted bit stream and detects each bit of the bit stream according to the data receiving method according to the present invention. In addition, when transmitting predetermined data to the host device 200, parallel data from the microcomputer 110 in the slave device 100 is transmitted to the host device 200 according to the bit stream transmission method according to the present invention. That is, according to the present invention, in the case of the slave device 100, the UART 220 is not provided, and the microcomputer 110 in the slave device 100 is programmed to perform the transmission method according to the present invention and replaces the UART 220. .

도 2는 본 발명에 따른 데이터비트 송/수신방법을 수행하는 마이컴(110)의 블록도이다. 본 발명에 따른 마이컴(110)은 입력단자(111), 레지스터(112), 타이머/카운터(113), 인터럽트 신호 발생기(114), 출력단자(115) 및 제어회로(116)를 포함한다.2 is a block diagram of a microcomputer 110 for performing a data bit transmission / reception method according to the present invention. The microcomputer 110 according to the present invention includes an input terminal 111, a register 112, a timer / counter 113, an interrupt signal generator 114, an output terminal 115, and a control circuit 116.

입력단자(111)는 호스트장치(200)로부터 전송되는 비트 스트림을 입력받는다. 입력단자(111)로는 범용 핀(general purpose pin)을 적용하는 것이 바람직하다. 범용 핀은 마이컴(110)의 제조과정시에 특정 용도를 위해 제작되지 않는 핀을 말한다. 따라서 사용자에 의한 프로그래밍을 통해서 소정 용도로 사용될 수 있다.The input terminal 111 receives a bit stream transmitted from the host device 200. It is preferable to apply a general purpose pin as the input terminal 111. The general purpose pin refers to a pin that is not manufactured for a specific use in the manufacturing process of the microcomputer 110. Therefore, it can be used for a predetermined purpose through programming by a user.

레지스터(112)는 저장수단으로서, 호스트장치(200) 및 슬레이브장치(100) 사이의 비트 스트림의 전송속도인 데이터 전송속도 정보를 저장한다. 통상적으로 데이터 전송속도의 단위는 bps(bit per second)이다. 그리고 레지스터(112)는 초기 설정된 데이터비트 값 정보를 저장한다. 여기서 데이터비트는 CPU(210) 또는 마이컴(110)이 전송하고자 하는 비트이며, 데이터비트 정보는 각 비트 스트림을 통해 전송되는 데이터비트의 비트 수를 의미한다.The register 112 is a storage means and stores data transmission rate information, which is a transmission rate of a bit stream between the host apparatus 200 and the slave apparatus 100. Typically, the unit of data rate is bps (bit per second). The register 112 stores the initially set data bit value information. Here, the data bits are bits to be transmitted by the CPU 210 or the microcomputer 110, and the data bit information means the number of bits of the data bits transmitted through each bit stream.

타이머/카운터(113)는 제어회로(116)에 의한 제어를 통해 소정 주기의 클럭을 생성한다. 또한 제어회로(116)에 의한 제어를 통해 비트 스트림의 각 비트가 수 신되어 검출되는 경우마다 또는 비트 스트림 내 각 비트가 송신되는 경우마다 카운팅 값을 1만큼 증가시키면서 카운팅 동작을 수행한다. 또한 타이머/카운터(113)는 제어회로(116)의 제어를 통해 소정시간 간격으로 인터럽트 신호 발생기(114)로 제어신호를 전송한다. 타이머/카운터(113)에 있어서, 시작비트가 검출된 시점으로부터 비트당 전송시간의 1.5배의 시간이 경과한 시점이 첫번째 제어신호의 전송시점이 되고, 이후부터는 매 비트당 전송시간이 경과할 때마다 제어신호를 각각 생성하여 인터럽트 신호 발생기(114)로 전송하도록 구현하는 것이 바람직할 것이다. 인터럽트 신호 발생기(114)는 제어신호에 기초하여 인터럽트 신호를 생성하여 제어회로(116)로 전송한다. The timer / counter 113 generates a clock of a predetermined period through control by the control circuit 116. In addition, the counting operation is performed by increasing the counting value by 1 whenever each bit of the bit stream is received and detected through the control by the control circuit 116 or when each bit in the bit stream is transmitted. In addition, the timer / counter 113 transmits a control signal to the interrupt signal generator 114 at predetermined time intervals under the control of the control circuit 116. In the timer / counter 113, the time when 1.5 times the transmission time per bit has elapsed from the time when the start bit is detected becomes the transmission time of the first control signal, and when the transmission time for each bit elapses thereafter. It may be preferable to generate each control signal for each transmission and transmit the control signal to the interrupt signal generator 114. The interrupt signal generator 114 generates an interrupt signal based on the control signal and transmits the interrupt signal to the control circuit 116.

인터럽트 신호 발생기(114)는 타이머/카운터(113)의 제어신호에 따라 인터럽트 신호를 발생한다. 발생된 인터럽트 신호는 제어회로(116)에 전송되고, 제어회로(116)는 인터럽트 신호에 따라 마이컴(110)으로 수신된 비트 스트림 내 각 비트를 검출한다. 또한 데이터 송신의 경우에는 발생된 인터럽트 신호마다 각 비트를 전송한다. The interrupt signal generator 114 generates an interrupt signal according to the control signal of the timer / counter 113. The generated interrupt signal is transmitted to the control circuit 116, and the control circuit 116 detects each bit in the bit stream received by the microcomputer 110 in accordance with the interrupt signal. In the case of data transmission, each bit is transmitted for each generated interrupt signal.

출력단자(115)는 슬레이브장치(100)로부터 호스트장치(200)로 비트 스트림을 전송할 때 사용되며, 또한 범용 핀을 적용하는 것이 바람직하다.The output terminal 115 is used to transmit a bit stream from the slave device 100 to the host device 200, and it is preferable to apply a general purpose pin.

제어회로(116)는 입력단자(111)로 소정 비트 스트림이 입력된 경우 입력된 비트 스트림의 첫번째 비트가 시작비트인지 여부를 판단한다. 제어회로(116)는 판단 결과 시작비트인 경우 타이머/카운터(113)가 인에이블되도록 제어한다. 또한 판단 결과 시작비트인 경우 레지스터(112)에 저장된 데이터 전송속도 정보에 기초하 여 비트당 전송시간을 연산한다. When a predetermined bit stream is input to the input terminal 111, the control circuit 116 determines whether the first bit of the input bit stream is a start bit. The control circuit 116 controls the timer / counter 113 to be enabled when the determination result is the start bit. In addition, when the determination result is the start bit, the transmission time per bit is calculated based on the data transmission rate information stored in the register 112.

또한 제어회로(116)는 타이머/카운터(113)가 인터럽트 신호 발생기(114)로 비트당 전송시간마다 제어신호를 전송하도록 제어한다. 상기에서 언급한 바와 같이 데이터 수신의 경우에 있어서 첫번째 제어신호의 전송시점을 시작비트가 입력된 시점으로부터 비트당 전송시간의 1.5배에 해당하는 시간이 경과한 시점이 되도록 제어하는 것이 바람직하다.The control circuit 116 also controls the timer / counter 113 to transmit the control signal at every transmission time per bit to the interrupt signal generator 114. As mentioned above, in the case of data reception, it is preferable to control the transmission time of the first control signal so that the time corresponding to 1.5 times the transmission time per bit has elapsed from the time when the start bit is input.

그리고 데이터 수신의 경우에, 제어회로(116)는 비트 스트림 내 각 비트의 검출에 따라 증가된 타이머/카운터(113)의 카운팅 값 및 레지스터(112)에 기저장된 데이터비트 값이 상호 동일한지 여부를 판단한다. 판단 결과, 동일하지 않은 경우 제어회로(116)는 타이머/카운터(113)를 제어하여 카운팅 값이 1만큼 증가되도록, 그리고 다음 비트를 검출하도록 제어한다. 판단 결과 동일한 경우 제어회로(116)는 데이터비트의 다음 비트가 정지비트인지 여부를 판단한다. 판단 결과, 정지비트인 경우 제어회로(116)는 타이머/카운터(113)가 디스인에이블되도록 제어한다. 판단 결과, 정지비트가 아닌 경우 제어회로(116)는 호스트장치(200)로 에러메시지를 전송하고 동일한 비트 스트림을 재전송할 것을 요청한다. In the case of data reception, the control circuit 116 determines whether the count value of the timer / counter 113 increased according to the detection of each bit in the bit stream and the data bit value previously stored in the register 112 are the same. To judge. As a result of the determination, if not the same, the control circuit 116 controls the timer / counter 113 to increase the counting value by one and to detect the next bit. If the determination result is the same, the control circuit 116 determines whether the next bit of the data bit is the stop bit. As a result of the determination, in the case of the stop bit, the control circuit 116 controls the timer / counter 113 to be disabled. As a result of the determination, if it is not the stop bit, the control circuit 116 transmits an error message to the host device 200 and requests to retransmit the same bit stream.

또한 데이터 송신의 경우에, 제어회로(116)는 각 비트의 송신에 따라 증가된 타이머/카운터(113)의 카운팅 값 및 레지스터(112)에 기저장된 데이터비트 값에 2를 더한 값이 상호 동일한지 여부를 판단하고, 동일하지 않은 경우 다음 비트를 송신하도록 제어하고, 동일한 경우 타이머/카운터(113)가 디스에이블되도록 제어한다. Also, in the case of data transmission, the control circuit 116 checks whether the counting value of the timer / counter 113 increased in accordance with the transmission of each bit and the data bit value previously stored in the register 112 plus 2 are the same. If it is not the same, and if it is not the same control to transmit the next bit, and if the same, the timer / counter 113 controls to be disabled.

도 3은 본 발명에 따른 데이터 수신방법을 설명하기 위한 플로우 차트이다. 호스트장치(200)로부터 비트 스트림이 수신된 경우(S300), 제어회로(116)는 비트 스트림의 첫번째 비트가 시작비트인지 여부를 판단한다(S310). 판단 결과, 시작비트인 경우 제어회로(116)는 타이머/카운터(113)를 인에이블시킨다(S320). 그리고 제어회로(116)는 레지스터(112)에 저장된 데이터 전송속도에 기초하여 비트당 전송시간을 연산한다. 그러면 타이머/카운터(113)는 시작비트의 검출시점으로부터 비트당 전송시간의 1.5배에 해당하는 시간만큼 지연한 후(S330), 인터럽트 신호 발생기(114)로 첫번째 제어신호를 전송한다. 이후에는 그로부터 매 비트당 전송시간마다 제어신호를 전송한다. 전송된 제어신호에 기초하여 인터럽트 신호 발생기(114)로부터 인터럽트 신호가 생성되어 제어회로(116)로 전송되고, 제어회로(116)는 전송된 인터럽트 신호마다 비트 스트림의 각 비트를 검출한다(S340). 그리고 하나의 비트를 검출하면, 기저장된 카운팅 값과 데이터비트 값이 동일한지 여부를 판단한다(S350). 판단 결과, 동일하지 하지 않은 경우 카운팅 값을 1만큼 증가시키고 다음 비트를 검출한다. 이와 같은 과정은 카운팅 값 및 데이터비트 값이 상호 동일할 때까지 반복한다. 판단 결과, 동일한 경우 제어회로(116)는 데이터비트의 마지막 비트의 다음 비트가 정지비트인지를 판단한다(S370). 판단 결과, 정지비트가 아닌 경우 제어회로(116)는 호스트장치(200)로 에러메시지 및 데이터 재전송 요청신호를 전송한다(S390). 판단 결과, 정지비트인 경우 제어회로(116)는 타이머/카운터(113)를 디스에이블링시키고 다음 비트 스트림의 수신을 위해 대기한다(S380). 3 is a flowchart illustrating a data receiving method according to the present invention. When the bit stream is received from the host device 200 (S300), the control circuit 116 determines whether the first bit of the bit stream is the start bit (S310). As a result of the determination, in the case of the start bit, the control circuit 116 enables the timer / counter 113 (S320). The control circuit 116 then calculates the transfer time per bit based on the data transfer rate stored in the register 112. Then, the timer / counter 113 delays the time corresponding to 1.5 times the transmission time per bit from the time of detecting the start bit (S330), and then transmits the first control signal to the interrupt signal generator 114. Thereafter, the control signal is transmitted at every transmission time therefrom. An interrupt signal is generated from the interrupt signal generator 114 based on the transmitted control signal and transmitted to the control circuit 116, and the control circuit 116 detects each bit of the bit stream for each transmitted interrupt signal (S340). . If one bit is detected, it is determined whether the pre-stored counting value and the data bit value are the same (S350). If the result is not equal, the counting value is increased by 1 and the next bit is detected. This process is repeated until the counting value and the data bit value are the same. As a result of determination, the control circuit 116 determines whether the next bit of the last bit of the data bit is the stop bit (S370). If it is determined that the bit is not a stop bit, the control circuit 116 transmits an error message and a data retransmission request signal to the host device 200 (S390). As a result of the determination, in the case of the stop bit, the control circuit 116 disables the timer / counter 113 and waits for reception of the next bit stream (S380).

도 4는 도 3의 수신방법에 따라 비트 스트림의 검출시점을 설명하기 위한 타이밍도이다. 본 도면에서는 비트 스트림은 1 비트의 시작비트(start bit: ST_B), 8 비트의 데이터비트(data bit: DA_B) 및 1 비트의 정지비트(stop bit :SP_B)로 구성되는 것으로 상정하고 있다. 통상적으로 시작비트는 '0'값을 가지며, 정지비트는 '1'값을 가진다. 또한 R1 내지 R8은 인터럽트 신호 발생기(114)로부터 발생된 인터럽트 신호를 통해 비트 스트림의 각 비트가 검출되는 시점을 표시한 것이다.   4 is a timing diagram illustrating a detection time of a bit stream according to the receiving method of FIG. 3. In this figure, it is assumed that a bit stream is composed of a start bit (ST_B) of 1 bit, a data bit (DA_B) of 8 bits, and a stop bit (SP_B) of 1 bit. Typically, the start bit has a value of '0' and the stop bit has a value of '1'. In addition, R1 to R8 indicate when each bit of the bit stream is detected through the interrupt signal generated from the interrupt signal generator 114.

일 예로서 호스트장치(200) 및 슬레이브장치(110) 사이에서 데이터 전송속도를 9600bps(bit per second)라고 상정하면, 1 비트의 전송속도는 1/9600 sec로 대략 104μsec에 해당한다. 따라서 본 발명에 따른 수신방법을 적용할 경우, 제어회로(116)는 시작비트를 검출한 후로부터 대략 156μsec 후에 첫번째 비트를 검출한다. 이때의 156μsec는 시작비트의 검출로부터 비트당 전송속도인 104μsec의 1.5배에 해당하는 시간을 의미한다. 이는 검출 작업을 각 비트의 중앙에서 수행하는 것이 바람직하기 때문이다. As an example, assuming a data transmission rate of 9600bps (bit per second) between the host device 200 and the slave device 110, a transmission rate of 1 bit corresponds to approximately 104 μsec. Therefore, when applying the reception method according to the present invention, the control circuit 116 detects the first bit approximately 156μsec after detecting the start bit. In this case, 156 μsec means a time corresponding to 1.5 times 104 μsec, the transmission rate per bit, from the detection of the start bit. This is because it is preferable to perform the detection operation at the center of each bit.

그리고 첫 비트를 검출시점으로부터 104μsec 후에 두번째 비트를 검출하며, 이와 같은 작업은 데이터비트 값이 카운팅 값과 동일할 때까지 반복한다. The second bit is detected 104μsec after the first bit is detected. This operation is repeated until the data bit value is equal to the counting value.

도 5는 본 발명에 따른 데이터 송신방법을 설명하기 위한 플로우 차트이다.5 is a flowchart illustrating a data transmission method according to the present invention.

먼저 제어회로(116)는 마이컴(110)에서 처리되어 호스트장치(200)로 전송할 전송대상 데이터비트를 준비하고(S400), 타이머/카운터(113)를 인에이블링시킨다(S410). 그리고 제어회로(116)는 레지스터(112)에 저장된 데이터 전송속도에 기초하여 비트당 전송시간을 연산한다. 그리고 제어회로(116)의 제어에 의해 타이머/카운터(113)는 비트당 전송시간마다 제어신호를 인터럽트 신호 발생기(114)로 전송하고, 인터럽트 신호 발생기(114)는 이에 기초하여 제어회로(116)로 인터럽트 신호를 전송한다. 제어회로(116)는 인터럽트 신호마다 준비된 데이터비트의 각 비트를 송신채널을 통해 호스트장치(200)로 전송한다. 다만 맨 처음에는 시작비트를 전송하고, 다음에 데이터비트를 전송하고 맨 마지막에는 정지비트를 전송한다. 반면에 각 비트를 전송할 때마다 타이머/카운터(113)는 카운팅 값을 1만큼 증가시키고, 카운팅 값이 (데이터비트+2)와 동일하게 될 때까지 인터럽트 신호의 생성을 위한 제어신호를 인터럽트 신호 발생기(114)로 전송한다(S430,S450). 카운팅 값이 (데이터비트+2)와 동일한 경우, 제어회로(116)는 더 이상의 비트 전송을 중지하고 타이머/카운터(113)를 디스에이블링시킨다(S440). First, the control circuit 116 is processed by the microcomputer 110 to prepare the data bit to be transmitted to the host device (200) (S400), and enables the timer / counter 113 (S410). The control circuit 116 then calculates the transfer time per bit based on the data transfer rate stored in the register 112. Under the control of the control circuit 116, the timer / counter 113 transmits a control signal to the interrupt signal generator 114 at every transmission time per bit, and the interrupt signal generator 114 controls the control circuit 116 based on this. Send an interrupt signal. The control circuit 116 transmits each bit of the data bit prepared for each interrupt signal to the host device 200 through the transmission channel. However, the start bit is transmitted first, the data bit is transmitted next, and the stop bit is transmitted last. On the other hand, each time the bit is transmitted, the timer / counter 113 increments the counting value by 1, and generates a control signal for generating the interrupt signal until the counting value becomes equal to (data bit + 2). In step S430, S450 is transmitted. If the counting value is equal to (data bit + 2), the control circuit 116 stops further bit transmission and disables the timer / counter 113 (S440).

도 6은 도 5의 송신방법에 따라 비트 스트림의 송신시점을 설명하기 위한 타이밍도이다. 다만 도 4와 동일한 설명은 중복을 피하기 위해 생략한다.FIG. 6 is a timing diagram illustrating a timing of transmitting a bit stream according to the transmitting method of FIG. 5. However, the same description as in FIG. 4 will be omitted to avoid duplication.

본 도면에서도 데이터비트를 8비트로 상정하고, T1 내지 T10은 인터럽트 신호 발생기(114)로부터 발생된 인터럽트 신호를 통해 비트 스트림의 각 비트가 전송되는 시점을 표시한 것이다. In this figure, data bits are assumed to be 8 bits, and T1 to T10 indicate the time points at which each bit of the bit stream is transmitted through the interrupt signal generated from the interrupt signal generator 114.

일 예로서 호스트장치(200) 및 슬레이브장치(110) 사이에서 비트 스트림의 전송속도를 9600bps(bit per second)로 상정하고, 비트당 전송속도인 104μsec을 연산한다. 본 발명에 따른 송신방법에 따르면, 제어회로(116)는 시작비트, 데이터비트 및 정지비트를 소정 간격의 인터럽트 신호마다 전송한다. 여기서 소정 간격은 비트당 전송속도인 104μsec로 해야 할 것이다. As an example, it is assumed that the transmission rate of the bit stream is 9600 bps (bit per second) between the host device 200 and the slave device 110, and 104 μsec, which is a transmission rate per bit, is calculated. According to the transmission method according to the present invention, the control circuit 116 transmits a start bit, a data bit and a stop bit for each interrupt signal at predetermined intervals. Here, the predetermined interval should be 104 μsec, which is the transmission rate per bit.

다만 본 상세한 설명에서는 마이컴(110)에 레지스터(112), 타이머/카운터(113) 및 인터럽트 신호 발생기(114)를 별개로 구비하는 것으로 구현하였으나 실시예에 따라서는 레지스터(112), 타이머/카운터(113) 및 인터럽트 신호 발생기(114)를 하나의 장치로 구현할 수도 있을 것이다. In this detailed description, the microcomputer 110 includes the register 112, the timer / counter 113, and the interrupt signal generator 114 separately, but according to the exemplary embodiment, the register 112 and the timer / counter ( 113 and the interrupt signal generator 114 may be implemented as one device.

이상에서 설명한 바와 같이, 본 발명에 따른 비트 스트림 송/수신방법에 의하면, 슬레이브장치에는 UART를 구비하지 않아도 되므로 슬레이브장치의 생산원가를 절감할 수 있다. 또한 UART가 소프트웨어적으로 구현되므로 사용자 설정에 의해 전송하고자 하는 데이터비트의 수를 손쉽게 변경할 수 있으며, 또한 UART 규약의 변경을 손쉽게 수행할 수 있다. As described above, according to the bit stream transmission / reception method according to the present invention, since the slave device does not need to have a UART, the production cost of the slave device can be reduced. In addition, since the UART is implemented in software, the number of data bits to be transmitted can be easily changed by user setting, and the UART protocol can be easily changed.

이상에서, 본 발명의 특정한 바람직한 실시예에 대하여 도시하고 또한 설명하였다. 그러나, 본 발명은 상술한 실시예에 한정되지 아니하며, 특허청구범위에서 청구하는 본 발명의 요지와 사상을 벗어남이 없이 당해 발명에 속하는 기술분야에서 통상의 지식을 가진 자라면 누구든지 다양한 수정과 변형실시가 가능할 것이다. In the above, certain preferred embodiments of the present invention have been illustrated and described. However, the present invention is not limited to the above-described embodiments, and any person having ordinary skill in the art to which the present invention pertains without departing from the spirit and spirit of the present invention claimed in the claims may make various modifications and variations. Implementation will be possible.

Claims (5)

범용 비동기 송/수신기(Universal Asynchronous Receiver and Transmitter)가 구비된 호스트장치로부터 범용 입력단자(general purpose input terminal)와 인터럽트 발생수단이 구비된 슬레이브장치로 비트 스트림을 전송하는 방법에 있어서,A method of transmitting a bit stream from a host device equipped with a universal asynchronous receiver and a transmitter to a slave device provided with a general purpose input terminal and interrupt generating means, 일 비트 스트림이 상기 범용 입력단자로 입력된 경우, 입력된 첫번째 비트가 시작비트인지 여부를 판단하는 단계;When a bit stream is input to the general-purpose input terminal, determining whether the first bit input is a start bit; 판단 결과 상기 시작비트인 경우, 상기 호스트장치 및 상기 슬레이브장치 사이의 비트당 전송시간마다 인터럽트 신호를 발생하도록 상기 인터럽트 발생수단을 인에이블링하여 조정하는 단계; 및Enabling and adjusting the interrupt generating means to generate an interrupt signal at every transmission time between the host device and the slave device when it is the start bit; And 조정된 상기 인터럽트 발생수단의 각 인터럽트 신호에 기초하여 상기 비트 스트림의 전송대상 비트인 데이터비트를 검출하는 단계;를 포함하는 것을 특징으로 하는 비트 스트림 수신방법.And detecting a data bit that is a transmission target bit of the bit stream based on each adjusted interrupt signal of the interrupt generating means. 제1항에 있어서,The method of claim 1, 상기 조정 단계는,The adjusting step, 판단 결과 상기 시작비트인 경우, 상기 호스트장치로부터 상기 슬레이브장치로의 데이터 전송속도에 기초하여 상기 비트당 전송시간을 연산하는 단계; 및Calculating a transmission time per bit based on a data transmission rate from the host device to the slave device when the determination result is the start bit; And 연산된 상기 비트당 전송시간마다 인터럽트 신호를 발생하도록 상기 인터럽트 발생수단을 인에이블링하여 조정하는 단계;를 포함하는 것을 특징으로 하는 비트 스트림 수신방법.Enabling and adjusting the interrupt generating means to generate an interrupt signal at each calculated transmission time per bit. 제1항에 있어서,The method of claim 1, 상기 검출 단계에서, 첫번째 인터럽트 신호는 상기 시작비트의 검출시점으로부터 상기 비트당 전송시간에 기초한 비트검출 조정시간이 경과한 후에 발생하는 것을 특징으로 하는 비트 스트림 수신방법.In the detecting step, the first interrupt signal is generated after the bit detection adjustment time based on the transmission time per bit has elapsed from the detection time of the start bit. 제3항에 있어서,The method of claim 3, 상기 비트검출 조정시간은 상기 비트당 전송시간의 1.5배에 해당하는 시간인 것을 특징으로 하는 비트 스트림 수신방법.And the bit detection adjustment time is 1.5 times the transmission time per bit. 범용 출력단자(general purpose output terminal)와 인터럽트 발생수단이 구비된 슬레이브장치로부터 범용 비동기 송/수신기(Universal Asynchronous Receiver and Transmitter)가 구비된 호스트장치로 비트 스트림을 전송하는 방법에 있어서,Claims [1] A method for transmitting a bit stream from a slave device having a general purpose output terminal and an interrupt generating means to a host device having a universal asynchronous receiver and transmitter. 상기 슬레이브장치로부터 호스트장치로의 데이터 전송속도에 기초하여 비트당 전송시간을 연산하는 단계;Calculating a transmission time per bit based on a data transmission rate from the slave device to a host device; 연산된 상기 비트당 전송시간마다 인터럽트 신호를 발생하도록 상기 인터럽트 발생수단을 인에이블링하여 조정하는 단계; 및Enabling and adjusting the interrupt generating means to generate an interrupt signal at each calculated transmission time per bit; And 조정된 상기 인터럽트 발생수단의 각 인터럽트 신호마다 전송대상 비트 스트림의 각 비트를 상기 범용 출력단자를 통해 송신하는 단계;를 포함하는 것을 특징으로 하는 비트 스트림 송신방법.And transmitting each bit of a bit stream to be transmitted through the general-purpose output terminal for each interrupt signal of the adjusted interrupt generating means.
KR1020030065383A 2003-09-20 2003-09-20 transmitting/receiving method of bit stream KR100555644B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020030065383A KR100555644B1 (en) 2003-09-20 2003-09-20 transmitting/receiving method of bit stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020030065383A KR100555644B1 (en) 2003-09-20 2003-09-20 transmitting/receiving method of bit stream

Publications (2)

Publication Number Publication Date
KR20050029065A KR20050029065A (en) 2005-03-24
KR100555644B1 true KR100555644B1 (en) 2006-03-03

Family

ID=37385801

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020030065383A KR100555644B1 (en) 2003-09-20 2003-09-20 transmitting/receiving method of bit stream

Country Status (1)

Country Link
KR (1) KR100555644B1 (en)

Also Published As

Publication number Publication date
KR20050029065A (en) 2005-03-24

Similar Documents

Publication Publication Date Title
US6275526B1 (en) Serial data communication between integrated circuits
US20050165989A1 (en) I2C communication system and method enabling bi-directional communications
JP2641999B2 (en) Data format detection circuit
US7340023B1 (en) Auto baud system and method and single pin communication interface
WO2022161244A1 (en) Multi-host arbitration method and apparatus, and readable storage medium
TWI641954B (en) Method of extending range of usb transmission for isochronous transfer
US6463362B1 (en) Electronic device and operating mode control method thereof
JP3919990B2 (en) Timing synchronization system, apparatus used in the system, and timing synchronization method
JPH0946361A (en) Serial data transmitter and its controlling method
KR100555644B1 (en) transmitting/receiving method of bit stream
JPH09238175A (en) Device for detecting constitution parameter of asynchronous data link
JP2002252606A (en) Synchronization correction circuit
JPH07264263A (en) Serial communication interface device
JPH07288516A (en) Serial data transmission reception circuit
JP2002164873A (en) Digital audio device
KR100438980B1 (en) Automatic baud rate detection apparatus and method of asynchronous communication
JPH10294772A (en) At command reception system
JPH01188060A (en) Automatic transmission speed setting system for stepping synchronous transmission
KR101879053B1 (en) Test equipment in which baud rate is set automatically
JPH0439819B2 (en)
KR100195645B1 (en) Method for detecting the code-data in remote controller signal
TW202246972A (en) Rs-485 circuit and communication system
JP2003152745A (en) Data transmission system, transmitter, and receiver
KR0174970B1 (en) Code data detection method of remote control signal
JPH08111687A (en) Communication system

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
LAPS Lapse due to unpaid annual fee