Universal input-output circuit, universal input-output circuit control method and chip

By designing a general input and output circuit, using channel selection units and flip-flops to transmit external interrupt signals to the wake-up module, the problem that peripheral wake-up sources in the prior art are not universal, and flexible wake-up of the microcontroller chip is achieved.

CN117271397BActive Publication Date: 2025-06-06GEEHY SEMICON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311272329.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-06-06
Estimated Expiration
2043-09-27

AI Technical Summary

Technical Problem

In the prior art, when the microcontroller chip is in a low power state, the peripheral wake-up source cannot be universal and the chip cannot be effectively awakened.

Method used

A general input and output circuit is designed, including a channel selection unit, a first flip-flop, an input module and an output module, through which an external interrupt signal is received and transmitted to a wake-up module, and a clock module is awakened to wake up the chip.

Benefits of technology

It realizes the wake-up chip through a universal peripheral wake-up source in low power mode, increasing the number of wake-up sources, and improving the flexibility and adaptability of the chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271397B_ABST
    Figure CN117271397B_ABST
Patent Text Reader

Abstract

The present application provides a general input-output circuit, a control method for the general input-output circuit, and a chip. The general input-output circuit is used to connect an external device and an internal circuit of a chip, and includes: a channel selection unit, a first trigger, an input module, and an output module; the first end of the channel selection unit is connected to a pin, the second end of the channel selection unit is connected to the input module and the output module, and the third end of the channel selection unit is connected to a wake-up module in the internal circuit of the chip through the first trigger; the pin is used to connect to an external device, and the pin is used to receive an external interrupt signal sent by the external device when the internal circuit of the chip is in a stop mode, and transmit the external interrupt signal to the first end of the channel selection unit; in the stop mode, a clock module in the internal circuit of the chip stops generating a clock signal; when the first end of the channel selection unit receives an external interrupt signal, the first end of the channel selection unit and the third end of the channel selection unit are connected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of integrated circuits, and in particular to a universal input-output circuit, a universal input-output circuit control method, and a chip. Background Art

[0002] A microcontroller chip is a microcomputer chip that is widely used in various applications, such as control operation circuits, data acquisition and processing, embedded systems, and communications. Power consumption is a key factor to consider in chip design. The higher the power consumption, the shorter the lifespan. Therefore, in the design of microcontroller chips, power consumption is reduced by powering off the chip or turning off the clock. However, due to application requirements, microcontroller chips will respond to wake-up in real time, so low-power chip wake-up design is very important.

[0003] General-purpose input / output (GPIO) is a pin of a chip, which is connected to external devices to realize the communication, control and data acquisition functions between the chip and the outside. However, in the prior art, when the microcontroller chip is in a low-power state, there are few peripheral wake-up sources that can wake up the microcontroller chip by receiving external signals input to external interrupts. Only some special peripheral wake-up sources can be used, so it is impossible to use general peripheral wake-up sources to wake up the chip in low-power mode.

[0004] Therefore, due to the application requirements of the chip responding to wake-up in real time, a design that can use a universal peripheral wake-up source to wake up the chip is urgently needed. Summary of the invention

[0005] The present application provides a universal input-output circuit, a control method for the universal input-output circuit, and a chip, which are used to solve the problem that when waking up a chip in a low-power mode, a peripheral wake-up source cannot be universal.

[0006] In a first aspect, the present application provides a universal input-output circuit, the universal input-output circuit is used to connect an external device, and the universal input-output circuit is also used to connect an internal circuit of a chip, the universal input-output circuit includes: a channel selection unit, a first trigger, an input module, and an output module;

[0007] A first end of the channel selection unit is connected to the pin, a second end of the channel selection unit is connected to the input module and the output module, and a third end of the channel selection unit is connected to the wake-up module in the internal circuit of the chip through a first trigger;

