KR20110067715A - Method for reading data of micro controller - Google Patents

Method for reading data of micro controller Download PDF

Info

Publication number
KR20110067715A
KR20110067715A KR1020090124415A KR20090124415A KR20110067715A KR 20110067715 A KR20110067715 A KR 20110067715A KR 1020090124415 A KR1020090124415 A KR 1020090124415A KR 20090124415 A KR20090124415 A KR 20090124415A KR 20110067715 A KR20110067715 A KR 20110067715A
Authority
KR
South Korea
Prior art keywords
data
memory
error
microcontroller
reference number
Prior art date
Application number
KR1020090124415A
Other languages
Korean (ko)
Other versions
KR101583090B1 (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 KR1020090124415A priority Critical patent/KR101583090B1/en
Publication of KR20110067715A publication Critical patent/KR20110067715A/en
Application granted granted Critical
Publication of KR101583090B1 publication Critical patent/KR101583090B1/en

Links

Images

Abstract

PURPOSE: A method for reading data of a micro controller is provided to prevent the malfunction of a system and increase the reliability of data and stability of the system by reading normal data through busy state of a memory and verification of received data. CONSTITUTION: The busy state of a memory is checked(S12). If the memory is not the busy state, a recording prohibition command enables a chip selection signal to turn on, occupies the memory, and is then transmitted to the memory(S17). A data read request command is transmitted to the memory(S18). If the data are received from the memory, the data error is determined using the checksum added in the received data(S24). If the errors is not found in the data, the data read processing is completed(S26).

Description

마이크로 컨트롤러의 데이터 리드 방법{METHOD FOR READING DATA OF MICRO CONTROLLER}METHOD FOR READING DATA OF MICRO CONTROLLER}

본 발명은 데이터 리드 방법에 관한 것으로, 특히 마이크로 컨트롤러가 외부 메모리에 기록된 데이터의 리드시 데이터의 신뢰성을 높일 수 있는 마이크로 컨트롤러의 데이터 리드 방법에 관한 것이다.BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data read method, and more particularly, to a data read method of a microcontroller capable of increasing the reliability of data when a microcontroller reads data written to an external memory.

일반적으로 차량에서 사용되는 MCU(Micro-Controller Unit)와 같은 마이크로 컨트롤러가 외부 메모리(EEPROM)에 기록된 데이터를 리드(read)할 때, 칩선택 라인과 데이터 라인 등에 노이즈가 유입될 수 있다.Generally, when a microcontroller such as a micro-controller unit (MCU) used in a vehicle reads data recorded in an external memory (EEPROM), noise may be introduced into a chip select line and a data line.

마이크로 컨트롤러는 외부 메모리로부터 데이터 리드할 때 데이터의 체크나 메모리의 상태를 전혀 고려하지 않은 상태에서 리드하고, 리드된 데이터를 마이크로 컨트롤러의 정해진 내부 메모리(RAM)에 저장 및 처리하게 된다.When the microcontroller reads data from an external memory, the microcontroller reads the data without considering the state of the data or the memory, and stores and processes the read data in a predetermined internal memory (RAM) of the microcontroller.

따라서, 메모리로부터 잘못된 데이터가 수신될 경우 잘못된 데이터로 인해 시스템이 오동작되거나 심각한 장애를 유발할 수 있는 문제점이 있다.Therefore, when wrong data is received from the memory, there is a problem that the system may malfunction or cause a serious failure due to the wrong data.

본 발명은 마이크로 컨트롤러가 외부 메모리에 기록된 데이터의 리드(read)시 잘못된 데이터의 수신을 방지하여 데이터의 신뢰성을 높일 수 있는 마이크로 컨트롤러의 데이터 리드 방법을 제공하기 위한 것이다.The present invention is to provide a data read method of a microcontroller that can increase the reliability of the data by preventing the reception of wrong data when the microcontroller reads the data recorded in the external memory.

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

상기 목적을 달성하기 위한 본 발명의 데이터 리드 방법은, 메모리로부터 데이터를 리드할 시점이 되면, 메모리가 동작중(Busy)인지를 체크하는 단계; 상기에서 메모리가 동작중 상태가 아닐 경우 칩 선택 신호를 온시켜 메모리를 점유한 후 기록금지 명령을 메모리로 송신하는 단계; 상기 기록금지 명령을 전송한 후 데이터 리드 요청 명령을 메모리로 송신하는 단계; 상기 메모리로부터 요청한 데이터가 수신되면, 수신된 데이터에 추가된 체크섬(Checksum)을 이용하여 데이터의 오류 여부를 판단하는 단계; 및 상기에서 수신된 데이터의 오류가 없을 경우 데이터의 리드 처리를 완료하는 단계;를 포함하는 것을 특징으로 한다.According to another aspect of the present invention, a data read method includes: checking whether a memory is busy when it is time to read data from the memory; If the memory is not in operation, turning on the chip select signal to occupy the memory and transmitting a write inhibit command to the memory; Transmitting a data read request command to a memory after transmitting the write inhibit command; When the requested data is received from the memory, determining whether the data is in error by using a checksum added to the received data; And completing a read process of data when there is no error of the received data.

