[go: up one dir, main page]

CN1186984A - Microcontroller Error Correction Method and Device - Google Patents

Microcontroller Error Correction Method and Device Download PDF

Info

Publication number
CN1186984A
CN1186984A CN97100301A CN97100301A CN1186984A CN 1186984 A CN1186984 A CN 1186984A CN 97100301 A CN97100301 A CN 97100301A CN 97100301 A CN97100301 A CN 97100301A CN 1186984 A CN1186984 A CN 1186984A
Authority
CN
China
Prior art keywords
reset
microcontroller
program
delay circuit
error correction
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN97100301A
Other languages
Chinese (zh)
Inventor
余国成
孙葆祥
林怡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hetai Semiconductor Co ltd
Original Assignee
Hetai Semiconductor Co ltd
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 Hetai Semiconductor Co ltd filed Critical Hetai Semiconductor Co ltd
Priority to CN97100301A priority Critical patent/CN1186984A/en
Publication of CN1186984A publication Critical patent/CN1186984A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

A method for correcting error of microcontroller includes providing a reset instruction code to reset instruction code circuit, generating reset signal by a delay circuit and executing reset instruction to reset microcontroller when program is error. The present invention features that the reset instruction decoder is used to decode the reset instruction and the delay circuit is used to receive the decoded signal from the reset instruction decoder for extension, and the reset instruction provides the programmer with the starting state and the decoded instruction is filled into the program gap for resetting the microcontroller to restore when the program executing error enters the program gap.

Description

