CN1186984A - Microcontroller Error Correction Method and Device - Google Patents
Microcontroller Error Correction Method and Device Download PDFInfo
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000011084 recovery Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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 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)
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)
| 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 |
-
1997
- 1997-01-03 CN CN97100301A patent/CN1186984A/en active Pending
Cited By (2)
| 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 |