구체적으로, 상기 메모리가 동작중(Busy)일 경우에는, 비지 카운트(Busy Count)를 증가시킨 후 누적된 비지 카운트가 설정된 기준횟수를 초과하는지를 판단하는 단계; 및 상기에서 누적된 비지 카운트가 설정된 기준횟수를 초과할 경우 통신 에러로 처리하여 데이터 리드 동작을 종료하는 단계;를 포함하는 것을 특징으로 한다.Specifically, when the memory is busy, determining whether the accumulated busy count exceeds a predetermined reference number after increasing the busy count; And terminating the data read operation by processing as a communication error when the accumulated busy count exceeds a predetermined reference number.

상기에서 수신된 데이터에 오류가 있을 경우, 검증 카운트(Verify Count)를 증가시킨 후 누적된 검증 카운트가 설정된 기준횟수를 초과하는지를 판단하는 단계; 및 상기에서 누적된 검증 카운트가 설정된 기준횟수를 초과하게 되면 통신 에러로 처리하여 데이터 리드 동작을 종료하는 단계;를 포함하는 것을 특징으로 한다.If there is an error in the received data, increasing the verify count and determining whether the accumulated verify count exceeds a set reference number; And terminating the data read operation by processing as a communication error when the accumulated verification count exceeds the set reference number of times.

또한, 상기 데이터의 오류 여부를 체크하기 전에, 데이터의 수신에 이상이 없는지를 판단하는 단계; 상기 데이터의 수신에 이상이 있을 경우 수신에러 카운트를 증가시킨 후 누적된 수신에러 카운트가 설정된 기준횟수를 초과하는지를 판단하는 단계; 및 상기에서 누적된 수신에러 카운트가 설정된 기준횟수를 초과하게 되면 통신 에러로 처리하여 데이터 리드 동작을 종료하는 단계;를 포함하는 것을 특징으로 한다.The method may further include determining whether there is nothing wrong with the reception of the data before checking whether the data is in error; If there is an error in receiving the data, increasing the reception error count and determining whether the accumulated reception error count exceeds a predetermined reference number; And terminating the data read operation by processing as a communication error when the cumulative reception error count exceeds a predetermined reference number.

이상에서 설명한 바와 같이 본 발명은 마이크로 컨트롤러가 외부 메모리에 기록된 데이터를 리드(read)할 때, 메모리의 비지(Busy) 상태와 수신된 데이터의 검증을 통해 정상적인 데이터의 리드가 가능함으로써, 시스템의 오동작을 방지함과 아울러 데이터의 신뢰성과 시스템의 안정성을 높일 수 있는 이점이 있다.As described above, according to the present invention, when the microcontroller reads data written to the external memory, normal data can be read through the busy state of the memory and verification of the received data. In addition to preventing malfunctions, data reliability and system stability are improved.

이하, 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세하게 설명한다. 도면들 중 동일한 구성요소들은 가능한 어느 곳에서든지 동일한 부호로 표시한다. 또한 본 발명의 요지를 불필요하게 흐릴 수 있는 공지 기능 및 구성에 대한 상세한 설명은 생략한다.Hereinafter, with reference to the accompanying drawings will be described in detail a preferred embodiment of the present invention. Like elements in the figures are denoted by the same reference numerals wherever possible. In addition, detailed descriptions of well-known functions and configurations that may unnecessarily obscure the subject matter of the present invention will be omitted.

도 1은 본 발명에 적용된 마이크로 컨트롤러와 메모리를 나타낸 도면이고, 도 2는 마이크로 컨트롤러의 기록금지 명령어 처리 시퀀스를 나타낸 도면이고, 도 3은 마이크로 컨트롤러의 데이터 리드 처리 시퀀스를 나타낸 도면이다.1 is a diagram showing a microcontroller and a memory applied to the present invention, FIG. 2 is a diagram showing a write inhibit instruction processing sequence of a microcontroller, and FIG. 3 is a diagram showing a data read processing sequence of a microcontroller.

먼저, MCU(Micro-Controller Unit)와 같은 마이크로 컨트롤러(10)는, 칩 선택 신호를 출력하는 선택출력단자(CS)와, 동기를 위한 클록신호를 출력하는 동기클록단자(SCK)와, 메모리(50)로 각종 명령과 데이터를 출력하는 시리얼출력단자(SO), 및 메모리(50)로부터 데이터를 입력받는 시리얼입력단자(SI)를 포함하여 구성된다.First, the microcontroller 10 such as a micro-controller unit (MCU) includes a selection output terminal CS for outputting a chip selection signal, a synchronous clock terminal SCK for outputting a clock signal for synchronization, and a memory ( 50) a serial output terminal (SO) for outputting various commands and data, and a serial input terminal (SI) for receiving data from the memory (50).