[0008] The pin is used to connect to an external device, and the pin is used to receive an external interrupt signal sent by the external device when the internal circuit of the chip is in the stop mode, and transmit the external interrupt signal to the first end of the channel selection unit; in the stop mode, the clock module in the internal circuit of the chip stops generating a clock signal;

[0009] When the first end of the channel selection unit receives an external interrupt signal, the first end of the channel selection unit and the third end of the channel selection unit are connected.

[0010] In one of the embodiments, the pin is also used to receive an external input signal sent by an external device when the internal circuit of the chip exits the stop mode;

[0011] When the first end of the channel selection unit receives an external input signal, the first end of the channel selection unit and the second end of the channel selection unit are connected, so that the external input signal is transmitted to the input module and the output module.

[0012] In one embodiment, when the second end of the channel selection unit receives the output signal, the first end of the channel selection unit and the second end of the channel selection unit are connected, so that the output signal is transmitted to the pin.

[0013] In one of the embodiments, the channel selection unit includes a first selection register and a second selection register;

[0014] The first end of the first selection register is connected to the pin, and the second end of the first selection register is connected to the output module; the third end of the first selection register is left floating; when the first end of the first selection register receives an external interrupt signal, the pin and the third end of the first selection register are connected;

[0015] The first end of the second selection register is connected to the pin, the second end of the second selection register is connected to the input module, and the third end of the second selection register is connected to the wake-up module through the first trigger; when the first end of the second selection register receives an external interrupt signal, the pin and the third end of the second selection register are connected, so that the external interrupt signal is transmitted to the wake-up module.

[0016] In one embodiment, when the first end of the second selection register receives an external input signal, the first end of the second selection register is connected with the second end of the second selection register, so that the external input signal is transmitted to the input module;

[0017] When the second end of the first selection register receives the output signal, the second end of the first selection register is connected to the first end of the first selection register, so that the output signal is transmitted to the external pin.

[0018] In one embodiment, the input module includes an input driver and an input data register;

[0019] The input end of the input driver is connected to the pin, and the output end of the input driver is connected to the input end of the input data register;

[0020] The input driver includes an input mode circuit and a second trigger; the input end of the input mode circuit is connected to the pin, and the output end of the input mode circuit is connected to the first end of the second selection register;

[0021] The input end of the second trigger is connected to the second end of the second selection register, and the output end of the second trigger serves as the output end of the input driver.

[0022] In a second aspect, the present application also provides a control method for a universal input-output circuit, wherein the universal input-output circuit is used to connect an external device, and the universal input-output circuit is also used to connect an internal circuit of a chip, and the universal input-output circuit includes: a channel selection unit, a first trigger, an input module, and an output module; a first end of the channel selection unit is connected to a pin, and the pin is used to connect to an external device; a second end of the channel selection unit is connected to the input module and the output module, and a third end of the channel selection unit is connected to a wake-up module in the internal circuit of the chip through the first trigger;

[0023] When the chip internal circuit is in the stop mode, when it is detected that the pin receives an external interrupt signal sent by an external device, a first control signal of the channel selection unit is generated;

[0024] Among them, the first control signal is used to connect the first end of the channel selection unit and the third end of the channel selection unit, so that the external interrupt signal is transmitted to the wake-up module, the external interrupt signal is used to control the wake-up module to generate a wake-up signal, and the wake-up signal is used to control the clock module to generate a clock signal; in the stop mode, the clock module in the internal circuit of the chip stops generating a clock signal.

[0025] In one embodiment, the method further comprises:

[0026] When the chip internal circuit is in the exit stop mode, a second control signal is generated when an external input signal sent by an external device is detected on the pin;

[0027] The second control signal is used to connect the first end of the channel selection unit and the second end of the channel selection unit, so that the external input signal is transmitted to the input module and the output module.

[0028] In one of the embodiments, when it is detected that the second end of the channel selection unit receives an output signal when the internal circuit of the chip is in the exit stop mode, a third control signal is generated;

