KR101407996B1 - System for synchronous serial interface using serial peripheral interface microcontroller and method thereof - Google Patents
System for synchronous serial interface using serial peripheral interface microcontroller and method thereof Download PDFInfo
- Publication number
- KR101407996B1 KR101407996B1 KR1020120130034A KR20120130034A KR101407996B1 KR 101407996 B1 KR101407996 B1 KR 101407996B1 KR 1020120130034 A KR1020120130034 A KR 1020120130034A KR 20120130034 A KR20120130034 A KR 20120130034A KR 101407996 B1 KR101407996 B1 KR 101407996B1
- Authority
- KR
- South Korea
- Prior art keywords
- data
- spi
- ssi
- microcontroller
- encoder
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
- G06F13/4291—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/30—Definitions, standards or architectural aspects of layered protocol stacks
- H04L69/32—Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Systems (AREA)
Abstract
SPI 통신용 마이크로컨트롤러로 SSI 엔코더 읽기가 가능토록 한 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 시스템 및 그 방법이 개시된다.
개시된 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 시스템은, 엔코더 선택신호를 발생하고, 설정된 데이터 크기에 대응하는 SPI 클록을 발생하며, 상기 발생한 SPI(serial peripheral interface) 클록에 동기하여 입력단자(SPI MISO 단자)로 입력되는 값을 데이터화하여 SSI(synchronous serial interface) 엔코더의 데이터 값으로 버퍼에 저장하는 마이크로컨트롤러; 상기 마이크로컨트롤러에서 발생한 SPI클록을 라인 드라이브 방식의 클록으로 변환하여 엔코더부에 출력하고, 상기 엔코더부에서 라인 드라이브 방식으로 출력되는 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 트랜시버부; 상기 마이크로컨트롤러에서 출력되는 엔코더 선택신호에 따라 상기 트랜시버부에서 출력되는 복수의 SSI 데이터 중 하나를 선택하여 상기 마이크로컨트롤러의 상기 입력단자에 입력하는 데이터 선택기를 포함한다.Disclosed is a synchronous serial interface system using a microcontroller for SPI communication and a method thereof for enabling SSI encoder reading with a SPI communication microcontroller.
The synchronous serial interface system using the microcontroller for SPI communication generates an encoder selection signal, generates an SPI clock corresponding to a set data size, and outputs the input signal to the input terminal (SPI MISO terminal) in synchronization with the generated serial peripheral interface A microcontroller for converting a value input into a data into a data value of a synchronous serial interface (SSI) encoder in a buffer; A transceiver unit for converting an SPI clock generated by the microcontroller into a clock of a line drive type and outputting the clock to an encoder unit and converting the data output from the encoder unit into a line drive system data into an open collector system; And a data selector for selecting one of a plurality of SSI data output from the transceiver unit according to an encoder selection signal output from the microcontroller and inputting the selected SSI data to the input terminal of the microcontroller.
Description
본 발명은 SPI(serial peripheral interface) 통신용 마이크로컨트롤러(microcontroller)를 이용한 동기 직렬 인터페이스(synchronous serial interface: SSI)에 관한 것으로서, 더욱 상세하게는 SPI 통신용 마이크로컨트롤러로 SSI 엔코더 읽기가 가능토록 한 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 시스템 및 그 방법에 관한 것이다.
BACKGROUND OF THE
일반적으로, 마이크로컨트롤러 내부에는 코어(core)와 외부의 주변장치(Peripheral Device) 사이에 직렬 통신을 위해 직렬 인터페이스가 있는 데, 이 종류에는 동기와 비동기가 있다.Generally, inside a microcontroller is a serial interface for serial communication between a core and an external peripheral device, which is synchronous and asynchronous.
비동기 인터페이스의 대표적인 것은 범용 비동기 송수신기(Universal Asynchronous Receiver Transmitter : UART) 가 있고, 동기 인터페이스는 동기 직렬 인터페이스(SSI)가 있다.A typical example of an asynchronous interface is a Universal Asynchronous Receiver Transmitter (UART), and a synchronous interface is a synchronous serial interface (SSI).
그 중 동기 직렬 인터페이스는 외부 주변장치와 통신시 바이트(byte, 8비트) 간을 구분하는 구별신호(frame signal)가 필요없이 클록에 동기되어 수신되는 신호를 바이트 단위로 변환하며, 송신 데이터는 클록에 동기시켜 직렬로 송신한다.Among them, the synchronous serial interface converts a signal received in synchronization with a clock into a byte unit, without requiring a frame signal for distinguishing between bytes (8 bits) in communication with an external peripheral device, And serially transmitted.
동기 직렬 인터페이스 장치에 대한 종래기술이 대한민국특허청 공개특허공보 공개번호 특1999-027046호(1999.04.15. 공개)(발명의 명칭: 동기 직렬 인터페이스)에 개시된다.A prior art for a synchronous serial interface device is disclosed in Korean Patent Application Publication No. 1999-027046 (titled Synchronous Serial Interface).
개시된 종래기술은 적은 수의 게이트(gate)를 이용하여 동기 직렬 인터페이스를 구현하고, 내부에 선입선출기(FIFO)를 두어 마이크로컨트롤러 내부의 주기억장치(core)의 부하를 적게 하도록 하였다. 따라서 버퍼를 없애 게이트의 숫자를 줄이고, 클록이 송신중인 동안만 발생하여 전력의 소모가 줄어들며, 송신과 수신이 항상 동시에 진행되어 제어를 하기에 간단해지는 장점이 있다.
The disclosed prior art implements a synchronous serial interface using a small number of gates and has a FIFO in the microcontroller to reduce the load of the main memory in the microcontroller. Therefore, there is an advantage that the number of gates is reduced by eliminating the buffer, the clock is generated only during the transmission, power consumption is reduced, and the transmission and reception are always performed at the same time.
그러나 상기와 같은 종래기술은 절대치 엔코더의 표준화된 프로토콜을 사용하고 있으므로, 근래에 출시되고 있는 마이크로 컨트롤러에는 적용이 불가능한 단점이 있다.However, since the above-mentioned prior art uses a standardized protocol of an absolute encoder, it has a disadvantage that it can not be applied to a microcontroller which has been released recently.
예컨대, 근래의 마이크로 컨트롤러는 상기와 같은 SSI 통신용 인터페이스 IC가 장착되지 않고, SPI 통신용 인터페이스 장치가 장착되고 있다. 따라서 근래에 출시되는 마이크컨트롤러에서 SSI 엔코더를 읽기 위해서는 코어에서 SSI 통신에 필요한 펄스를 만들고, 데이터를 읽어들이는 작업에 대한 제어를 직접 수행하게 된다. 이로 인해 마이크로컨트롤러의 대부분의 자원을 SSI엔코더의 데이터를 읽어들이는 데에 사용하게 되어, 마이크로컨트롤러의 부하가 증가하는 단점이 있다. 여기서 SSI엔코더는 수 Mhz대의 펄스신호를 사용한다.
For example, in recent microcontrollers, the above-mentioned SSI communication interface IC is not mounted and an SPI communication interface device is mounted. Therefore, in order to read the SSI encoder in the recently released microcontroller, the core needs to make the pulse necessary for SSI communication and control the operation of reading the data directly. This causes most of the microcontroller's resources to be used to read data from the SSI encoder, which increases the load on the microcontroller. Here, SSI encoders use pulse signals of several Mhz.
이에 본 발명은 상기와 같은 종래기술 및 일반적인 SSI 마이크로컨트롤러에서 발생하는 제반 문제점을 해결하기 위해서 제안된 것으로서,Accordingly, the present invention has been made to solve the above problems occurring in the conventional SSI microcontroller and the related art,
본 발명이 해결하고자 하는 과제는 SPI(serial peripheral interface) 통신용 마이크로컨트롤러로 SSI 엔코더 읽기가 가능토록 한 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 시스템 및 그 방법을 제공하는 데 있다.
SUMMARY OF THE INVENTION The present invention provides a synchronous serial interface system using a SPI communication microcontroller capable of reading SSI encoders with a microcontroller for serial peripheral interface (SPI) communication, and a method thereof.
본 발명이 해결하고자 하는 다른 과제는 SPI(serial peripheral interface) 통신용 마이크로컨트롤러에서 적은 부하로 SSI 엔코더 읽기가 가능토록 하여 마이크로컨트롤러의 부하를 줄일 수 있도록 한 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 시스템 및 그 방법을 제공하는 데 있다.
Another object of the present invention is to provide a synchronous serial interface system using a SPI communication microcontroller capable of reading a SSI encoder with a small load in a microcontroller for SPI (serial peripheral interface) communication, Method.
상기와 같은 과제들을 해결하기 위한 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템은,According to an aspect of the present invention, there is provided a synchronous serial interface system using a microcontroller for SPI communication,
엔코더 선택신호를 발생하고, 설정된 데이터 크기에 대응하는 SPI 클록을 발생하며, 상기 발생한 SPI 클록에 동기하여 입력단자(SPI MISO 단자)로 입력되는 값을 데이터화하여 SSI 엔코더의 데이터 값으로 버퍼에 저장하는 마이크로컨트롤러;Generates an encoder selection signal, generates an SPI clock corresponding to the set data size, converts a value input to an input terminal (SPI MISO terminal) in synchronization with the generated SPI clock into data in the SSI encoder as a data value Microcontroller;
상기 마이크로컨트롤러에서 발생한 SPI클록을 라인 드라이브 방식의 클록으로 변환하여 엔코더부에 출력하고, 상기 엔코더부에서 라인 드라이브 방식으로 출력되는 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 트랜시버부;A transceiver unit for converting an SPI clock generated by the microcontroller into a clock of a line drive type and outputting the clock to an encoder unit and converting the data output from the encoder unit into a line drive system data into an open collector system;
상기 마이크로컨트롤러에서 출력되는 엔코더 선택신호에 따라 상기 트랜시버부에서 출력되는 복수의 SSI 데이터 중 하나를 선택하여 상기 마이크로컨트롤러의 상기 입력단자에 입력하는 데이터 선택기를 포함하는 것을 특징으로 한다.
And a data selector for selecting one of a plurality of SSI data output from the transceiver unit according to an encoder selection signal output from the microcontroller and inputting the selected SSI data to the input terminal of the microcontroller.
상기 마이크로컨트롤러는,The microcontroller includes:
SSI 데이터 저장용 버퍼에 더미 값이 기록되면, 설정된 SPI 데이터 크기에 대응하는 SPI 클록을 발생하며, 발생한 상기 SPI 클록에 동기하여 상기 입력단자에 입력되는 값을 데이터화하여 SSI데이터로 상기 버퍼에 저장하는 SPI 통신모듈을 포함하는 것을 특징으로 한다.When a dummy value is written in the SSI data storage buffer, an SPI clock corresponding to the set SPI data size is generated, and the value input to the input terminal is synchronized with the SPI clock generated and stored in the buffer with SSI data And an SPI communication module.
상기 마이크로컨트롤러는,The microcontroller includes:
엔코더 선택신호를 발생하여 상기 데이터 선택기에 전달하는 디지털 출력모듈을 더 포함하는 것을 특징으로 한다.
And a digital output module for generating and transmitting an encoder selection signal to the data selector.
상기 마이크로컨트롤러는,The microcontroller includes:
상기 SPI 통신모듈에 SSI 데이터 크기 이상의 SPI 데이터 크기를 설정하고, 상기 디지털 출력모듈에 엔코더 선택 신호를 제공하며, 상기 SPI 통신모듈의 버퍼에 더미 값을 기록하고, 상기 버퍼에 저장된 데이터를 읽어 SSI 엔코더의 데이터 값으로 사용하는 코어를 더 포함하는 것을 특징으로 한다.
A dummy value is written in the buffer of the SPI communication module, and the data stored in the buffer is read out, and the SSI encoder And a core used as a data value of the data.
상기에서 트랜시버부는 복수의 422 트랜시버로 구성된 것을 특징으로 한다.
The transceiver unit may include a plurality of 422 transceivers.
상기에서 데이터 선택기는,In the above,
상기 마이크로컨트롤러에서 출력되는 엔코더 선택신호에 따라 상기 422 트랜시버에서 출력되는 복수의 SSI 데이터 중 하나를 선택하여 상기 마이크로컨트롤러의 상기 입력단자에 입력하는 멀티플렉서로 구성된 것을 특징으로 한다.
And a multiplexer for selecting one of a plurality of SSI data output from the 422 transceiver according to an encoder selection signal output from the microcontroller and inputting the selected SSI data to the input terminal of the microcontroller.
상기와 같은 과제들을 해결하기 위한 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스방법은,According to an aspect of the present invention, there is provided a synchronous serial interface method using a microcontroller for SPI communication,
(a) SPI(serial peripheral interface) 데이터 크기를 설정하는 단계;(a) setting a serial peripheral interface (SPI) data size;
(b) 인터페이스 할 SSI(synchronous serial interface) 엔코더를 선택하는 단계;(b) selecting a synchronous serial interface (SSI) encoder to interface with;
(c) SPI 클록을 발생하는 단계;(c) generating an SPI clock;
(d) 상기 SPI 클록을 라인 드라이브 방식의 클록으로 변환하여 SSI 엔코더에 전송하는 단계;(d) converting the SPI clock into a line drive type clock and transmitting it to the SSI encoder;
(e) SSI 엔코더에서 발생한 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 단계;(e) converting data generated in the SSI encoder into data in an open collector system;
(f) 상기 오픈 컬렉터 방식의 데이터를 SSI 데이터로 버퍼에 저장하는 단계를 포함하는 것을 특징으로 한다.
(f) storing the data of the open collector system in the buffer with SSI data.
상기에서 (a)단계는 인터페이스 할 SSI 데이터 크기 이상으로 상기 SPI 데이터 크기를 설정하는 것을 특징으로 한다.
In the step (a), the size of the SPI data is set to be larger than the size of the SSI data to be interfaced.
상기에서 (c)단계는 설정한 상기 SPI 데이터 크기에 대응하는 SPI 클록을 발생하는 것을 특징으로 한다.
In the step (c), an SPI clock corresponding to the set SPI data size is generated.
본 발명에 따르면 SPI 통신용 컨트롤러에서 SPI 통신모듈과 표준화된 칩(IC)인 422트랜시버 및 멀티플렉서만을 이용하여, 용이하게 SSI 엔코더 데이터를 판독할 수 있는 장점이 있다.According to the present invention, there is an advantage that SSI encoder data can be easily read by using only a 422 transceiver and a multiplexer, which are chip (IC) standardized with the SPI communication module in the SPI communication controller.
또한, 본 발명에 따르면 SPI 통신용 마이크로컨트롤러는 SPI 통신모듈의 버퍼에 값을 쓰고 읽는 것만으로 SSI 엔코더의 값을 판독할 수 있으므로, 마이크로컨트롤러의 부하를 획기적으로 줄 수 있는 장점이 있다.In addition, according to the present invention, since the SPI communication microcontroller can read the value of the SSI encoder only by writing and reading the value in the buffer of the SPI communication module, there is an advantage that the load of the microcontroller can be drastically reduced.
또한, 본 발명에 따르면 하나의 SPI 통신 모듈로 복수의 SSI 엔코더를 인터페이스할 수 있어, SSI 엔코더 판독을 위한 비용과 시스템 구성을 위한 공간적인 비용을 줄일 수 있는 장점이 있다.
In addition, according to the present invention, a plurality of SSI encoders can be interfaced with one SPI communication module, and the cost for reading SSI encoders and the spatial cost for system configuration can be reduced.
도 1은 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템의 블록 구성도이고,
도 2는 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 방법을 보인 흐름도이다.1 is a block diagram of a synchronous serial interface system using a microcontroller for SPI communication according to the present invention,
2 is a flowchart illustrating a synchronous serial interface method using a microcontroller for SPI communication according to the present invention.
이하 본 발명의 바람직한 실시 예를 첨부한 도면에 의거 상세히 설명하면 다음과 같다. 본 발명을 설명하기에 앞서 관련된 공지 기능 혹은 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는 그에 대한 상세한 설명은 생략한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail.
<실시 예1>≪ Example 1 >
도 1은 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템의 블록 구성도로서, 마이크로컨트롤러(110), 트랜시버부(120), 엔코더부(130) 및 데이터 선택기(140)로 구성된다.FIG. 1 is a block diagram of a synchronous serial interface system using a microcontroller for SPI communication according to the present invention, and includes a
마이크로컨트롤러(110)는 엔코더 선택신호를 발생하고, 설정된 데이터 크기에 대응하는 SPI 클록을 발생하며, 상기 발생한 SPI 클록에 동기하여 입력단자(SPI MISO 단자)로 입력되는 값을 데이터화하여 SSI 엔코더의 데이터 값으로 버퍼에 저장하는 역할을 한다.The
이러한 마이크로컨트롤러(110)는 SSI 데이터 저장용 버퍼에 더미 값이 기록되면, 설정된 SPI 데이터 크기에 대응하는 SPI 클록을 발생하며, 발생한 상기 SPI 클록에 동기하여 상기 입력단자에 입력되는 값을 데이터화하여 SSI데이터로 상기 버퍼에 저장하는 SPI 통신모듈(113); 엔코더 선택신호를 발생하여 상기 데이터 선택기(140)에 전달하는 디지털 출력모듈(D/O 모듈)(112); 상기 SPI 통신모듈(113)에 SSI 데이터 크기 이상의 SPI 데이터 크기를 설정하고, 상기 디지털 출력모듈(112)에 엔코더 선택 신호를 제공하며, 상기 SPI 통신모듈(113)의 버퍼에 더미 값을 기록하고, 상기 버퍼에 저장된 데이터를 읽어 SSI 엔코더의 데이터 값으로 사용하는 코어(core)(111)를 포함한다.When a dummy value is written into the SSI data storage buffer, the
여기서 SPI 통신 모듈(113)은 통상의 SPI 통신 모듈로서 데이터 저장용 버퍼, SPI 클록 발생기, 데이터 저장기를 포함하는 것이 바람직하다.Here, the
트랜시버부(120)는 상기 마이크로컨트롤러(110)에서 발생한 SPI클록을 라인 드라이브 방식의 클록으로 변환하여 엔코더부(130)에 출력하고, 상기 엔코더부(130)에서 라인 드라이브 방식으로 출력되는 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 역할을 한다. 이러한 트랜시버부(120)는 복수의 422 트랜시버(121 ~ 124)를 포함한다. 여기서 422 트랜시버의 개수는 SSI 엔코더의 개수에 대응하게 구현하는 것이 바람직하다.The
엔코더부(130)는 SSI 통신 방식으로 데이터를 인터페이스하는 역할을 하는 것으로서, 복수의 SSI 엔코더(131 ~ 134)를 포함한다. 본 발명에서는 SSI 엔코더의 개수가 4개인 경우에 대해서 설명하며, 이러한 SSI 엔코더의 개수가 증감되면 그에 따라 422 트랜시버의 개수를 증감하고, 마이크로컨트롤러에서 발생하는 엔코더 선택신호만을 변경하면 된다.The
데이터 선택기(140)는 상기 마이크로컨트롤러(110)에서 출력되는 엔코더 선택신호에 따라 상기 트랜시버부(120)에서 출력되는 복수의 SSI 데이터 중 하나를 선택하여 상기 마이크로컨트롤러(110)의 상기 입력단자(SPI MISO)에 입력하는 역할을 하는 것으로서, 멀티플렉서로 구현하는 것이 바람직하다.The
이와 같이 구성된 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 사용한 동기 직렬 인터페이스 시스템은, 마이크로컨트롤러(110)의 SPI 초기화과정에서 코어(111)는 SPI의 데이터 크기를 SSI 데이터 크기 이상으로 설정하여 SPI 통신모듈(113)의 클록 발생기에 전달하고, 아울러 버퍼에 더미 값을 기록하고, 동시에 디지털 출력 모듈(112)에 인터페이스 대상 엔코더 선택신호를 전달한다.In the synchronous serial interface system using the microcontroller for SPI communication according to the present invention configured as described above, in the SPI initialization process of the
여기서 엔코더 선택신호는 인터페이스 대상 SSI 엔코더의 개수에 따라 달리 설정되는 데, 예컨대 SSI 엔코더의 개수가 4개일 경우에는 2비트를 이용하여 엔코더 선택신호를 설정한다, 즉, 00 = SSI엔코더 #0, 01 = SSI엔코더 #1, 10 = SSI엔코더 #2, 11 = SSI엔코더 #3으로 설정할 수 있다.In this case, the encoder selection signal is set differently according to the number of SSI encoders to be interfaced. For example, when the number of SSI encoders is 4, 2 bits are used to set the encoder selection signal. That is, 00 =
상기 디지털 출력 모듈(112)은 상기 코어(111)에서 출력되는 읽고자 하는 엔코더를 선택하는 엔코더 선택신호를 그에 상응하는 디지털 신호로 변환을 하여 데이터 선택기(140)에 엔코더 선택 신호로 전달한다.The
아울러 SPI 통신모듈(113)은 버퍼에 더미 값이 기록되면, 클록 발생기를 통해 기 설정된 SPI의 데이터 크기에 대응하는 SPI 클록(Clock)을 생성하여 트랜시버부(120)에 전달한다. 여기서 SPI의 데이터 크기는 SSI 데이터 크기 이상이 된다.In addition, when the dummy value is written in the buffer, the
상기 트랜시버부(120)내의 각각의 422 트랜시버(121 ~124)는 상기 SPI 통신모듈(113)로부터 출력되는 오픈 컬렉터 방식의 SPI 클록을 라인 드라이브 방식의 클록(Clock+, Clock-)으로 변환하여 엔코더부(130)의 대응하는 SSI 엔코더로 전송한다. 즉, 422트랜시버(121)에서 출력되는 라인 드라이브 방식의 클록은 SSI 엔코더(131)로, 422트랜시버(122)에서 출력되는 라인 드라이브 방식의 클록은 SSI 엔코더(132)로, 422트랜시버(123)에서 출력되는 라인 드라이브 방식의 클록은 SSI 엔코더(133)로, 422트랜시버(124)에서 출력되는 라인 드라이브 방식의 클록은 SSI 엔코더(134)로 각각 전송된다.Each of the 422
상기 엔코더부(130)의 각각의 SSI 엔코더(131 ~134)는 입력되는 라인 드라이브 방식의 클록에 동기하여 엔코더 데이터를 순차 라인 드라이브 방식으로 출력하여 대응하는 422 트랜시버에 전송한다.Each of the
상기 트랜시버부(120)내의 각각의 422 트랜시버(121 ~124)는 라인 드라이브 방식으로 입력되는 엔코더 데이터(data+, data-)를 오픈 컬렉터 방식의 데이터(SSI DATA)로 변환하여 데이터 선택기(140)로 전송한다.Each of the 422
상기 데이터 선택기(140)는 상기 마이크로컨트롤러(110) 내의 디지털 출력 모듈(112)에서 출력되는 엔코더 선택신호에 따라 입력되는 4개의 SSI 데이터(SSI #0 DATA, SSI #1 DATA, SSI #2 DATA, SSI #3 DATA) 중 하나를 선택하여, 상기 마이크로컨트롤러(110) 내의 SPI 통신모듈(113)의 입력단자(SPI MISO(Master In, Slave Out) 단자)로 전송한다.The
그러면 상기 SPI 통신모듈(113)은 발생한 SPI 클록에 동기하여 상기 입력단자(SPI MISO 단자)로 입력되는 값을 데이터 화하여 내부 버퍼에 저장한다.Then, the
이러한 과정으로 SPI 통신 모듈(113)을 통해 SSI 엔코더의 데이터를 읽게 되며, 이후 코어(111)에서는 상기 SPI 통신모듈(113)의 버퍼의 값을 읽어 SSI 엔코더의 데이터로 사용하게 되는 것이다.In this process, data of the SSI encoder is read through the
이러한 본 발명은 SPI 통신용 마이크로컨트롤러에서 통상의 422 트랜시버, 멀티플렉서만을 이용하여, 용이하게 SSI 엔코더의 데이터를 판독할 수 있으며, 아울러 멀티플렉서의 사용으로 하나의 SPI 통신 모듈을 이용하여 복수의 SSI 엔코더를 인터페이스할 수 있게 되는 것이다.
The present invention can easily read the data of the SSI encoder by using only the conventional 422 transceiver and the multiplexer in the SPI communication microcontroller. In addition, by using the multiplexer, a plurality of SSI encoders can be interfaced It will be possible to do.
<실시 예2>≪ Example 2 >
도 2는 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 방법을 보인 흐름도로서, (a) SPI(serial peripheral interface) 데이터 크기를 설정하는 단계(S101)와; (b) 인터페이스 할 SSI(synchronous serial interface) 엔코더를 선택하는 단계(S102)와; (c) SPI 클록을 발생하는 단계(S103 ~ S104)와; (d) 상기 SPI 클록을 라인 드라이브 방식의 클록으로 변환하여 SSI 엔코더에 전송하는 단계(S105)와; (e) SSI 엔코더에서 발생한 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 단계(S106 ~ S107)와; (f) 상기 오픈 컬렉터 방식의 데이터를 SSI 데이터로 버퍼에 저장하는 단계(S108 ~ S109)와; (g) 상기 버퍼에 저장한 데이터를 판독하여 SSI 엔코더 데이터로 사용하는 단계(S110)로 이루어진다.FIG. 2 is a flowchart illustrating a synchronous serial interface method using a microcontroller for SPI communication according to the present invention. (b) selecting a synchronous serial interface (SSI) encoder to interface with (S102); (c) generating an SPI clock (S103 to S104); (d) converting the SPI clock into a line drive type clock and transmitting the clock to the SSI encoder (S105); (e) converting data generated in the SSI encoder into data in an open collector system (S106 to S107); (f) storing data of the open collector system in a buffer with SSI data (S108 to S109); (g) reading the data stored in the buffer and using the data as SSI encoder data (S110).
이와 같이 이루어지는 본 발명에 따른 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스 방법은, 단계 S101에서 마이크로컨트롤러(110)의 SPI 초기화과정에서 코어(111)는 SPI의 데이터 크기를 SSI 데이터 크기 이상으로 설정하여 SPI 통신모듈(113)의 클록 발생기에 전달하고, 동시에 디지털 출력 모듈(112)에 인터페이스 대상 엔코더 선택신호를 전달한다.In the synchronous serial interface method using the SPI communication microcontroller according to the present invention, in step S101, the
이후, 단계 S102에서 디지털 출력 모듈(112)은 상기 코어(111)에서 출력되는 읽고자 하는 엔코더를 선택하는 엔코더 선택신호를 그에 상응하는 디지털 신호로 변환을 하여 데이터 선택기(140)에 엔코더 선택 신호로 전달한다.In step S102, the
단계 S103에서 상기 코어(111)는 상기 SPI 통신 모듈(113)의 버퍼에 더미 값을 기록하게 되고, 상기 버퍼에 더미 값이 기록되면 단계 S104에서 상기 SPI 통신모듈(113)은 내부의 클록 발생기를 통해 상기 설정된 SPI의 데이터 크기에 대응하는 SPI 클록(Clock)을 생성하여 트랜시버부(120)에 전달한다. 여기서 SPI의 데이터 크기는 SSI 데이터 크기 이상이 된다.In step S103, the core 111 records a dummy value in the buffer of the
단계 S105에서 상기 트랜시버부(120) 내의 각각의 422 트랜시버(121 ~124)는 상기 SPI 통신모듈(113)로부터 출력되는 오픈 컬렉터 방식의 SPI 클록을 라인 드라이브 방식의 클록(Clock+, Clock-)으로 변환하여 엔코더부(130)의 대응하는 SSI 엔코더로 전송한다.In step S105, each of the 422
이후 단계 S106에서 상기 엔코더부(130)의 각각의 SSI 엔코더(131 ~134)는 입력되는 라인 드라이브 방식의 클록에 동기하여 엔코더 데이터를 순차 라인 드라이브 방식으로 출력하여 대응하는 422 트랜시버에 전송한다.In step S106, each of the
그러면 단계 S107에서 상기 트랜시버부(120)내의 각각의 422 트랜시버(121 ~124)는 라인 드라이브 방식으로 입력되는 엔코더 데이터(data+, data-)를 오픈 컬렉터 방식의 데이터(SSI DATA)로 변환하여 데이터 선택기(140)로 전송한다.Then, in step S107, each of the 422
단계 S108에서 상기 데이터 선택기(140)는 상기 마이크로컨트롤러(110) 내의 디지털 출력 모듈(112)에서 출력되는 엔코더 선택신호에 따라 입력되는 4개의 SSI 데이터(SSI #0 DATA, SSI #1 DATA, SSI #2 DATA, SSI #3 DATA) 중 하나를 선택하여, 상기 마이크로컨트롤러(110) 내의 SPI 통신모듈(113)의 입력단자(SPI MISO(Master In, Slave Out) 단자)로 전송한다.In step S108, the
단계 S109에서 상기 SPI 통신모듈(113)은 발생한 SPI 클록에 동기하여 상기 입력단자(SPI MISO 단자)로 입력되는 값을 데이터 화하여 내부 버퍼에 저장한다.In step S109, the
이러한 과정으로 SPI 통신 모듈(113)을 통해 SSI 엔코더의 데이터를 읽게 되며, 이후 단계 S110에서 코어(111)는 상기 SPI 통신모듈(113)의 버퍼의 값을 읽어 SSI 엔코더의 데이터로 사용하게 되는 것이다.In this process, data of the SSI encoder is read through the
이러한 본 발명은 SPI 통신용 마이크로컨트롤러에서 통상의 422 트랜시버, 멀티플렉서만을 이용하여, 용이하게 SSI 엔코더의 데이터를 판독할 수 있으며, 아울러 멀티플렉서의 사용으로 하나의 SPI 통신 모듈을 이용하여 복수의 SSI 엔코더를 인터페이스할 수 있게 되는 것이다.The present invention can easily read the data of the SSI encoder by using only the conventional 422 transceiver and the multiplexer in the SPI communication microcontroller. In addition, by using the multiplexer, a plurality of SSI encoders can be interfaced It will be possible to do.
본 발명은 상술한 특정의 바람직한 실시 예에 한정되지 아니하며, 청구범위에서 청구하는 본 발명의 요지를 벗어남이 없이 당해 발명이 속하는 기술분야에서 통상의 지식을 가진 자라면 누구든지 다양한 변형실시가 가능한 것은 물론이고, 그와 같은 변경은 청구범위 기재의 범위 내에 있게 된다.It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined in the appended claims and their equivalents. Of course, such modifications are within the scope of the claims.
110… 마이크로컨트롤러
111… 코어
112… 디지털 출력 모듈
113… SPI 통신모듈
120… 트랜시버부
121 ~ 124… 422 트랜시버 #0 ~ 422 트랜시버 #3
130… 엔코더부
131 ~ 134… SSI 엔코더 #0 ~ SSI 엔코더 #3
140… 데이터 선택기110 ... Microcontroller
111 ... core
112 ... Digital Output Module
113 ... SPI communication module
120 ... The transceiver unit
121 to 124 ... 422
130 ... Encoder section
131 to 134 ...
140 ... Data selector
Claims (9)
상기 마이크로컨트롤러에서 발생한 SPI클록을 라인 드라이브 방식의 클록으로 변환하여 엔코더부에 출력하고, 상기 엔코더부에서 라인 드라이브 방식으로 출력되는 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 트랜시버부;
상기 마이크로컨트롤러에서 출력되는 엔코더 선택신호에 따라 상기 트랜시버부에서 출력되는 복수의 SSI 데이터 중 하나를 선택하여 상기 마이크로컨트롤러의 상기 입력단자에 입력하는 데이터 선택기를 포함하는 것을 특징으로 하는 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템.
Generates an encoder selection signal, generates an SPI clock corresponding to a set data size, synchronizes a serial peripheral interface (SPI) clock with a synchronous serial interface (SSI) ) A microcontroller that stores the data value of the encoder in a buffer;
A transceiver unit for converting an SPI clock generated by the microcontroller into a clock of a line drive type and outputting the clock to an encoder unit and converting the data output from the encoder unit into a line drive system data into an open collector system;
And a data selector for selecting one of a plurality of SSI data output from the transceiver unit according to an encoder selection signal output from the microcontroller and inputting the selected data to the input terminal of the microcontroller, Using synchronous serial interface system.
SSI 데이터 저장용 버퍼에 더미 값이 기록되면, 설정된 SPI 데이터 크기에 대응하는 SPI 클록을 발생하며, 발생한 상기 SPI 클록에 동기하여 상기 입력단자에 입력되는 값을 데이터화하여 SSI데이터로 상기 버퍼에 저장하는 SPI 통신모듈을 포함하는 것을 특징으로 하는 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템.
The microcontroller according to claim 1,
When a dummy value is written in the SSI data storage buffer, an SPI clock corresponding to the set SPI data size is generated, and the value input to the input terminal is synchronized with the SPI clock generated and stored in the buffer with SSI data And an SPI communication module. The synchronous serial interface system using the SPI communication microcontroller.
엔코더 선택신호를 발생하여 상기 데이터 선택기에 전달하는 디지털 출력모듈을 포함하는 것을 특징으로 하는 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템.
The microcontroller according to claim 2,
And a digital output module for generating and transmitting an encoder selection signal to the data selector.
상기 SPI 통신모듈에 SSI 데이터 크기 이상의 SPI 데이터 크기를 설정하고, 상기 디지털 출력모듈에 엔코더 선택 신호를 제공하며, 상기 SPI 통신모듈의 버퍼에 더미 값을 기록하고, 상기 버퍼에 저장된 데이터를 읽어 SSI 엔코더의 데이터 값으로 사용하는 코어를 포함하는 것을 특징으로 하는 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템.
4. The microcontroller according to claim 3,
A dummy value is written in the buffer of the SPI communication module, and the data stored in the buffer is read out, and the SSI encoder And a core used as a data value of the SPI communication.
The synchronous serial interface system of claim 1, wherein the transceiver unit comprises a plurality of 422 transceivers.
상기 마이크로컨트롤러에서 출력되는 엔코더 선택신호에 따라 상기 복수의 422 트랜시버에서 출력되는 복수의 SSI 데이터 중 하나를 선택하여 상기 마이크로컨트롤러의 상기 입력단자에 입력하는 멀티플렉서로 구성된 것을 특징으로 하는 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스시스템.
The data selector of claim 5,
And a multiplexer for selecting one of a plurality of SSI data output from the plurality of 422 transceivers according to an encoder selection signal output from the microcontroller and inputting the selected SSI data to the input terminal of the microcontroller. Using synchronous serial interface system.
(b) 인터페이스 할 SSI(synchronous serial interface) 엔코더를 선택하는 단계;
(c) SPI 클록을 발생하는 단계;
(d) 상기 SPI 클록을 라인 드라이브 방식의 클록으로 변환하여 SSI 엔코더에 전송하는 단계;
(e) SSI 엔코더에서 발생한 데이터를 오픈 컬렉터 방식의 데이터로 변환하는 단계;
(f) 상기 오픈 컬렉터 방식의 데이터를 SSI 데이터로 버퍼에 저장하는 단계를 포함하는 것을 특징으로 하는 SPI 통신용 마이크로컨트롤러를 이용한 동기 직렬 인터페이스방법.
(a) setting a serial peripheral interface (SPI) data size;
(b) selecting a synchronous serial interface (SSI) encoder to interface with;
(c) generating an SPI clock;
(d) converting the SPI clock into a line drive type clock and transmitting it to the SSI encoder;
(e) converting data generated in the SSI encoder into data in an open collector system;
(f) storing the open collector type data in a buffer in the form of SSI data. The synchronous serial interface method using a microcontroller for SPI communication.
[8] The method of claim 7, wherein the step (a) sets the size of the SPI data to be larger than the size of the SSI data to be interfaced.
The synchronous serial interface method of claim 7, wherein the step (c) generates an SPI clock corresponding to the SPI data size.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020120130034A KR101407996B1 (en) | 2012-11-16 | 2012-11-16 | System for synchronous serial interface using serial peripheral interface microcontroller and method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020120130034A KR101407996B1 (en) | 2012-11-16 | 2012-11-16 | System for synchronous serial interface using serial peripheral interface microcontroller and method thereof |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20140063095A KR20140063095A (en) | 2014-05-27 |
KR101407996B1 true KR101407996B1 (en) | 2014-06-17 |
Family
ID=50891176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020120130034A KR101407996B1 (en) | 2012-11-16 | 2012-11-16 | System for synchronous serial interface using serial peripheral interface microcontroller and method thereof |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101407996B1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20150039142A (en) | 2015-02-16 | 2015-04-09 | 주식회사 이노와이어리스 | Serial peripheral interface with control logic for system performance improvement, and method therefor |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10290268A (en) * | 1997-04-17 | 1998-10-27 | Matsushita Electric Ind Co Ltd | Synchronous serial communication circuit and communicating method |
KR20030065820A (en) * | 2002-02-01 | 2003-08-09 | 삼성전기주식회사 | Apparatus for expanding bus of micro control unit in telematic system |
JP2007306364A (en) | 2006-05-12 | 2007-11-22 | Yaskawa Electric Corp | Transmission system |
JP2012034375A (en) | 2011-08-22 | 2012-02-16 | Hitachi Automotive Systems Ltd | Data communication device and controller using the same |
-
2012
- 2012-11-16 KR KR1020120130034A patent/KR101407996B1/en active IP Right Grant
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10290268A (en) * | 1997-04-17 | 1998-10-27 | Matsushita Electric Ind Co Ltd | Synchronous serial communication circuit and communicating method |
KR20030065820A (en) * | 2002-02-01 | 2003-08-09 | 삼성전기주식회사 | Apparatus for expanding bus of micro control unit in telematic system |
JP2007306364A (en) | 2006-05-12 | 2007-11-22 | Yaskawa Electric Corp | Transmission system |
JP2012034375A (en) | 2011-08-22 | 2012-02-16 | Hitachi Automotive Systems Ltd | Data communication device and controller using the same |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20150039142A (en) | 2015-02-16 | 2015-04-09 | 주식회사 이노와이어리스 | Serial peripheral interface with control logic for system performance improvement, and method therefor |
Also Published As
Publication number | Publication date |
---|---|
KR20140063095A (en) | 2014-05-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102652299B (en) | Semiconductor device and memory system | |
JP2008546063A5 (en) | ||
CN100452885C (en) | High-speeld code-flow playing and receiving device based on PCI | |
CN109427288A (en) | Displaying screen controller, display control program and method | |
US20190362107A1 (en) | Advanced peripheral bus based inter-integrated circuit communication device | |
CN101149722A (en) | Method for executing CPU access to XFP optical module | |
CN104834620A (en) | SPI (serial peripheral interface) bus circuit, realization method and electronic equipment | |
CN116450552B (en) | Asynchronous batch register reading and writing method and system based on I2C bus | |
CN107436851B (en) | Four-line isolation system of serial peripheral interface and control method thereof | |
CN105786741B (en) | SOC high-speed low-power-consumption bus and conversion method | |
CN101146088A (en) | A data bus structure and data transmission method using this structure | |
KR101407996B1 (en) | System for synchronous serial interface using serial peripheral interface microcontroller and method thereof | |
CN102123068A (en) | Multi-bus communication system of cross modulation instrument | |
CN103034610A (en) | Methods and devices for transmission and reception of advanced extensible interface (AXI) bus signal between split modules | |
CN112542193B (en) | FLASH memory of SPI interface for reading data at high speed | |
CN105718401B (en) | The multiplexing method and system of a kind of multichannel SMII signals to MII signals all the way | |
CN211956461U (en) | Serial data communication circuit and system | |
CN205016216U (en) | Display screen interface converting device and intelligent wrist -watch | |
CN201378316Y (en) | Universal input/output interface extension circuit and mobile terminal with same | |
US8015336B2 (en) | Method of compensating for propagation delay of tri-state bidirectional bus in a semiconductor device | |
CN103425616B (en) | SPI-RS232 interface conversions chip and its communication means | |
CN112311458B (en) | Signal transmission method, device, equipment and system | |
CN104469375A (en) | FC-AV protocol processing circuit structure | |
CN1440154A (en) | Phase-matching control system and method for multiple transmission channel | |
CN106294260B (en) | The method that data are output to synchronous bus from asynchronous bus |
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: 20170609 Year of fee payment: 4 |