그리고, EEPROM과 같은 외부 메모리(50)는, 마이크로 컨트롤러(10)의 선택출력단자(CS)로부터 칩 선택 신호를 입력받는 칩선택단자(CS)와, 마이크로 컨트롤러(10)의 동기클록단자(SCK)로부터 동기를 위한 클록신호를 입력받는 클록단자(SK)와, 마이크로 컨트롤러(10)의 시리얼출력단자(SO)로부터 각종 명령과 데이터를 입력받는 데이터입력단자(DI), 및 마이크로 컨트롤러(10)로 요청된 데이터를 출력하 는 데이터출력단자(DO)를 포함하여 구성된다.The external memory 50 such as an EEPROM includes a chip select terminal CS that receives a chip select signal from the select output terminal CS of the microcontroller 10, and a synchronous clock terminal SCK of the microcontroller 10. Clock terminal (SK) for receiving a clock signal for synchronization from the control unit, a data input terminal (DI) for receiving various commands and data from the serial output terminal (SO) of the microcontroller 10, and the microcontroller (10). It includes a data output terminal (DO) for outputting the requested data.

상기 마이크로 컨트롤러(10)와 메모리(50)는 시리얼 인터페이스로 연결되는 데, 도시된 바와 같이 마이크로 컨트롤러(10)의 선택출력단자(CS)와 동기클록단자(SCK), 시리얼출력단자(SO), 및 시리얼입력단자(SI)는, 메모리(50)의 칩선택단자(CS), 클록단자(SK), 데이터입력단자(DI) 및 데이터출력단자(DO)에 각각 연결된다.The microcontroller 10 and the memory 50 are connected by a serial interface, as shown in the selection output terminal CS, the synchronous clock terminal SCK, the serial output terminal SO, and the like. The serial input terminal SI is connected to the chip select terminal CS, the clock terminal SK, the data input terminal DI, and the data output terminal DO of the memory 50, respectively.

상기 마이크로 컨트롤러(10)와 메모리(50)는 시리얼(Serial) 통신을 기본으로 하며, 메모리(50)의 데이터 리드 처리는 1ms 주기로 실행된다.The microcontroller 10 and the memory 50 are based on serial communication, and the data read processing of the memory 50 is performed at a 1 ms period.

여기서, 마이크로 컨트롤러는 데이터 리드를 시스템 기동시(Power On)에 1회 정도를 실시할 수 있다.Here, the microcontroller can perform data read once about at system startup (Power On).

이와 같이 구성된 마이크로 컨트롤러(10)와 메모리(50)의 일반적인 데이터 리드를 위한 시퀀스를 도 2 및 도 3을 참조하여 살펴보면 아래와 같다.The sequence for reading the general data of the microcontroller 10 and the memory 50 configured as described above will be described with reference to FIGS. 2 and 3.

도 2에 도시된 바와 같이 메모리(50)에 데이터를 리드하기 전에, 마이크로 컨트롤러(10)는 선택출력단자(CS)를 통해 칩 선택 신호를 온시켜 메모리(50)를 점유한 후 시리얼출력단자(SO)를 통해 데이터 기록금지 명령을 메모리(50)로 송신한다. 이에 따라 메모리(50)는 외부에서 입력되는 어떠한 데이터도 기록하지 않고 마이크로 컨트롤러(10)로부터 입력되는 명령을 대기하게 된다.As shown in FIG. 2, before the data is read into the memory 50, the microcontroller 10 turns on the chip select signal through the selection output terminal CS to occupy the memory 50 and then the serial output terminal ( A data write inhibit command is sent to the memory 50 via SO). Accordingly, the memory 50 waits for a command input from the microcontroller 10 without recording any data input from the outside.

도 2에서 보듯이 선택출력단자(CS)를 통해 칩 선택 신호가 온되는 구간 내에서 시리얼출력단자(SO)를 통해 기록금지 명령이 전송되고, 기록금지 명령이 모두 전송되면 상기 칩 선택 신호는 오프된다.As shown in FIG. 2, the write prohibition command is transmitted through the serial output terminal SO within a section in which the chip select signal is turned on through the select output terminal CS. When the write prohibit commands are transmitted, the chip select signal is turned off. do.