[0029] The third control signal is used to connect the first end of the channel selection unit and the second end of the channel selection unit, so that the output signal is transmitted to the pin.

[0030] In a third aspect, the present application also provides a chip, including internal circuits and pins of the chip, and the internal circuits and pins of the chip are connected through the above-mentioned universal input and output circuits.

[0031] The present application provides a universal input-output circuit, which is used to connect an external device and is also used to connect an internal circuit of a chip. The universal input-output circuit includes: a channel selection unit, a first trigger, an input module, and an output module; the first end of the channel selection unit is used to connect to a pin, the second end of the channel selection unit is connected to the input module and the output module, and the third end of the channel selection unit is used to connect to a wake-up module in the internal circuit of the chip; the pin is used to connect to an external device, and the pin is used to receive an external interrupt signal sent by an external device when the internal circuit of the chip is in a stop mode, and transmit the external interrupt signal to the first end of the channel selection unit; in the stop mode, the clock module in the internal circuit of the chip stops generating a clock signal; when the first end of the channel selection unit receives an external interrupt signal, the first end of the channel selection unit and the third end of the channel selection unit are connected, so that the external interrupt signal is transmitted to the wake-up module. In the stop mode, the clock module of the internal circuit of the chip stops generating clock signals, the pins of the general input and output circuit receive external interrupt signals, and the channel selection unit connects the pins, i.e., the first end and the third end, so that the external interrupt signal can be transmitted to the wake-up module, thereby controlling the clock module to generate a clock signal to wake up the chip. The general input and output circuit provided in the present application can be applicable to various peripheral wake-up sources, greatly increasing the number of wake-up sources for waking up the chip in the stop mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0033] Figure 1 It is a schematic diagram of the structure of a general input and output circuit in the prior art;

[0034] Figure 2 This is a schematic diagram of the structure of a general input and output circuit provided in an embodiment of the present application;

[0035] Figure 3 This is a schematic diagram of the structure of a general input and output circuit provided in an embodiment of the present application;

[0036] Figure 4 This is a schematic diagram of the structure of a general input-output circuit provided in another embodiment of the present application;

[0037] Figure 5 A flow chart of a control method for a universal input-output circuit provided in one embodiment of the present application.

[0038] Reference numerals:

[0039] General input and output circuit: 100; external device: 300; chip internal circuit: 200; channel selection unit: 120; input module and output module: 110; first trigger: 130; input module: 112; output module: 111; first selection register: 121; second selection register: 122; wake-up module: 220.

[0040] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0042] It should be understood that, in the description below, words such as “first” and “second” are only used for the purpose of distinguishing the description and cannot be understood as indicating or implying relative importance or order.

[0043] MCU is the abbreviation of Micro Control Unit, and its Chinese name is micro control unit, also known as single chip microcomputer or single chip microcomputer. It refers to the integration of computer CPU, RAM, ROM, timer counter and various I / O interfaces on a chip with the emergence and development of large-scale integrated circuits to form a chip-level computer, which can control common storage devices in different combinations for different applications.

[0044] GPIO (General Purpose I / O Ports) means general purpose input / output ports. In layman's terms, these are some pins that can output high or low levels or read the status of the pins - high or low.

[0045] CPU (Center Process Unit): The core component of the chip used to process instructions, data, control other peripherals, etc.

[0046] USART (Universal Synchronous / Asynchronous Receiver / Transmitter) USART is a serial communication protocol that can perform data transmission in synchronous and asynchronous modes and is used to transfer data from one device to another.

[0047] The I2C (Inter-Integrated Circuit Bus) bus is a simple, bidirectional, two-wire synchronous serial bus that only requires two wires to transmit information between devices connected to the bus.

[0048] SDA (serial data) is also the data signal line of the I2C bus. CLK clock.

[0049] SPI is the abbreviation of Serial Peripheral Interface, which is a high-speed, full-duplex, synchronous communication bus.

