Interrupt port expansion structure

By designing the XOR logic gate structure, the problems of complex external interrupt processing logic and large resource utilization in the prior art are solved, the interrupt signal is simplified and flexible expansion is achieved, and the interrupt processing efficiency of the microcontroller is improved.

CN222107927UActive Publication Date: 2024-12-03ALI NEW ENERGY TECH (KUNSHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202420518221.7
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2024-12-03
Estimated Expiration
2034-03-18

AI Technical Summary

Technical Problem

In the prior art, when using timers/counters as external interrupts, the program logic is complex, resource calls are numerous, and the process is cumbersome, and improvement is needed.

Method used

A interrupt port expansion structure is designed, using multiple XOR logic gate connections, triggering interrupt signals through changes in the input signal of XOR logic gate, increasing the number of external expansion inputs, and directly achieving interrupt effects through hardware circuits.

Benefits of technology

The interrupt processing logic is simplified, resource calls are reduced, and the number of external extended inputs is increased when the chip interrupt input pin is insufficient, which improves the reliability and flexibility of the interrupt signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN222107927U_ABST
    Figure CN222107927U_ABST
Patent Text Reader

Abstract

The utility model discloses an interrupt port expansion structure, which relates to the field of signal interrupt, and comprises a plurality of exclusive-OR logic gates, the output end of the previous exclusive-OR logic gate is connected with one input end of the next exclusive-OR logic gate, and the other input end of the next exclusive-OR logic gate is connected with an input signal. The output end of the first exclusive-OR logic gate outputs an interrupt signal, the output end of the last exclusive-OR logic gate outputs an interrupt signal, and the two input ends of the first exclusive-OR logic gate are both connected with an input signal. The last exclusive-OR logic gate outputs a signal different from the previous exclusive-OR logic gate, so that an interrupt signal is triggered, and an interrupt effect is achieved; a hardware circuit mode is adopted, the number of expansion ports is directly increased through an XOR logic gate, and when the number of adopted chip interrupt input pins is not enough, the circuit is adopted, and the number of external expansion input ends is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The utility model relates to the field of signal interruption, in particular to an interruption port expansion structure. Background Art

[0002] External interrupt is an internal mechanism for the microcontroller to handle external events in real time. When an external event occurs, the microcontroller's interrupt system will force the CPU to pause the program being executed and turn to handle the interrupt event; after the interrupt is handled, it returns to the interrupted program and continues to execute.

[0003] Current technologies mostly use timers / counters as external interrupts, which requires the program to use more complex logic and cumbersome operations, call more resources, and have complex processes, which need to be improved. Utility Model Content

[0004] The purpose of the utility model is to provide an interrupt port expansion structure to solve the problems raised in the above background technology.

[0005] In order to achieve the above purpose, the utility model provides the following technical solutions:

[0006] An interrupt port expansion structure includes multiple XOR logic gates, the output end of the previous XOR logic gate is connected to an input end of the next XOR logic gate, the other input end of the next XOR logic gate is connected to an input signal, the output end of the last XOR logic gate outputs an interrupt signal, and the two input ends of the first XOR logic gate are both connected to the input signal.

[0007] As a further solution of the utility model: the specific number of the XOR logic gates is four, the two input ends of the XOR logic gate U1A are both connected to the input signal, the output end of the XOR logic gate U1A is connected to an input end of the XOR logic gate U2A, the other input end of the XOR logic gate U2A is connected to the input signal, the output end of the XOR logic gate U2A is connected to an input end of the XOR logic gate U3A, the other input end of the XOR logic gate U3A is connected to the input signal, the output end of the XOR logic gate U3A is connected to an input end of the XOR logic gate U4A, the other input end of the XOR logic gate U4A is connected to the input signal, and the output end of the XOR logic gate U4A outputs an interrupt signal.

[0008] As a further solution of the present invention: the input signal connected to the other input terminal of the XOR logic gate U4A is a fixed 12V voltage.

[0009] As a further solution of the utility model: two input terminals of the XOR logic gate U1A are respectively connected to the input signal ACC and the input signal CIN, another input terminal of the XOR logic gate U2A is connected to the input signal CNCT, and another input terminal of the XOR logic gate U3A is connected to the input signal OS.

[0010] As a further solution of the utility model: the interrupt signal is input to the IO port of the single-chip microcomputer.

[0011] Compared with the prior art, the beneficial effects of the present invention are as follows: when the input signals of multiple XOR logic gates change, the last XOR logic gate will output a signal different from the previous one, thereby triggering an interrupt signal to achieve an interrupt effect; by adopting a hardware circuit, the number of expansion ports is directly increased through XOR logic gates. When the number of interrupt input pins of the chip used is insufficient, this circuit is used to increase the number of external expansion input terminals. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 The present invention is a circuit diagram of an interrupt port expansion structure.

[0013] Figure 2 The figure is a schematic diagram of an output interrupt signal of an interrupt port expansion structure. DETAILED DESCRIPTION

[0014] The technical solutions in the embodiments of the utility model will be clearly and completely described below in conjunction with the drawings in the embodiments of the utility model. Obviously, the described embodiments are only part of the embodiments of the utility model, rather than all of the embodiments. Based on the embodiments in the utility model, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the utility model.

[0015] See also Figure 1 An interrupt port expansion structure includes multiple XOR logic gates, the output end of the previous XOR logic gate is connected to an input end of the next XOR logic gate, the other input end of the next XOR logic gate is connected to the input signal, the output end of the last XOR logic gate outputs an interrupt signal, and the two input ends of the first XOR logic gate are both connected to the input signal.

[0016] In this example: See Figure 1 The specific number of the XOR logic gates is four. Both input ends of the XOR logic gate U1A are connected to input signals, the output end of the XOR logic gate U1A is connected to an input end of the XOR logic gate U2A, the other input end of the XOR logic gate U2A is connected to the input signal, the output end of the XOR logic gate U2A is connected to an input end of the XOR logic gate U3A, the other input end of the XOR logic gate U3A is connected to the input signal, the output end of the XOR logic gate U3A is connected to an input end of the XOR logic gate U4A, the other input end of the XOR logic gate U4A is connected to the input signal, and the output end of the XOR logic gate U4A outputs an interrupt signal.

[0017] In this example: See Figure 1 The input signal connected to the other input terminal of the XOR logic gate U4A is a fixed 12V voltage.

[0018] In this example: See Figure 1 The two input terminals of the XOR logic gate U1A are respectively connected to the input signal ACC and the input signal CIN, the other input terminal of the XOR logic gate U2A is connected to the input signal CNCT, and the other input terminal of the XOR logic gate U3A is connected to the input signal OS.

[0019] In this example: See Figure 1 , the interrupt signal is input to the IO port of the microcontroller.

[0020] The working principle of the XOR logic gate is that if the levels of the two inputs are different, the output is high; if the levels of the two inputs are the same, the output is low. Here, the XOR logic gate U1A is used as an example. When the input signal ACC and the input signal CIN are both high or low, the XOR logic gate U1A outputs a low level. When one of the input signal ACC and the input signal CIN is high or low, the XOR logic gate U1A outputs a high level.

[0021] The working principle of the utility model is as follows: Take four XOR logic gates as an example, see Figure 1 and Figure 2 ( Figure 2 Take the level of the output signal after some input signals change as an example), initially, the input signal ACC, the input signal CIN, the input signal CNCT, the input signal OS, and the input signal 12V are all high. At this time, the five input signals are all high, and finally the XOR logic gate U4A outputs a high level. When one of the input signals becomes a low level, the output of the XOR logic gate U4A will flip, and when another input signal becomes a low level, the output of the XOR logic gate U4A will flip again, so that every time one of the five input signals changes, the output of the XOR logic gate U4A will flip, thereby triggering the interrupt signal to achieve an interrupt effect.

[0022] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be regarded as exemplary and non-restrictive from any point of view, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention. Any reference numeral in a claim should not be regarded as limiting the claim to which it relates.

[0023] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. An interrupt port expansion structure, characterized in that: The interrupt port expansion structure includes multiple XOR logic gates, the output end of the previous XOR logic gate is connected to an input end of the next XOR logic gate, the other input end of the next XOR logic gate is connected to the input signal, the output end of the last XOR logic gate outputs an interrupt signal, and the two input ends of the first XOR logic gate are both connected to the input signal.

2. The interruption port expansion structure according to claim 1, characterized in that: The specific number of the XOR logic gates is four. Both input ends of the XOR logic gate U1A are connected to input signals, the output end of the XOR logic gate U1A is connected to an input end of the XOR logic gate U2A, the other input end of the XOR logic gate U2A is connected to the input signal, the output end of the XOR logic gate U2A is connected to an input end of the XOR logic gate U3A, the other input end of the XOR logic gate U3A is connected to the input signal, the output end of the XOR logic gate U3A is connected to an input end of the XOR logic gate U4A, the other input end of the XOR logic gate U4A is connected to the input signal, and the output end of the XOR logic gate U4A outputs an interrupt signal.

3. The interruption port expansion structure according to claim 2, characterized in that: The input signal connected to the other input terminal of the XOR logic gate U4A is a fixed 12V voltage.

4. The interruption port expansion structure according to claim 2, characterized in that: Two input terminals of the XOR logic gate U1A are connected to the input signal ACC and the input signal CIN respectively, another input terminal of the XOR logic gate U2A is connected to the input signal CNCT, and another input terminal of the XOR logic gate U3A is connected to the input signal OS.

5. The interruption port expansion structure according to any one of claims 1 to 4, characterized in that: The interrupt signal is input to the IO port of the microcontroller.