이어, 마이크로 컨트롤러(10)는 도 3과 같이 선택출력단자(CS)를 통해 칩 선택 신호를 온시켜 메모리(50)를 점유한 후 시리얼출력단자(SO)를 통해 리드 요청 명령과 그 어드레스를 메모리(50)로 송신하고, 메모리(50)는 해당 어드레스에 기록된 데이터를 리드하여 데이터출력단자(DO)를 통해 마이크로 컨트롤러(10)로 출력한다.Subsequently, the microcontroller 10 turns on the chip select signal through the selection output terminal CS to occupy the memory 50 and then stores the read request command and its address through the serial output terminal SO. And the memory 50 reads the data recorded at the corresponding address and outputs the data to the microcontroller 10 through the data output terminal DO.

이에 따라 마이크로 컨트롤러(10)는 시리얼입력단자(SI)를 통해 메모리(50)로부터 전송된 데이터를 수신하게 된다.Accordingly, the microcontroller 10 receives the data transmitted from the memory 50 through the serial input terminal SI.

도 3에서 보듯이 선택출력단자(CS)를 통해 칩 선택 신호가 온되는 구간 내에서 시리얼출력단자(SO)를 통해 리드 요청 명령이 전송되고, 요청한 데이터가 메모리(50)로부터 모두 수신되면 상기 칩 선택 신호는 다시 오프된다.As shown in FIG. 3, the read request command is transmitted through the serial output terminal SO within a section in which the chip select signal is turned on through the selection output terminal CS, and when the requested data is received from the memory 50, the chip is transmitted. The select signal is turned off again.

상기와 같은 시퀀스를 통해 데이터의 리드가 수행된다.Read of data is performed through the above sequence.

하지만, 마이크로 컨트롤러(10)가 소정의 데이터를 메모리(50; EEPROM)에 리드(read)할 때, 칩 선택 라인과 데이터 라인 등에 노이즈가 유입되면 정상적인 데이터의 리드가 불가능하게 된다.However, when the microcontroller 10 reads predetermined data into the memory 50 (EEPROM), if noise flows into the chip select line and the data line, the normal data cannot be read.

이에 따라 데이터의 리드처리에 대한 에러를 체크할 필요가 있으며, 본 발명에서는 대략 3가지 유형의 에러 체크 방법을 제시한다. 즉, 메모리(50)의 사용중 또는 동작중 여부를 체크하는 비지 체크(Busy Check)와, 데이터가 정상적으로 수신되었는지를 체크하는 수신 체크(Receive Check), 및 체크섬(Checksum)을 이용하여 리드된 데이터의 오류 여부를 검증하는 검증 체크(Verify Check) 방법이 있을 수 있다.Accordingly, it is necessary to check an error for data read processing, and the present invention proposes approximately three types of error checking methods. That is, a busy check for checking whether the memory 50 is in use or in operation, a receive check for checking whether the data has been received normally, and a checksum of the read data. There may be a verify check method for verifying an error.

도 4a 및 도 4b는 본 발명의 실시예에 의한 데이터 리드 절차를 나타낸 플로우챠트로서, 도 1 내지 도 3을 참조하여 살펴보면 아래와 같다.4A and 4B are flowcharts illustrating a data reading procedure according to an embodiment of the present invention, which will be described below with reference to FIGS. 1 to 3.

먼저, 마이크로 컨트롤러(10)는 외부 메모리(50; EEPROM)로부터 데이터를 리드할 시점인지를 판단하게 된다(S11). 일반적으로 마이크로 컨트롤러(10)는 시스템 기동시 메모리(50)에 저장된 소정의 데이터를 리드하게 된다.First, the microcontroller 10 determines whether it is time to read data from the external memory 50 (EEPROM) (S11). In general, the microcontroller 10 reads predetermined data stored in the memory 50 at system startup.

상기 메모리(50)로부터 데이터를 리드할 시점이면 마이크로 컨트롤러(10)는 메모리(50)의 칩선택단자(CS)를 통해 메모리(50)가 동작중(Busy)인지를 체크하게 된다(S12). When the data is read from the memory 50, the microcontroller 10 checks whether the memory 50 is busy (Busy) through the chip select terminal CS of the memory 50 (S12).

상기에서 메모리(50)가 동작중(Busy)일 경우(S13), 마이크로 컨트롤러(10)는 비지 카운트(Busy Count)를 증가시킨 후 누적된 비지 카운트가 설정된 기준횟수를 초과하는지를 판단하게 된다(S14, S15). 상기 비지 카운트에 대한 기준횟수는 3회 정도가 될 수 있다.When the memory 50 is busy (S13), the microcontroller 10 increases the busy count and then determines whether the accumulated busy count exceeds the set reference number (S14). , S15). The reference frequency for the busy count may be about three times.