[0050] EINT (external interrupt controller): manages external interrupts and can generate corresponding interrupt requests to the CPU / interrupt controller and wake-up requests to the power management.

[0051] like Figure 1 As shown, Figure 1 The general purpose input / output (GPIO) is a pin of a chip, which is connected to an external device to realize the communication, control and data collection between the chip and the outside.

[0052] Currently, when a microcontroller chip is in stop mode (low power consumption), the clock is turned off and the chip is powered off to reduce power consumption. At this time, there are few peripheral wake-up sources that can wake up the chip through external signals. When the chip is in stop mode, it can only be awakened by a dedicated peripheral wake-up source, which has many limitations.

[0053] In view of this, the present application provides a general input-output circuit 100, such as Figure 2 As shown, the universal input-output circuit 100 is used to connect to an external device 300, and the universal input-output circuit 100 is also used to connect to a chip internal circuit 200. The universal input-output circuit 100 includes: a channel selection unit 120, a first trigger 130, an input module and an output module 110;

[0054] The first end of the channel selection unit 120 is used to connect to the pin, the second end of the channel selection unit 120 is connected to the input module and the output module 110, and the third end of the channel selection unit 120 is connected to the wake-up module 220 in the chip internal circuit 200 through the first trigger 130;

[0055] The pin is used to connect to the external device 300, and the pin is used to receive an external interrupt signal sent by the external device 300 when the chip internal circuit 200 is in the stop mode, and transmit the external interrupt signal to the first end of the channel selection unit 120; in the stop mode, the clock module 210 in the chip internal circuit 200 stops generating a clock signal;

[0056] When the first end of the channel selection unit 120 receives an external interrupt signal, the first end of the channel selection unit 120 and the third end of the channel selection unit 120 are connected, so that the external interrupt signal is transmitted to the wake-up module 220. The external interrupt signal is used to control the wake-up module 220 to generate a wake-up signal, and the wake-up signal is used to control the clock module 210 to generate a clock signal.

[0057] In the stop mode, the clock module of the internal circuit of the chip stops generating clock signals, the pins of the general input and output circuit receive external interrupt signals, and the channel selection unit connects the pins, i.e., the first end and the third end, so that the external interrupt signal can be transmitted to the wake-up module, thereby controlling the clock module to generate a clock signal to wake up the chip. The general input and output circuit provided in the present application can be applied to various peripheral wake-up sources, which greatly increases the number of wake-up sources of the chip in the stop mode, so that the general input and output circuit has the function of supporting peripheral wake-up, thereby improving the flexibility and adaptability of the chip.

[0058] Optionally, the external terminal signal can be a level change signal; it can be the RX pin of USART, the CLK or SDA of I2C, the CLK of SPI, the input voltage signal of ADC; it can also be a signal value on a timer or switching pin (such as pressing a button), etc.

[0059] In one embodiment, if Figure 2 As shown, the pin is also used to receive an external input signal sent by an external device 300 when the chip internal circuit 200 exits the stop mode;

[0060] When the first end of the channel selection unit 120 receives an external input signal, the first end of the channel selection unit 120 and the second end of the channel selection unit 120 are connected, so that the external input signal is transmitted to the input module and the output module 110 .

[0061] The first end and the second end of the channel selection unit are connected, so that the external device can transmit data to the chip through the input module and the output module, thereby ensuring the communication function between the chip and the external device.

[0062] In one embodiment, when the second end of the channel selection unit receives the output signal, the first end of the channel selection unit and the second end of the channel selection unit are connected, so that the output signal is transmitted to the pin.

[0063] In this way, the chip can transmit data to external devices through the input module and output module in the general input and output circuit, ensuring the communication function between the chip and the external device.

[0064] In one embodiment, if Figure 3 As shown, the channel selection unit includes a first selection register 121 and a second selection register 122; the input module and the output module include an input module 112 and an output module 111;

