Interrupt processing method and microcontroller

A technology of a microcontroller and a processing method, which is applied to multi-programming devices, program startup/switching, etc., can solve the problems of long time to respond to interrupts, low interrupt processing efficiency, slow instruction running speed, etc., and achieve fast running speed. , reduce the time to respond to interruptions and improve efficiency

Active Publication Date: 2011-04-27
HISENSE VISUAL TECH CO LTD
View PDF3 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0006] The long call instruction LCALL of the traditional 8051 microcontroller needs 24 clock cycles, the instruction running speed is relatively slow, the response time to interrupt is long, and the efficiency of interrupt processing is not high

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Interrupt processing method and microcontroller
  • Interrupt processing method and microcontroller
  • Interrupt processing method and microcontroller

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0026] This embodiment provides an interrupt processing method. In this embodiment, an 8051 microcontroller is used as an example for illustration.

[0027] Such as figure 1 As shown, the method includes:

[0028] 101. Interrupt arbitration is performed in the last clock cycle of each instruction to determine whether the interrupt response will be blocked, and if the interrupt response is not blocked, enter the processing of the interrupt response.

[0029] Specifically, the interrupt timing module performs interrupt arbitration at the last clock cycle of each instruction execution, that is, when SL=1, and when it is found that a certain interrupt can be responded to, the interrupt flag bit is pulled high, causing an interrupt request in the next clock cycle The signal becomes high, indicating that the processing of the interrupt response is entered. Since the next instruction has been read before the interrupt arbitration in the SL state, the next instruction read is execut...

Embodiment 2

[0047] This embodiment provides a microcontroller, such as figure 2 As shown, the microcontroller includes:

[0048] The execution module 201 is configured to execute a long call instruction when there is a corresponding interrupt program, wherein the long call instruction includes 7 clock cycles;

[0049] Push module 202, used to push the current value of the program pointer into the stack to protect the breakpoint;

[0050] The first processing module 203 is used to send the corresponding interrupt entry address into the program bus in the second and fourth clock cycles of the long call instruction;

[0051] The second processing module 204 is configured to send the interrupt entry address from the program bus into the program pointer in the penultimate second clock cycle of the long call instruction, so that after the execution of the interrupt program is completed, from the interrupt Execute the next instruction at the entry address.

[0052] Further, as shown in Figur...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The embodiment of the invention discloses an interrupt processing method and a microcontroller. The interrupt processing method comprises the following steps of: when a responded interrupt program is provided, executing a long call instruction which comprises seven clock cycles; pushing a value of a current process pointer down to a stack to protect a breaking point; in the second clock cycle andthe fourth clock cycle of the long call instruction, transmitting a corresponding interrupt entry address to a program bus; and in the sixth clock cycle of the long call instruction, transmitting theinterrupt entry address to the program pointer from the program bus so as to execute the next instruction from the interrupt entry address after the interrupt program is executed. The interrupt processing method is applicable for the interrupt processing of the microcontroller.

Description

technical field [0001] The invention relates to the technical field of microcontrollers, in particular to an interrupt processing method and a microcontroller. Background technique [0002] At present, computers all have real-time processing functions, relying on interrupt technology, computers can make timely processing of events that occur randomly in the outside world. When the CPU is processing something, an external event requires the CPU to process it quickly, such as a level change, a pulse edge occurrence, or timer count overflow, etc., so the CPU temporarily suspends the current work. Go to handle the event that occurred. After the CPU finishes processing the event, it returns to the place where it was originally suspended and continues the original work. Such a process is an interruption. [0003] The traditional 8051 microcontroller uses 12 clock cycles as a machine cycle, a machine cycle consists of 6 states, each state consists of two clock cycles, the execut...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/48
Inventor 王洋
Owner HISENSE VISUAL TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products