상기(S15)에서 누적된 비지 카운트가 설정된 기준횟수를 초과하지 않을 경우, 반복적으로 메모리(50)의 동작중 여부를 체크하게 된다(S12). 만일 상기(S15)에서 누적된 비지 카운트가 설정된 기준횟수를 초과하게 되면 에러로 처리한 후 데이터 리드 동작을 종료하게 된다(S16).If the accumulated busy count in step S15 does not exceed the set reference number, it is checked whether the memory 50 is in operation (S12). If the accumulated busy count in step S15 exceeds the set reference number of times, the data read operation is terminated after processing as an error (S16).

사실, 메모리(50)는 마이크로 컨트롤러(10)와 연결되어 있으므로, 마이크로 컨트롤러(10)의 칩 선택 신호 이외의 동작중 상태가 메모리(50)에서 체크된다면 메모리(50)의 통신 인터페이스에 일정 문제가 있다는 것을 의미한다.In fact, since the memory 50 is connected to the microcontroller 10, if a state in operation other than the chip select signal of the microcontroller 10 is checked in the memory 50, a certain problem may occur in the communication interface of the memory 50. It means that there is.

상기(S13)에서 메모리(50)가 동작중(Busy) 상태가 아닐 경우, 마이크로 컨트 롤러(10)는 도 2와 같이 선택출력단자(CS)를 통해 칩 선택 신호를 온시켜 메모리(50)를 점유한 후 시리얼출력단자(SO)를 통해 기록금지 명령을 메모리(50)로 송신한다(S17). 상기 선택출력단자(CS)를 통해 칩 선택 신호가 온되는 구간 내에서 시리얼출력단자(SO)를 통해 기록금지 명령이 전송되고, 기록금지 명령이 모두 전송되면 상기 칩 선택 신호는 오프된다. 이에 따라 메모리(50)는 외부에서 입력되는 어떠한 데이터도 기록하지 않고 마이크로 컨트롤러(10)로부터 입력되는 명령을 대기하게 된다. In operation S13, when the memory 50 is not in a busy state, the microcontroller 10 turns on the chip selection signal through the selection output terminal CS as shown in FIG. 2. After occupying, the write inhibit command is transmitted to the memory 50 through the serial output terminal SO (S17). The write prohibition command is transmitted through the serial output terminal SO within the section in which the chip select signal is turned on through the selection output terminal CS. When all the write prohibition commands are transmitted, the chip select signal is turned off. Accordingly, the memory 50 waits for a command input from the microcontroller 10 without recording any data input from the outside.

이어, 마이크로 컨트롤러(10)는 도 3과 같이 선택출력단자(CS)를 통해 칩 선택 신호를 온시켜 메모리(50)를 점유한 후 시리얼출력단자(SO)를 통해 데이터 리드 요청 명령과 그 어드레스를 메모리(50)로 송신하고, 메모리(50)는 해당 어드레스에 기록된 데이터를 리드하여 데이터출력단자(DO)를 통해 마이크로 컨트롤러로 전송한다(S18). 이에 따라 마이크로 컨트롤러(10)는 시리얼입력단자(SI)를 통해 메모리(50)로부터 전송된 데이터를 수신하게 된다(S19). Subsequently, the microcontroller 10 turns on the chip select signal through the selection output terminal CS and occupies the memory 50 as shown in FIG. 3, and then receives the data read request command and its address through the serial output terminal SO. The memory 50 transmits the data recorded at the corresponding address to the microcontroller through the data output terminal DO (S18). Accordingly, the microcontroller 10 receives the data transmitted from the memory 50 through the serial input terminal SI (S19).

여기서, 마이크로 컨트롤러(10)는 선택출력단자(CS)를 통해 칩 선택 신호가 온되는 구간 내에서 시리얼출력단자(SO)를 통해 리드 요청 명령을 전송하고, 요청한 데이터가 메모리(50)로부터 모두 수신되면 상기 칩 선택 신호는 다시 오프된다. 또한, 메모리(50)는 데이터를 전송할 때 요청된 데이터에 체크섬(checksum) 데이터를 추가하여 전송할 수 있다.Here, the microcontroller 10 transmits a read request command through the serial output terminal SO within a section in which the chip select signal is turned on through the selection output terminal CS, and receives all the requested data from the memory 50. The chip select signal is turned off again. Also, the memory 50 may add checksum data to the requested data and transmit the data when transmitting the data.

한편, 마이크로 컨트롤러(10)는 데이터 수신시에 수신 이상이 없는지를 판단하게 되고(S20), 만일 데이터의 수신에 이상이 있을 경우 수신에러 카운트(Receive Error Count)를 증가시킨 후 누적된 수신에러 카운트가 설정된 기준횟수를 초과하는지를 판단하게 된다(S21, S22). 상기 수신에러 카운트에 대한 기준횟수는 3회 정도가 될 수 있다.On the other hand, the microcontroller 10 determines whether there is a reception error when receiving data (S20), and if there is an error in the reception of data, the reception error count accumulated after increasing the reception error count (Receive Error Count). It is determined whether is over the set reference number (S21, S22). The reference frequency for the received error count may be about three times.