[0065] The first end of the first selection register 121 is connected to the pin, and the second end of the first selection register 121 is connected to the output module 111; the third end of the first selection register 121 is suspended; when the first end of the first selection register 121 receives an external interrupt signal, the first end of the channel selection unit and the third end of the first selection register 121 are connected, and since the third end of the first selection register is suspended, the external interrupt signal will not pass through the output module;

[0066] The first end of the second selection register 122 is connected to the pin, the second end of the second selection register 122 is connected to the input module 112, and the third end of the second selection register 122 is connected to the wake-up module; when the first end of the second selection register 122 receives an external interrupt signal, the first end of the second selection register 122 and the third end of the second selection register 122 are connected, so that the external interrupt signal is transmitted to the wake-up module 220 through the first trigger.

[0067] After the pin receives an external interrupt signal sent by an external device, the first end and the third end of the second selection register are connected, so that the external interrupt signal received by the pin can be transmitted to the wake-up module, and then wake up the chip. Through this circuit structure, the general input and output circuit can have the function of external device wake-up, and the chip in stop mode can be woken up by an external interrupt signal. The circuit structure is simple and greatly saves costs.

[0068] In one of the embodiments, the first selection register includes a high level end 1 and a low level end 0, the third end of the first selection register is the high level end, and the second end of the first selection register is the low level end; the second selection register includes a high level end 1 and a low level end 0, the third end of the second selection register is the high level end, and the second end of the second selection register is the low level end; or the first selection register includes a high level end 1 and a low level end 0, the second end of the first selection register is the high level end, and the third end of the first selection register is the low level end; the second selection register includes a high level end and a low level end, the second end of the second selection register is the high level end, and the third end of the second selection register is the low level end. The specific settings can be determined according to actual conditions, and the figure in this application is only one of the embodiments.

[0069] In one embodiment, when the first end of the second selection register receives an external input signal, the first end of the second selection register is connected with the second end of the second selection register, so that the external input signal is transmitted to the input module;

[0070] When the second end of the first selection register receives the output signal, the second end of the first selection register is connected to the first end of the first selection register, so that the output signal is transmitted to the external pin.

[0071] Through the input modules and output modules in the general input and output circuit, the chip and external devices can communicate such as data transmission.

[0072] The general input and output circuit provided in the present application is suitable for various peripheral wake-up sources, and can solve the problem that the original GPIO structure cannot directly receive the input of external signals to the external interrupt in the stop mode, which greatly increases the number of wake-up sources that can wake up the chip in the stop mode, ensuring low power consumption while being able to wake up the chip in real time to meet application requirements.

[0073] In one embodiment, if Figure 4 As shown, the general input-output circuit further includes a first trigger;

[0074] The input end of the first trigger is connected to the third end of the second selection register, and the output end of the first trigger is connected to the wake-up module.

[0075] In one embodiment, the trigger is a Schottky trigger or a TTL Schottky trigger or a TTL Schmitt trigger, which has an extremely fast response speed and can be used in high-speed digital circuits. At the same time, the output signal is stable, the structure is simple, the reliability is high, and the power consumption is relatively low, so it can be used in low-power circuits.

[0076] In one embodiment, the wake-up module is an external interrupt controller (EINT).

[0077] In one embodiment, the input module includes an input driver and an input data register;

[0078] The input end of the input driver is connected to the pin, the output end of the input driver is connected to the input end of the input data register, and the output end of the input data register is connected;

[0079] The input driver includes an input mode circuit and a second trigger; the input end of the input mode circuit serves as the input end of the input driver, the output end of the input mode circuit is connected to the first end of the second selection register, the second end of the second selection register is connected to the input end of the second trigger, the output end of the second trigger serves as the output end of the input driver, and the third end of the second selection register is connected to the input end of the first trigger.

[0080] Optionally, the input mode circuit includes a pull-up resistor and a pull-down resistor.

