Micro-control unit, electronic equipment and external analog signal monitoring method
By designing the trigger module, channel control module and detection module in the micro control unit, polling monitoring of external analog signals is realized, which solves the problem of increased load on the MCU processor and achieves efficient analog signal monitoring and processing.
Patent Information
- Application Number
- CN202410472784.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2024-08-27
Smart Images

Figure CN118550222A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of micro control units, and in particular to a micro control unit, an electronic device and a monitoring method for an external analog signal. Background Art
[0002] In the application of microcontroller unit (MCU) control system, some complex control systems (especially those with high requirements for functional safety) have a large number of analog signals that need to be detected or monitored. At present, most of them use analog digital converters (ADC) to sample analog signals, and then process the analog signals through software. However, this method requires the MCU processor to process these additional tasks regularly, which takes up a lot of execution time of the MCU processor and increases the processor load of the MCU. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a micro control unit, an electronic device, and a method for monitoring an external analog signal to at least solve the above-mentioned technical problems existing in the prior art.
[0004] According to the first aspect of the present application, an embodiment of the present application provides a microcontroller unit, wherein the microcontroller unit MCU comprises a trigger module, a channel control module, a first channel gating module and a detection module; the input end of the channel control module is connected to the trigger module, and the output end is connected to the control end of the first channel gating module; the first channel gating module has a plurality of first channels, the input end of each first channel is used to receive an external analog signal, and the output end is connected to the detection module; the detection module is connected to the trigger module;
[0005] The trigger module is used to poll and generate a first trigger signal and a second trigger signal, the first trigger signal represents a collection signal of an external analog signal, and the second trigger signal represents a processing signal of the external analog signal;
[0006] The channel control module is used to poll and generate a corresponding strobe signal based on the first trigger signal generated by polling, and control the first channel of the first channel strobe module to be polled and opened based on the strobe signal generated by polling, so that the detection module polls and obtains the external analog signal output by each first channel of the first channel strobe module;
[0007] The detection module is used to poll and obtain a reference signal corresponding to each external analog signal based on a first trigger signal generated by polling, and to monitor and process each external analog signal based on a second trigger signal generated by polling and a reference signal corresponding to each external analog signal obtained by polling.
[0008] Optionally, the channel control module includes a strobe signal generating module and a first channel control submodule;
[0009] The channel signal generating module is used for generating a corresponding strobe signal based on the first trigger signal generated by polling;
[0010] The first channel control submodule is used to control the polling opening of the first channel of the first channel gating module based on the gating signal generated by polling.
[0011] Optionally, the micro control unit further includes:
[0012] At least one external second channel gating module; the second channel gating module has a plurality of second channels, the input end of each second channel is used to receive an external analog signal, and the output end is connected to the input end of a target first channel of the first channel gating module;
[0013] The channel control module is also used to control the polling and opening of the second channel of the second channel selection module based on the selection signal generated by polling, so that when the target first channel of the first channel selection module is opened, the detection module polls and obtains the external analog signal output by each second channel of the second channel selection module.
[0014] Optionally, the channel control module includes a second channel control submodule;
[0015] The second channel control submodule is used to control the polling opening of the second channel of the second channel gating module based on the gating signal generated by polling.
[0016] Optionally, the detection module includes a direct memory access module and an analog comparison module;
[0017] The direct memory access module is used for polling and acquiring a reference signal corresponding to each external analog signal based on the first trigger signal generated by polling, and sending the reference signal to the analog comparison module;
[0018] The analog comparison module is used for monitoring and processing each external analog signal through polling based on the second trigger signal generated through polling and the reference signal corresponding to each external analog signal acquired through polling.
[0019] Optionally, the detection module further includes a digital-to-analog conversion module;
[0020] The digital-to-analog conversion module is used for sending the reference signal corresponding to each external analog signal obtained by the direct memory access module through polling to the analog comparison module.
[0021] Optionally, the micro control unit further includes:
[0022] The storage module is used to store the reference signal corresponding to each external analog signal.
[0023] According to the second aspect of the present application, an embodiment of the present application further provides an electronic device, including:
[0024] As in the first aspect or the micro control unit in any embodiment of the first aspect.
[0025] According to a third aspect of the present application, an embodiment of the present application provides a monitoring method for an external analog signal, which is applied to a microcontroller unit MCU, wherein the MCU includes a trigger module, a channel control module, a first channel gating module, and a detection module; an input end of the channel control module is connected to the trigger module, and an output end is connected to a control end of the first channel gating module; the first channel gating module has a plurality of first channels, and an input end of each first channel is used to receive an external analog signal, and an output end is connected to the detection module; the detection module is connected to the trigger module;
[0026] Methods include:
[0027] The trigger module polls to generate a first trigger signal and a second trigger signal, the first trigger signal represents a collection signal of an external analog signal, and the second trigger signal represents a processing signal of the external analog signal;
[0028] The channel control module generates a corresponding strobe signal by polling based on the first trigger signal generated by polling, and controls the first channel of the first channel strobe module to be polled and opened based on the strobe signal generated by polling, so that the detection module obtains the external analog signal output by each first channel of the first channel strobe module by polling;
[0029] The detection module polls to obtain a reference signal corresponding to each external analog signal based on the first trigger signal generated by polling, and monitors each external analog signal based on the second trigger signal generated by polling and the reference signal corresponding to each external analog signal obtained by polling.
[0030] Optionally, the MCU further includes at least one external second channel gating module; the second channel gating module has a plurality of second channels, the input end of each second channel is used to receive an external analog signal, and the output end is connected to the input end of a target first channel of the first channel gating module;
[0031] Before the detection module obtains the reference signal corresponding to each external analog signal through polling based on the first trigger signal generated through polling, the detection module includes:
[0032] The channel control module also controls the polling and opening of the second channel of the second channel gating module based on the gating signal generated by polling, so that when the target first channel of the first channel gating module is opened, the detection module polls and obtains the external analog signal output by each second channel of the second channel gating module.
[0033] The microcontroller unit, electronic device and external analog signal monitoring method provided in the embodiments of the present application trigger the channel control module through the trigger module inside the MCU to control the first channel of the first channel selection module to be polled and opened, so that the detection module can poll and obtain multiple different external analog signals, and trigger the detection module to poll and obtain reference signals corresponding to multiple different external analog signals through the trigger module, so that the detection module can monitor and process the external analog signal based on the reference signal. In this way, the monitoring of the external analog signal is completely completed through multiple hardware components inside the MCU, without occupying the execution time of the MCU processor and without increasing the load of the MCU processor; and the present application collects and processes the external analog signal through the detection module inside the MCU, and does not need to collect the external analog signal through the ADC, which can reduce the use of ADC resources.
[0034] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a schematic diagram of the structure of the micro control unit in the embodiment of the present application;
[0036] Figure 2 This is a schematic diagram of the structure of another micro control unit in an embodiment of the present application;
[0037] Figure 3 This is a schematic diagram of the structure of another micro control unit in an embodiment of the present application;
[0038] Figure 4 This is a schematic diagram of the structure of another micro control unit in an embodiment of the present application;
[0039] Figure 5 Schematic diagram of the flow of the external analog signal monitoring method in the embodiment of the present application;
[0040] Figure 6 This is a schematic diagram of the hardware structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0042] The present application embodiment provides a micro control unit, such as Figure 1 As shown, the microcontroller unit (MCU) includes a trigger module 11, a channel control module 12, a first channel selection module 13 and a detection module 14; the input end of the channel control module 12 is connected to the trigger module 11, and the output end is connected to the control end of the first channel selection module 13; the first channel selection module 13 has a plurality of first channels, and the input end of each first channel is used to receive an external analog signal, and the output end is connected to the detection module 14; the detection module 14 is connected to the trigger module 11.
[0043] The trigger module 11 is used to generate a first trigger signal and a second trigger signal by polling, wherein the first trigger signal represents a collection signal of an external analog signal, and the second trigger signal represents a processing signal of the external analog signal.
[0044] The channel control module 12 is used to poll and generate a corresponding selection signal based on the first trigger signal generated by polling, and control the first channel polling and opening of the first channel selection module 13 based on the selection signal generated by polling, so that the detection module 14 polls and obtains the external analog signal output by each first channel of the first channel selection module 13.
[0045] The detection module 14 is used to poll and obtain a reference signal corresponding to each external analog signal based on the first trigger signal generated by polling, and to monitor and process each external analog signal based on the second trigger signal generated by polling and the reference signal corresponding to each external analog signal obtained by polling.
[0046] When implementing it, Figure 2 As shown, the trigger module 11 may include a timer, and when the trigger module 11 generates the first trigger signal and the second trigger signal through polling, it may be triggered by a comparison event of the timer. Figure 2 As shown, the timer can be configured in a center alignment mode. When the comparison event of the timer is an up count, the trigger module 11 generates a first trigger signal; when the comparison event of the timer is a down count, the trigger module 11 generates a second trigger signal. The first trigger signal and the second trigger signal are generated cyclically. The second trigger signal has a delay time compared to the first trigger signal. When the first trigger signal is generated, it is sent to the channel control module 12 and the detection module 14. When the second trigger signal is generated, it is sent to the detection module 14. In this way, the first trigger signal and the second trigger signal can be generated by the timer fast trigger polling.
[0047] like Figure 2As shown, the channel control module 12 may include a selection signal generating module 121 and a first channel control submodule 122; the selection signal generating module 121 is used to generate a corresponding selection signal based on a first trigger signal generated by polling; the first channel control submodule 122 is used to control the polling opening of the first channel of the first channel selection module 13 based on the selection signal generated by polling.
[0048] More specifically, the selection signal generating module 121 can be a selection signal pool, which includes selection signals (ASMEL_0, ASMEL_1...ASMEL_X) corresponding to all external analog signals. ASMEL_0, ASMEL_1...ASMEL_X are automatically triggered and switched by the first trigger signal to realize the polling generation of the selection signal. For example, when the selection signal generating module 121 receives the first trigger signal for the first time, it triggers the switch to the selection signal ASMEL_0. When the first trigger signal is received for the second time, it triggers the switch to the selection signal ASMEL_1... When the selection signal in the selection signal pool switches to the bottom of the queue, it will jump to the top of the queue again to start a new round of cycle, realizing the cyclic switching of the selection signal. Each selection signal includes the control information of the first channel of the first channel selection module 13, such as Figure 2 The example is ASMEL[15:3], and different selection signals correspond to controlling the opening of different first channels. Then, the first channel control submodule 122 controls the opening of the first channel corresponding to the first channel selection module 13 based on the control information of the first channel, so that the detection module 14 polls and obtains the external analog signal output by each first channel of the first channel selection module 13. The first channel selection module 13 can be a multiplexer (MUX). In this way, the channel control module can be divided into multiple separate components, each of which performs a corresponding function, which can simplify the structural complexity of the channel control module.
[0049] like Figure 2 As shown, the detection module 14 may include a direct memory access module 141 and an analog comparison module 143; the direct memory access module 141 is used to poll and obtain a reference signal corresponding to each external analog signal based on a first trigger signal generated by polling, and send it to the analog comparison module 143; the analog comparison module 143 is used to monitor and process each external analog signal based on a second trigger signal generated by polling and a reference signal corresponding to each external analog signal obtained by polling.
[0050] More specifically, the direct memory access module 141 may be a direct memory access (DMA), and the analog comparison module 143 may be an analog comparator (ACMP). The detection module 14 may have a built-in reference signal corresponding to each external analog signal, or may obtain a reference signal corresponding to each external analog signal from outside the detection module. When the direct memory access module 141 obtains the first trigger signal generated by polling, the reference signal corresponding to each external analog signal is obtained by polling. Among them, the reference signal corresponding to each external analog signal may include a high level threshold (Vref_H) and a low level threshold (Vref_L) of the external analog signal.
[0051] like Figure 2 As shown, the detection module 14 may include two direct memory access modules 141 and two analog comparison modules 143. One direct memory access module 141 is used to obtain the high level threshold of the external analog signal, and the other direct memory access module 141 is used to obtain the low level threshold of the external analog signal, and the high level threshold and the low level threshold are used as reference comparison values of the external analog signal. When the analog comparison module 143 obtains the second trigger signal, one analog comparison module 143 is used to monitor and process the high level of the external analog signal based on the high level threshold of the external analog signal, and the other analog comparison module 143 is used to monitor and process the low level of the external analog signal based on the low level threshold of the external analog signal. When any one or both of the two analog comparison modules 143 output a conclusion beyond the threshold range, the analog comparison module 143 will trigger an alarm message, and the alarm message includes but is not limited to alarm messages such as external analog signal interruption, MCU failure, and set error. Then the MCU can make corresponding protection actions.
[0052] In some embodiments, Figure 2 As shown, the detection module 14 also includes a digital-to-analog conversion module 142; the digital-to-analog conversion module 142 is used to send the reference signal corresponding to each external analog signal polled and obtained by the direct memory access module 141 to the analog comparison module 143. The digital-to-analog conversion module 142 can be a digital-to-analog converter (DAC). In this way, the reference signal sent to the analog comparison module 143 can be converted into an analog signal, which is convenient for direct comparison with the external analog signal, reducing the calculation process of the analog comparison module 143.
[0053] In some embodiments, Figure 2As shown, the microcontroller unit further includes: a storage module 15 for storing a reference signal corresponding to each external analog signal. The storage module 15 can be a register or other storage medium. In this way, the storage module may not be provided in the detection module, which can simplify the structure of the detection module.
[0054] The microcontrol unit provided in the embodiment of the present application triggers the channel control module through the trigger module inside the MCU to control the first channel polling opening of the first channel selection module, so that the detection module can poll and obtain multiple different external analog signals, and trigger the detection module to poll and obtain reference signals corresponding to multiple different external analog signals through the trigger module, so that the detection module can monitor and process the external analog signal based on the reference signal. In this way, the monitoring of the external analog signal is completely completed through multiple hardware components inside the MCU, without occupying the execution time of the MCU processor and will not increase the load of the MCU processor; and the present application collects and processes the external analog signal through the detection module inside the MCU, and does not need to collect the external analog signal through the ADC, which can reduce the use of ADC resources.
[0055] In an optional embodiment, if Figure 3-4 As shown, the micro control unit also includes:
[0056] At least one external second channel selection module 16; the second channel selection module 16 has multiple second channels, the input end of each second channel is used to receive an external analog signal, and the output end is connected to the input end of a target first channel of the first channel selection module 13.
[0057] The channel control module 12 is also used to control the polling and opening of the second channel of the second channel selection module 16 based on the selection signal generated by polling, so that when the target first channel of the first channel selection module 13 is opened, the detection module 14 polls and obtains the external analog signal output by each second channel of the second channel selection module 16.
[0058] When implementing it, Figure 3 and 4 As shown, the channel control module 12 may include a selection signal generating module 121, a first channel control submodule 122 and a second channel control submodule 123; the selection signal generating module 121 is used to generate a corresponding selection signal based on a first trigger signal generated by polling; the first channel control submodule 122 is used to control the polling opening of the first channel of the first channel selection module 13 based on the selection signal generated by polling; the second channel control submodule 123 is used to control the polling opening of the second channel of the second channel selection module based on the selection signal generated by polling.
[0059] More specifically, the selection signal generating module 121 can be a selection signal pool, which includes selection signals (ASMEL_0, ASMEL_1...ASMEL_X) corresponding to all external analog signals. ASMEL_0, ASMEL_1...ASMEL_X are automatically triggered and switched by the first trigger signal to realize the polling generation of the selection signal. For example, when the selection signal generating module 121 receives the first trigger signal for the first time, it triggers the switch to the selection signal ASMEL_0. When the first trigger signal is received for the second time, it triggers the switch to the selection signal ASMEL_1... When the selection signal in the selection signal pool switches to the bottom of the queue, it will jump to the top of the queue again to start a new round of cycle, realizing the cyclic switching of the selection signal. Each selection signal includes the control information of the first channel of the first channel selection module 13, such as Figure 3-4 An example is ASMEL[15:3]; it also includes control information of the second channel of the second channel gating module 16, such as Figure 3-4 An example is ASMEL[2:0]. Different selection signals correspond to the opening of different first channels and second channels. Table 1 shows the selection signals corresponding to the first trigger signals generated in sequence, as well as the first channels opened by the first channel selection module 13 and the second channels opened by the second channel selection module 16.
[0060] Table 1
[0061]
[0062]
[0063] Among them, Y0, Y1...Y7 are different second channels, XX and XXX are arbitrary values; CH0, CH1, CH2... are the control information corresponding to the switching of the first channel in the selection signal; 000, 001, 010...XXX are the control information corresponding to the switching of the second channel in the selection signal; when the control information corresponding to the switching of the first channel is switched from CH0 to CHX (X is 1, 2...), the control information XXX corresponding to the switching of the second channel can no longer control the switching of the second channel.
[0064] Then, the first channel control submodule 122 controls the opening of the first channel corresponding to the first channel selection module 13 based on the control information AMSEL[15:3] of the first channel; the second channel control submodule 123 can control the GPIO1, GPIO2 and GPIO3 of the MCU to change the state based on AMSEL[2:0], and then GPIO1, GPIO2 and GPIO3 control the opening of the second channel of the external second channel selection module 16, so that the analog comparison module 143 of the detection module 14 polls and obtains the external analog signal output by each first channel of the first channel selection module 13 and the external analog signal output by each second channel of the second channel selection module 16.
[0065] The detection module 14 may include a direct memory access module 141, a digital-to-analog conversion module 142, and an analog comparison module 143. The micro control unit further includes a storage module 15 for storing a reference signal corresponding to each external analog signal.
[0066] When the first trigger signal triggers the switching between the first channel and the second channel, the direct memory access module 141 is synchronously triggered to transfer the high level threshold (Vref_H) and the low level threshold (Vref_L) from the storage module 15 to the digital-to-analog conversion module 142. The digital-to-analog conversion module 142 outputs two analog comparison signals to the analog comparison module 143. The analog comparison signals are used as reference comparison values of the external analog signals, as shown in Table 2.
[0067] Table 2
[0068]
[0069]
[0070] When the analog comparison module 143 obtains the second trigger signal, the analog comparison module 143 is used to monitor the high level of the external analog signal based on the high level threshold of the external analog signal, and monitor the low level of the external analog signal based on the low level threshold of the external analog signal. When the external analog signal exceeds the threshold range, the analog comparison module 143 will trigger an alarm message, including but not limited to external analog signal interruption, MCU failure, reset error, etc. Then the MCU can take corresponding protection actions.
[0071] The microcontrol unit provided in the embodiment of the present application can achieve the purpose of expanding the number of MCU channels by externally plugging in at least one second channel selection module, thereby reducing the use of the MCU's own channels, saving the PIN pin resources of the chip, and realizing the monitoring of a large number of external analog signals; at the same time, the channel control module is triggered by the trigger module inside the MCU to control the first channel polling and opening of the first channel selection module, so that the detection module can poll and obtain multiple different external analog signals, and the detection module is triggered by the trigger module to poll and obtain reference signals corresponding to multiple different external analog signals, so that the detection module can monitor and process the external analog signal based on the reference signal. In this way, the monitoring of the external analog signal is completely completed by multiple hardware components inside the MCU, without occupying the execution time of the MCU processor and without increasing the load of the MCU processor; and the present application collects and processes the external analog signal by the detection module inside the MCU, and does not need to collect the external analog signal through the ADC, which can reduce the use of ADC resources.
[0072] An embodiment of the present application provides a method for monitoring an external analog signal, which is applied to a microcontroller unit (MCU), wherein the MCU includes a trigger module, a channel control module, a first channel selection module, and a detection module; the input end of the channel control module is connected to the trigger module, and the output end is connected to the control end of the first channel selection module; the first channel selection module has multiple first channels, and the input end of each first channel is used to receive an external analog signal, and the output end is connected to the detection module; the detection module is connected to the trigger module.
[0073] The monitoring method of external analog signal is as follows Figure 5 As shown, including:
[0074] S501, a trigger module polls to generate a first trigger signal and a second trigger signal, the first trigger signal represents a collection signal of an external analog signal, and the second trigger signal represents a processing signal of the external analog signal.
[0075] S503, the channel control module generates a corresponding selection signal through polling based on the first trigger signal generated by polling, and controls the first channel of the first channel selection module to be polled and opened based on the selection signal generated by polling, so that the detection module obtains the external analog signal output by each first channel of the first channel selection module through polling.
[0076] S505, the detection module polls to obtain a reference signal corresponding to each external analog signal based on the first trigger signal generated by polling, and monitors each external analog signal based on the second trigger signal generated by polling and the reference signal corresponding to each external analog signal obtained by polling.
[0077] The specific implementation method is detailed in the description of the above-mentioned micro control unit embodiment, which will not be repeated here.
[0078] The monitoring method of external analog signals provided in the embodiment of the present application triggers the channel control module through the trigger module inside the MCU to control the first channel polling opening of the first channel selection module, so that the detection module can poll and obtain multiple different external analog signals, and trigger the detection module to poll and obtain reference signals corresponding to multiple different external analog signals through the trigger module, so that the detection module can monitor and process the external analog signal based on the reference signal. In this way, the monitoring of the external analog signal is completely completed through multiple hardware components inside the MCU, without occupying the execution time of the MCU processor and will not increase the load of the MCU processor; and the present application collects and processes the external analog signal through the detection module inside the MCU, and does not need to collect the external analog signal through the ADC, which can reduce the use of ADC resources.
[0079] In an optional embodiment, the MCU further includes at least one external second channel gating module; the second channel gating module has a plurality of second channels, the input end of each second channel is used to receive an external analog signal, and the output end is connected to the input end of a target first channel of the first channel gating module;
[0080] Step S505, before the detection module polls to obtain a reference signal corresponding to each external analog signal based on the first trigger signal generated by polling, includes:
[0081] S504, the channel control module also controls the polling and opening of the second channel of the second channel gating module based on the gating signal generated by polling, so that when the target first channel of the first channel gating module is opened, the detection module polls and obtains the external analog signal output by each second channel of the second channel gating module.
[0082] The microcontroller unit provided in the embodiment of the present application can achieve the purpose of expanding the number of MCU channels by externally adding at least one second channel selection module, thereby reducing the use of the MCU's own channels, saving the chip's PIN pin resources, and realizing the monitoring of a large number of external analog signals.
[0083] According to an embodiment of the present application, the present application also provides an electronic device.
[0084] Figure 6A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The electronic device can also be a traffic device such as a smart car, which is provided with components such as doors and chassis, and the components include a microcontroller unit in any of the above-mentioned embodiments. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present application described herein and / or required.
[0085] like Figure 6 As shown, the device 800 includes a micro control unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The micro control unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0086] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0087] The micro control unit 801 includes a trigger module, a channel control module, a first channel gating module, a detection module, etc. The trigger module, the channel control module, the first channel gating module, and the detection module execute the various methods and processes described above, such as a monitoring method of partial analog signals.
[0088] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0089] The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions / operations specified in the flow chart and / or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0090] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0091] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0092] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0093] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0094] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0095] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A micro control unit, characterized in that: The microcontrol unit MCU comprises a trigger module, a channel control module, a first channel gating module and a detection module; the input end of the channel control module is connected to the trigger module, and the output end is connected to the control end of the first channel gating module; the first channel gating module has a plurality of first channels, the input end of each of the first channels is used to receive an external analog signal, and the output end is connected to the detection module; the detection module is connected to the trigger module; The trigger module is used to poll and generate a first trigger signal and a second trigger signal, wherein the first trigger signal represents a collection signal of an external analog signal, and the second trigger signal represents a processing signal of the external analog signal; The channel control module is used to poll and generate a corresponding selection signal based on the first trigger signal generated by polling, and control the first channel of the first channel selection module to be polled and opened based on the selection signal generated by polling, so that the detection module polls and obtains the external analog signal output by each first channel of the first channel selection module; The detection module is used to poll and obtain a reference signal corresponding to each of the external analog signals based on the first trigger signal generated by polling, and to monitor and process each of the external analog signals based on the second trigger signal generated by polling and the reference signal corresponding to each of the external analog signals obtained by polling.
2. The micro control unit according to claim 1, characterized in that: The channel control module includes a strobe signal generating module and a first channel control submodule; The channel signal generating module is used for polling and generating a corresponding strobe signal based on the first trigger signal generated by polling; The first channel control submodule is used to control the polling opening of the first channel of the first channel gating module based on the gating signal generated by polling.
3. The micro control unit according to claim 1 or 2, characterized in that: Also includes: At least one second channel gating module of the external plug-in; The second channel gating module has a plurality of second channels, the input end of each second channel is used to receive an external analog signal, and the output end is connected to the input end of a target first channel of the first channel gating module; The channel control module is also used to control the polling and opening of the second channel of the second channel selection module based on the selection signal generated by polling, so that when the target first channel of the first channel selection module is opened, the detection module polls and obtains the external analog signal output by each second channel of the second channel selection module.
4. The micro control unit according to claim 3, characterized in that: The channel control module includes a second channel control submodule; The second channel control submodule is used to control the polling opening of the second channel of the second channel gating module based on the gating signal generated by polling.
5. The micro control unit according to claim 1, characterized in that: The detection module includes a direct memory access module and an analog comparison module; The direct memory access module is used for polling and acquiring a reference signal corresponding to each of the external analog signals based on the first trigger signal generated by polling, and sending the reference signal to the analog comparison module; The analog comparison module is used to monitor and process each of the external analog signals through polling based on the second trigger signal generated through polling and the reference signal corresponding to each of the external analog signals obtained through polling.
6. The micro control unit according to claim 5, characterized in that: The detection module also includes a digital-to-analog conversion module; The digital-to-analog conversion module is used for sending the reference signal corresponding to each of the external analog signals obtained by the direct memory access module through polling to the analog comparison module.
7. The micro control unit according to claim 1, characterized in that: Also includes: The storage module is used to store the reference signal corresponding to each of the external analog signals.
8. An electronic device, characterized in that: include: A microcontroller unit as claimed in any one of claims 1 to 7.
9. A method for monitoring an external analog signal, characterized in that: Applied to a microcontroller unit MCU, the MCU comprises a trigger module, a channel control module, a first channel gating module and a detection module; the input end of the channel control module is connected to the trigger module, and the output end is connected to the control end of the first channel gating module; the first channel gating module has a plurality of first channels, the input end of each of the first channels is used to receive an external analog signal, and the output end is connected to the detection module; The detection module is connected to the trigger module; The method comprises: The trigger module polls to generate a first trigger signal and a second trigger signal, wherein the first trigger signal represents a collection signal of an external analog signal, and the second trigger signal represents a processing signal of the external analog signal; The channel control module generates a corresponding strobe signal by polling based on the first trigger signal generated by polling, and controls the first channel of the first channel strobe module to be polled and opened based on the strobe signal generated by polling, so that the detection module obtains the external analog signal output by each first channel of the first channel strobe module by polling; The detection module polls to obtain a reference signal corresponding to each of the external analog signals based on the first trigger signal generated by polling, and monitors each of the external analog signals based on the second trigger signal generated by polling and the reference signal corresponding to each of the external analog signals obtained by polling.
10. The method according to claim 9, characterized in that The MCU further includes at least one external second channel gating module; the second channel gating module has a plurality of second channels, the input end of each second channel is used to receive an external analog signal, and the output end is connected to the input end of a target first channel of the first channel gating module; Before the detection module polls to obtain a reference signal corresponding to each of the external analog signals based on the first trigger signal generated by polling, the detection module further includes: The channel control module controls the polling and opening of the second channel of the second channel selection module based on the selection signal generated by polling, so that when the target first channel of the first channel selection module is opened, the detection module polls and obtains the external analog signal output by each second channel of the second channel selection module.