상기(S22)에서 누적된 수신에러 카운트가 설정된 기준횟수를 초과하지 않을 경우, 반복적으로 메모리(50)의 동작중 여부를 체크하게 된다(S12). 만일 상기(S22)에서 누적된 수신에러 카운트가 설정된 기준횟수를 초과하게 되면 에러로 처리한 후 데이터 리드 동작을 종료하게 된다(S23).When the reception error count accumulated in the step S22 does not exceed the set reference number, it is repeatedly checked whether the memory 50 is in operation (S12). If the cumulative reception error count exceeds the set reference number in step S22, the data reading operation is terminated after processing as an error (S23).

상기에서, 메모리(50)에 칩 선택 신호를 전송하기 전에 그리고 메모리(50)에 리드 요청 명령을 전송하기 전에 각각 상기 메모리(50)의 동작중 여부를 체크하는 과정(S12)을 한번 더 수행할 수 있다.In the above, before the chip select signal is transmitted to the memory 50 and before the read request command is transmitted to the memory 50, the step S12 of checking whether the memory 50 is in operation is performed once more. Can be.

상기 메모리(50)로부터 데이터가 정상적으로 수신되면, 마이크로 컨트롤러(10)는 수신된 데이터에 추가된 체크섬 데이터를 이용하여 데이터 이상 여부를 검증하게 된다(S24). 여기서, 체크섬(checksum)은 중복 검사의 한 형태로, 송신된 데이터의 무결성을 체크하기 위한 검사 방식이다. 송신측에서는 데이터에 체크섬을 추가하여 보내고, 수신측에서는 체크섬이 포함된 데이터를 정해진 방식으로 계산하여 데이터의 오류 여부를 체크하게 된다.When data is normally received from the memory 50, the microcontroller 10 verifies whether the data is abnormal using the checksum data added to the received data (S24). Here, a checksum is a form of redundancy check and is a check method for checking the integrity of transmitted data. The sender adds a checksum to the data and sends it. The receiver calculates the data including the checksum in a predetermined manner and checks whether the data is in error.

상기에서 체크섬 데이터를 이용하여 계산한 결과 수신된 데이터가 정상이면, 마이크로 컨트롤러(10)는 통신 인터페이스 및 리드 처리에 문제가 없는 것으로 판단하여 데이터의 리드 처리를 완료하게 된다(S26).If the received data is normal as a result of the calculation using the checksum data, the microcontroller 10 determines that there is no problem in the communication interface and the read process, and completes the read process of the data (S26).

하지만, 상기(S25)에서 체크섬 데이터를 이용하여 계산한 결과 수신된 데이 터에 이상이 있을 경우, 마이크로 컨트롤러(10)는 검증 카운트(Verify Count)를 증가시킨 후 누적된 검증 카운트가 설정된 기준횟수를 초과하는지를 판단하게 된다(S27, S28).However, if there is an abnormality in the received data as a result of the calculation using the checksum data at step S25, the microcontroller 10 increases the verify count and then accumulates the reference number in which the accumulated verify count is set. It is determined whether it exceeds (S27, S28).

상기(S25)에서 누적된 검증 카운트가 설정된 기준횟수를 초과하지 않을 경우, 마이크로 컨트롤러(10)는 다시 메모리(50)의 동작중 여부를 체크하는 과정(S12)부터 재수행하게 된다. 만일 상기(S28)에서 누적된 검증 카운트가 설정된 기준횟수를 초과하게 되면 통신 에러로 처리한 후 데이터 리드 동작을 종료하게 된다(S29).If the accumulated verification count in step S25 does not exceed the set reference number, the microcontroller 10 re-performs the process of checking whether the memory 50 is in operation (S12). If the accumulated verification count in S28 exceeds the set reference number, the data read operation is terminated after processing as a communication error (S29).

한편, 도 4a 및 도 4b에서 도시하지는 않았지만, 마이크로 컨트롤러(10)는 메모리(50)로 소정의 명령을 전송하기 전에 메모리(50)의 칩선택단자(CS)를 통해 동작중 여부를 매번 체크하고, 이상이 없을 경우 소정의 명령을 메모리(50)에 전송하는 것이 바람직하다.Although not shown in FIGS. 4A and 4B, the microcontroller 10 checks whether the microcontroller 10 is operating through the chip select terminal CS of the memory 50 before transmitting a predetermined command to the memory 50. If there is no abnormality, it is preferable to transmit a predetermined command to the memory 50.