[0081] In a second aspect, the present application also provides a method for controlling a universal input-output circuit, wherein the universal input-output circuit is used to connect an external device, and the universal input-output circuit is also used to connect an internal circuit of a chip, and the universal input-output circuit comprises: a channel selection unit, an input module, and an output module; a first end of the channel selection unit is used to connect to a pin, and the pin is used to connect to an external device; a second end of the channel selection unit is connected to the input module and the output module, and a third end of the channel selection unit is used to connect to a wake-up module in the internal circuit of the chip; the method comprises the following steps:

[0082] Step S510, when the internal circuit of the chip is in the stop mode, when it is detected that the pin receives an external interrupt signal sent by an external device, a first control signal of the channel selection unit is generated;

[0083] Among them, the first control signal is used to connect the first end of the channel selection unit and the third end of the channel selection unit, so that the external interrupt signal is transmitted to the wake-up module, the external interrupt signal is used to control the wake-up module to generate a wake-up signal, and the wake-up signal is used to control the clock module to generate a clock signal; in the stop mode, the clock module in the internal circuit of the chip stops generating a clock signal.

[0084] In one embodiment, the method further comprises:

[0085] Step S520, when the internal circuit of the chip is in the exit stop mode and detects that the pin receives an external input signal sent by an external device, a second control signal is generated;

[0086] The second control signal is used to connect the first end of the channel selection unit and the second end of the channel selection unit, so that the external input signal is transmitted to the input module and the output module.

[0087] In one embodiment, the method further comprises the steps of:

[0088] Step S530, when the internal circuit of the chip is in the exit stop mode and it is detected that the second end of the channel selection unit receives an output signal, a third control signal is generated;

[0089] The third control signal is used to connect the first end of the channel selection unit and the second end of the channel selection unit, so that the output signal is transmitted to the pin.

[0090] The present application also provides a control method for a universal input-output circuit, such as Figure 5 As shown, the method comprises the following steps:

[0091] Step S510, when the internal circuit of the chip is in the stop mode, when it is detected that the pin receives an external interrupt signal sent by an external device, a first control signal of the channel selection unit is generated;

[0092] Step S520, when the internal circuit of the chip is in the exit stop mode and detects that the pin receives an external input signal sent by an external device, a second control signal is generated;

[0093] Step S530: When it is detected that the second end of the channel selection unit receives an output signal when the internal circuit of the chip is in the exit stop mode, a third control signal is generated.

[0094] The general input-output circuit control method provided in the present application is applicable to various peripheral wake-up sources, and can solve the problem that the original GPIO structure cannot directly receive the input of external signals to the external interrupt in the stop mode, thereby greatly increasing the number of wake-up sources that can wake up the chip in the stop mode, ensuring low power consumption while being able to wake up the chip in real time to meet application requirements.

[0095] In a third aspect, the present application also provides a chip, including internal circuits and pins of the chip, and the internal circuits and pins of the chip are connected through the above-mentioned universal input and output circuits.

[0096] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0097] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A general input and output circuit, It is characterized in that The universal input-output circuit is used to connect to external devices, and is also used to connect to the internal circuit of the chip. The universal input-output circuit includes: a channel selection unit, a first trigger, an input module, and an output module; A first end of the channel selection unit is connected to a pin, a second end of the channel selection unit is connected to the input module and the output module, and a third end of the channel selection unit is connected to a wake-up module in the internal circuit of the chip through the first trigger; The pin is used to connect to the external device, and the pin is used to receive an external interrupt signal sent by the external device when the internal circuit of the chip is in a stop mode, and transmit the external interrupt signal to the first end of the channel selection unit; in the stop mode, the clock module in the internal circuit of the chip stops generating a clock signal; When the first end of the channel selection unit receives the external interrupt signal, the first end of the channel selection unit and the third end of the channel selection unit are connected; The channel selection unit includes a first selection register and a second selection register; The first end of the first selection register is connected to the pin, and the second end of the first selection register is connected to the output module; the third end of the first selection register is suspended; when the first end of the first selection register receives the external interrupt signal, the pin and the third end of the first selection register are connected; When the second end of the first selection register receives the output signal, the second end of the first selection register is connected to the first end of the first selection register, so that the output signal is transmitted to the external pin; The first end of the second selection register is connected to the pin, the second end of the second selection register is connected to the input module, and the third end of the second selection register is connected to the wake-up module through the first trigger; when the first end of the second selection register receives the external interrupt signal, the pin and the third end of the second selection register are connected, so that the external interrupt signal is transmitted to the wake-up module through the first trigger; When the first end of the second selection register receives an external input signal, the first end of the second selection register and the second end of the second selection register are connected, so that the external input signal is transmitted to the input module.