The method and apparatus of correcting mistakes of microcontroller
The invention relates to a kind of method and apparatus of correcting mistakes of microcontroller, particularly method and the device that makes microcontroller be reset and recover relevant for a reset indication.
Microcontroller is a control element based on program (program based), and program is given signal that microcontroller should receive and to the signal that receives analysis and judgement in addition, and then takes appropriate reaction.Yet because it is the control module based on program, the situation beyond occurring in case be interfered expecting promptly may make program error stuck.Normal in order to reply after program is made mistake, partly microcontroller provides so-called Watch Dog Timer (watch dog timer) method, that is, use a timer, just often as program, promptly by the program reset clocking value, when removed at the program end in case arrive timing time, the program that then is considered as had made a mistake, so timer initiation one replacement signal generating circuit, produce the circuit of replacement signal, make it be returned to the program that opens the beginning state and re-execute with replacement microcontroller inside.But, when program makes a mistake, must waiting timer overflow, the microcontroller of can resetting, if program error, but still when can be before the timer overflow clocking value being removed, then this timer is just ineffective.As shown in Figure 1, be general microcontroller application configuration figure, this figure shows general microcontroller, and its application configuration has mother block 1-1,1-2, secondary program segment (2), stage casing service routine section (3), reaches data section (4), and master routine is responsible for the running of microcontroller; Secondary program provides common procedure partly to call out to master routine and uses, so that master routine is reduced; Interrupt service routine provides the emergency control of processing events at once; Data section then stored routine is carried out required data, can be a table of comparisons, also can be a data bank end, visual range preface required and deciding.And Fig. 2 is the execution flow process of these program segments, there is a little gap 21 between each section of the program among Fig. 1,22,23,24,25, make program between each section, switch execution according to flow process shown in Figure 2, when carrying out, program error breaks former executive routine sometimes, for example enter by interrupt service routine (3) crossing gap mother block (two) (1-2) or from mother block () (1-1) improper crossing gap enter interrupt service routine, since above-mentioned each program segment when normal the execution for avoiding the timer overflow, so all be embedded with the instruction of removing timer in inside, use the timer overflow in case the practice of processing procedure preface mistake will lose efficacy this moment.
Shortcoming at prior art, one of the object of the invention is promptly providing a kind of method and apparatus of correcting mistakes of microcontroller, the recovery of being reset when providing a reset indication sign indicating number to make the said procedure mistake, this circuit also can provide the programmer to control microcontroller to reply the beginning state that opens.
Another object of the present invention is according to this kind of the present invention method and apparatus of correcting mistakes, because of it is the recovery of being reset when making the microcontroller program error by an order code, thus program error, the microcontroller of can resetting immediately.
Another purpose of the present invention is according to this kind of the present invention method and apparatus of correcting mistakes, because do not start the replacement signal generating circuit by timer, produce the circuit of replacement signal with replacement microcontroller inside, make it be returned to the program that opens the beginning state and re-execute, so promptly there is not the situation of existing method generation timer expiration.
A kind of method of correcting mistakes of microcontroller, it is characterized in that remapping method is to utilize reset indication sign indicating number to a reset indication decoding circuit is provided, utilize a delay circuit to produce the replacement signal again, see through when making program error and carry out reset indication and make the microcontroller recovery of being reset.
A kind of device of correcting mistakes of microcontroller, it is characterized in that this device comprises a reset indication demoder and a delay circuit, the reset indication demoder can receive the reset indication sign indicating number, after decoding and judging that it is the replacement order code, this reset indication demoder can trigger delay circuit, to produce the replacement signal of regular length, make the microcontroller recovery of being reset.
As for detailed construction of the present invention, effect and effect, can be illustrated and fully understanding according to following accompanying drawing.
Fig. 1 is the application configuration figure of existing microcontroller.
Fig. 2 is the program execution flow figure of general microcontroller.
Fig. 3 is the device calcspar of correcting mistakes of the present invention.
Fig. 4 is for realizing the circuit diagram of calcspar among Fig. 3.
Fig. 5 is used for the embodiment of microcontroller for the present invention.
The method of correcting mistakes of microcontroller of the present invention is to utilize a reset indication is provided, and through carrying out reset indication micro-controller resetting is recovered when making the microcontroller program error.For realizing purpose of the present invention, the invention provides a kind of microcontroller device of correcting mistakes, with reference to figure 3, this figure is the device calcspar of correcting mistakes of the present invention.So shown in the calcspar, the device of correcting mistakes of the present invention comprises a reset indication demoder 101 makes the reset indication decoding, and the reset indication decoding circuit can be made of Sheffer stroke gate (NAND).And delay circuit 102 accepts the decoding signal that reset indication demoder 101 sends here and prolonged, and delay circuit can be made of flip-flop.More specifically, order code IB is sent by working storage, reset indication demoder 101 receive order code IB that instruction registors send and with its decoding judging whether it is the replacement order code, if the reset indication sign indicating number then trigger delay circuit 102 with the replacement signal that produces regular length to carry out the replacement of microcontroller.This reset indication sign indicating number removes and to provide the programmer to use, and outside usefulness that opens the beginning situation, as if in the program space of this order code being inserted Fig. 1 the time, the microcontroller of can resetting when program execution error enters the program space makes its recovery.
Fig. 4 is one embodiment of the invention, in this embodiment, be as the reset indication sign indicating number with 11111111B, the order code that the reset indication decoding circuit is sent instruction registor (IB0~IB7) decoding, if 11111111B then produces trigger signals and eliminates delay circuit 102, the accurate replacement microcontroller in delay circuit output LOW voltage position this moment, after four time pulse signals produce, the delay circuit 102 accurate replacements that finish microcontroller in output high pressure position.
Fig. 5 is applied to the embodiment of microcontroller circuit for the present invention, and is as shown in the drawing, and circuit of the present invention can use with reset signal input and Watch Dog Timer of the external world, with the replacement microcontroller.
From the above mentioned as can be known, the method of correcting mistakes and the device of microcontroller of the present invention can remedy the deficiency of known timer method really, and the program that makes a mistake is reset, prevent that microcontroller lost efficacy, and it is not seen in public use and publication.
The above is a preferable specific embodiment of the present invention, if comply with the change that conception of the present invention is done, and the function of its generation, when not exceeding instructions yet and illustrating contained spiritual, all should be within the scope of the present invention.

Claims (5)