상기의 본 발명은 바람직한 실시예를 중심으로 살펴보았으며, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명의 본질적 기술 범위 내에서 상기 본 발명의 상세한 설명과 다른 형태의 실시예들을 구현할 수 있을 것이다. 여기서 본 발명의 본질적 기술범위는 특허청구범위에 나타나 있으며, 그와 동등한 범위 내에 있는 모든 차이점은 본 발명에 포함된 것으로 해석되어야 할 것이다.The present invention has been described with reference to the preferred embodiments, and those skilled in the art to which the present invention pertains to the detailed description of the present invention and other forms of embodiments within the essential technical scope of the present invention. Could be. Here, the essential technical scope of the present invention is shown in the claims, and all differences within the equivalent range will be construed as being included in the present invention.

도 1은 본 발명에 적용된 마이크로 컨트롤러와 메모리를 나타낸 도면이다.1 is a view showing a microcontroller and a memory applied to the present invention.

도 2는 마이크로 컨트롤러의 기록금지 명령어 처리 시퀀스를 나타낸 도면이다.2 is a diagram illustrating a write inhibit instruction processing sequence of a microcontroller.

도 3은 마이크로 컨트롤러의 데이터 리드 처리 시퀀스를 나타낸 도면이다.3 is a diagram illustrating a data read processing sequence of a microcontroller.

도 4a 및 도 4b는 본 발명의 실시예에 의한 데이터 리드 절차를 나타낸 플로우챠트이다.4A and 4B are flowcharts illustrating a data reading procedure according to an embodiment of the present invention.

Claims (7)

메모리로부터 데이터를 리드할 시점이 되면, 메모리가 동작중(Busy)인지를 체크하는 단계;When it is time to read data from the memory, checking whether the memory is busy; 상기에서 메모리가 동작중 상태가 아닐 경우 칩 선택 신호를 온시켜 메모리를 점유한 후 기록금지 명령을 메모리로 송신하는 단계;If the memory is not in operation, turning on the chip select signal to occupy the memory and transmitting a write inhibit command to the memory; 상기 기록금지 명령을 전송한 후 데이터 리드 요청 명령을 메모리로 송신하는 단계; Transmitting a data read request command to a memory after transmitting the write inhibit command; 상기 메모리로부터 요청한 데이터가 수신되면, 수신된 데이터에 추가된 체크섬(Checksum)을 이용하여 데이터의 오류 여부를 판단하는 단계; 및When the requested data is received from the memory, determining whether the data is in error by using a checksum added to the received data; And 상기에서 수신된 데이터의 오류가 없을 경우 데이터의 리드 처리를 완료하는 단계;를 포함하는 마이크로 컨트롤러의 데이터 리드 방법.Completing the read process of the data when there is no error of the data received in the above. 제 1 항에 있어서,The method of claim 1, 상기 메모리가 동작중(Busy)일 경우에는, If the memory is busy (Busy), 비지 카운트(Busy Count)를 증가시킨 후 누적된 비지 카운트가 설정된 기준횟수를 초과하는지를 판단하는 단계; 및 상기에서 누적된 비지 카운트가 설정된 기준횟수를 초과할 경우 통신 에러로 처리하여 데이터 리드 동작을 종료하는 단계;를 포함하는 마이크로 컨트롤러의 데이터 리드 방법.Determining whether the accumulated busy count exceeds a predetermined reference number after increasing the busy count; And terminating the data read operation by processing as a communication error when the accumulated busy count exceeds a predetermined reference number. 제 1 항에 있어서,The method of claim 1, 상기에서 수신된 데이터에 오류가 있을 경우, If there is an error in the data received above, 검증 카운트(Verify Count)를 증가시킨 후 누적된 검증 카운트가 설정된 기준횟수를 초과하는지를 판단하는 단계; 및 상기에서 누적된 검증 카운트가 설정된 기준횟수를 초과하게 되면 통신 에러로 처리하여 데이터 리드 동작을 종료하는 단계;를 포함하는 마이크로 컨트롤러의 데이터 리드 방법.Determining whether the accumulated verification count exceeds a predetermined reference number after increasing the verification count; And terminating the data read operation by processing as a communication error when the accumulated verification count exceeds a predetermined reference number. 제 3 항에 있어서,The method of claim 3, wherein 상기에서 누적된 검증 카운트가 설정된 기준횟수를 초과하지 않을 경우, 메모리의 동작중 여부를 체크하는 과정부터 재수행하는 마이크로 컨트롤러의 데이터 리드 방법.If the accumulated verification count does not exceed the set reference number, the data read method of the microcontroller is performed by checking whether the memory is in operation. 제 1 항에 있어서,The method of claim 1, 상기 메모리에 소정의 명령을 전송하기 전에, 동작중 여부를 매번 체크하고, 이상이 없을 경우 소정의 명령을 메모리에 전송하는 마이크로 컨트롤러의 데이터 리드 방법.A method of reading data of a microcontroller, which checks whether an operation is performed each time before transmitting a predetermined command to the memory, and transmits a predetermined command to the memory if there is no error. 제 1 항에 있어서,The method of claim 1, 상기 동작중 여부는 메모리의 칩선택단자를 통해 체크하는 마이크로 컨트롤러의 데이터 리드 방법.The microcontroller data read method of checking whether the operation is performed through the chip select terminal of the memory. 제 1 항에 있어서,The method of claim 1, 상기 데이터의 오류 여부를 체크하기 전에, Before checking the data for errors, 데이터의 수신에 이상이 없는지를 판단하는 단계; 상기 데이터의 수신에 이상이 있을 경우 수신에러 카운트를 증가시킨 후 누적된 수신에러 카운트가 설정된 기준횟수를 초과하는지를 판단하는 단계; 및 상기에서 누적된 수신에러 카운트가 설정된 기준횟수를 초과하게 되면 통신 에러로 처리하여 데이터 리드 동작을 종료하는 단계;를 포함하는 마이크로 컨트롤러의 데이터 리드 방법.Determining whether there is no abnormality in reception of data; If there is an error in receiving the data, increasing the reception error count and determining whether the accumulated reception error count exceeds a predetermined reference number; And terminating the data read operation by processing as a communication error when the cumulative reception error count exceeds a predetermined reference number.
KR1020090124415A 2009-12-15 2009-12-15 Method for reading data of micro controller KR101583090B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020090124415A KR101583090B1 (en) 2009-12-15 2009-12-15 Method for reading data of micro controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020090124415A KR101583090B1 (en) 2009-12-15 2009-12-15 Method for reading data of micro controller