2. The general input-output circuit according to claim 1, It is characterized in that The pin is also used to receive an external input signal sent by the external device when the internal circuit of the chip exits the stop mode; When the first end of the channel selection unit receives the external input signal, the first end of the channel selection unit and the second end of the channel selection unit are connected, so that the external input signal is transmitted to the input module and the output module.

3. The general input-output circuit according to claim 2, It is characterized in that When the second end of the channel selection unit receives the output signal, the first end of the channel selection unit and the second end of the channel selection unit are connected, so that the output signal is transmitted to the pin.

4. The general input-output circuit according to claim 3, It is characterized in that The input module includes an input driver and an input data register; The input end of the input driver is connected to the pin, and the output end of the input driver is connected to the input end of the input data register; The input driver comprises an input mode circuit and a second trigger; the input end of the input mode circuit is connected to the pin, and the output end of the input mode circuit is connected to the first end of the second selection register; An input end of the second trigger is connected to the second end of the second selection register, and an output end of the second trigger serves as an output end of the input driver.

5. A control method for a general input and output circuit, It is characterized in that The method is applied to the universal input-output circuit according to any one of claims 1 to 4, wherein the universal input-output circuit is used to connect an external device, and the universal input-output circuit is also used to connect an internal circuit of a chip, and the universal input-output circuit comprises: a channel selection unit, a first trigger, an input module, and an output module; a first end of the channel selection unit is connected to a pin, and the pin is used to connect to the external device; a second end of the channel selection unit is connected to the input module and the output module, and a third end of the channel selection unit is connected to a wake-up module in the internal circuit of the chip through the first trigger; When the internal circuit of the chip is in the stop mode, when it is detected that the pin receives an external interrupt signal sent by the external device, generating a first control signal of the channel selection unit; Among them, the first control signal is used to connect the first end of the channel selection unit and the third end of the channel selection unit, so that the external interrupt signal is transmitted to the wake-up module, the external interrupt signal is used to control the wake-up module to generate a wake-up signal, and the wake-up signal is used to control the clock module to generate a clock signal; in the stop mode, the clock module in the internal circuit of the chip stops generating a clock signal.

6. The control method of the general input-output circuit according to claim 5, It is characterized in that The method further comprises: When the chip internal circuit is in the exit stop mode, it is detected that the pin receives an external input signal sent by the external device, generating a second control signal; The second control signal is used to connect the first end of the channel selection unit and the second end of the channel selection unit, so that the external input signal is transmitted to the input module and the output module.

7. The method for controlling a general input-output circuit according to claim 5, It is characterized in that When it is detected that the second end of the channel selection unit receives an output signal when the internal circuit of the chip is in the exit stop mode, a third control signal is generated; The third control signal is used to connect the first end of the channel selection unit and the second end of the channel selection unit, so that the output signal is transmitted to the pin.

8. A chip, characterized in that it comprises an internal circuit of the chip and pins, wherein the internal circuit of the chip and the pins are connected via the universal input-output circuit according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Glucometer power-on communication device and glucometer power-on communication method

    CN112075943A

  • Wake-up circuit, chip system and electronic equipment

    CN113608605A