1、一种微控制器的改错方法,具特征是该重置方法是利用提供一重置指令码至一重置指令解码电路,再利用一延时电路产生重置讯号,使程序错误时透过执行重置指令而使微控制器得以重置恢复。1. A method for correcting errors of a microcontroller, characterized in that the reset method is to provide a reset command code to a reset command decoding circuit, and then use a delay circuit to generate a reset signal, so that when the program is wrong The microcontroller can be reset and recovered by executing the reset command. 2、一种微控制器的改错装置,其特征是此装置包含一重置指令解码器及一延时电路,重置指令解码器可接收重置指令码,在解码且判断其为重置指令码后,该重置指令解码器可触发延时电路,以产生固定长度的重置讯号,使微控制器得以重置恢复。2. A microcontroller error correction device, characterized in that the device includes a reset command decoder and a delay circuit, the reset command decoder can receive the reset command code, after decoding and judging that it is a reset After the command code, the reset command decoder can trigger a delay circuit to generate a reset signal with a fixed length, so that the microcontroller can be reset and restored. 3、如权利要求2所述的微控制器的改错装置,其特征在于所述重置指令码为11111111B。3. The error correction device for microcontroller according to claim 2, characterized in that the reset instruction code is 11111111B. 4、如权利要求2所述的微控制器的改错装置,其特征在于所述重置指令解码电路是由与非门(NAND)所构成。4. The error correction device for a microcontroller as claimed in claim 2, wherein said reset instruction decoding circuit is composed of a NAND gate. 5、如权利要求2所述的微控制器的改错装置,其特征在于所述延时电路是由正反器所构成。5. The error correction device for a microcontroller according to claim 2, wherein the delay circuit is composed of flip-flops.
CN97100301A 1997-01-03 1997-01-03 Microcontroller Error Correction Method and Device Pending CN1186984A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN97100301A CN1186984A (en) 1997-01-03 1997-01-03 Microcontroller Error Correction Method and Device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN97100301A CN1186984A (en) 1997-01-03 1997-01-03 Microcontroller Error Correction Method and Device

Publications (1)

Publication Number Publication Date
CN1186984A true CN1186984A (en) 1998-07-08

Family

ID=5164956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN97100301A Pending CN1186984A (en) 1997-01-03 1997-01-03 Microcontroller Error Correction Method and Device

Country Status (1)

Country Link
CN (1) CN1186984A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101779193B (en) * 2007-08-17 2012-11-21 Nxp股份有限公司 System for providing fault tolerance for at least one micro controller unit
CN108319179A (en) * 2017-01-18 2018-07-24 新唐科技股份有限公司 Micro-controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101779193B (en) * 2007-08-17 2012-11-21 Nxp股份有限公司 System for providing fault tolerance for at least one micro controller unit
CN108319179A (en) * 2017-01-18 2018-07-24 新唐科技股份有限公司 Micro-controller

Similar Documents

Publication Publication Date Title
JP5199088B2 (en) Method and apparatus for controlling a computer system comprising at least two instruction execution units and one comparison unit
US6553512B1 (en) Method and apparatus for resolving CPU deadlocks
EP3133493B1 (en) Tracing of exception handling events
CN1186984A (en) Microcontroller Error Correction Method and Device
RU2431182C2 (en) Method, operating system and computer device for executing computer programme
CN101048738A (en) Method, operational system and computing unit for executing a computer program
US12154631B2 (en) Memory-control circuit and method for controlling erasing operation of flash memory
CN114840053B (en) Synchronous pulse and timer redundancy control method based on embedded software
RU2000117017A (en) SYSTEM FOR PROGRAM MANAGEMENT OF TECHNOLOGICAL EQUIPMENT
CN1834940A (en) Method of realizing breakpoint modulating function by embedding counter in command
JP4406119B2 (en) In-circuit emulator
EP4300320A1 (en) Method for serial peripheral interface (spi) operating-mode synchronization between an spi host and an spi device, and spi bus synchronization apparatus
KR100799599B1 (en) Operating System and Method of Embedded Hardware Including Microcontroller Without Storage Management Device
JPS60124746A (en) Data processing unit
JP2000181746A (en) Processor with debug support and debug function execution control method
JPS5826043B2 (en) Processor reset method
JPS5916054A (en) Microprocessor
JP2695775B2 (en) How to recover from computer system malfunction
JPH02125342A (en) Information processor
RU1798804C (en) Device for object control
KR100220367B1 (en) System and method for receiving serial data
SU1282125A1 (en) Priority interruption device
JPS5841525B2 (en) Direct memory access system
SU1649539A1 (en) Device of microprogramm control
JPH01162945A (en) Information processor

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C01 Deemed withdrawal of patent application (patent law 1993)
WD01 Invention patent application deemed withdrawn after publication