Publications (2)

Publication Number Publication Date
KR20110067715A true KR20110067715A (en) 2011-06-22
KR101583090B1 KR101583090B1 (en) 2016-01-07

Family

ID=44400114

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020090124415A KR101583090B1 (en) 2009-12-15 2009-12-15 Method for reading data of micro controller

Country Status (1)

Country Link
KR (1) KR101583090B1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR960042368A (en) * 1995-05-12 1996-12-21 이대원 Serial Ipyrom Lead / Write Device and Method
KR20070024624A (en) * 2004-06-23 2007-03-02 아트멜 코포레이숀 Simultaneous external read operation during internal programming in a flash memory device
KR20080077657A (en) * 2005-11-28 2008-08-25 아트멜 코포레이션 Microcontroller based flash memory digital controller system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR960042368A (en) * 1995-05-12 1996-12-21 이대원 Serial Ipyrom Lead / Write Device and Method
KR20070024624A (en) * 2004-06-23 2007-03-02 아트멜 코포레이숀 Simultaneous external read operation during internal programming in a flash memory device
KR20080077657A (en) * 2005-11-28 2008-08-25 아트멜 코포레이션 Microcontroller based flash memory digital controller system

Also Published As

Publication number Publication date
KR101583090B1 (en) 2016-01-07

Similar Documents

Publication Publication Date Title
US8683457B1 (en) Updating firmware of an electronic device by storing a version identifier in a separate header
US20190272252A1 (en) Method of processing deadlock of i2c bus, electronic device and communication system
US7668995B2 (en) IIC bus communication system capable of suppressing freeze of IIC bus communication and method for controlling IIC bus communication
US10721022B2 (en) Communication apparatus, communication method, program, and communication system
EP2381266A1 (en) Self-diagnosis system and test circuit determination method
KR102375363B1 (en) Communication device, communication method, program, and communication system
KR100607992B1 (en) Method and system for booting system by monitoring operating status of NAND flash memory
KR20110067715A (en) Method for reading data of micro controller
US8291270B2 (en) Request processing device, request processing system, and access testing method
JP4042790B2 (en) Electrical device and method for determining normal communication function in electrical device
US9495315B2 (en) Information processing device and data communication method
US20090228745A1 (en) Error backup method
KR20110067714A (en) Method for writing data of micro controller
WO2017199762A1 (en) Communication device, communication method, program, and communication system
JP2007272943A (en) Nonvolatile semiconductor storage device
JP2017208713A (en) Communication device, communication method, program, and communication system
JP2017207934A (en) Communication device, communication method, program, and communication system
KR101977955B1 (en) Apparatus and method for monitoring Microcontroller Unit
JP7211173B2 (en) COMMUNICATION CONTROL DEVICE, ELECTRONIC DEVICE, COMMUNICATION CONTROL METHOD, AND COMMUNICATION CONTROL PROGRAM
WO2013021423A1 (en) Reprogramming system and reprogramming method
KR102154245B1 (en) Software-based reconfiguration unit within the satellite
JP2005339436A (en) Electronic equipment and control method
JP6100551B2 (en) Electronics
US8639977B2 (en) Control device
KR100729090B1 (en) Rom correction method of combo 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
FPAY Annual fee payment

Payment date: 20181112

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20191111

Year of fee payment: 5