Signal state switching method, circuit, device, equipment, medium and product
Patent Information
- Application Number
- CN202380081871.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-25
- Publication Date
- 2025-08-29
AI Technical Summary
During the data transmission process between the microcontroller and external devices, the CPU cannot perform data transmission processing in time, resulting in CPU resources being underutilized and causing resource waste.
By introducing a signal processing circuit between the microcontroller and the external chip, it replaces the CPU in the state switching operation of the chip select signal on the external chip, freeing up CPU resources so that it can be fully used for data transmission and processing, and improves the utilization of CPU resources. .
Efficient utilization of CPU resources is achieved, data transmission processing efficiency and CPU usage efficiency are improved, and the continuity and accuracy of data transmission are ensured.
Smart Images

Figure CN120569715A_ABST
Abstract
Description
Signal state switching method, circuit, device, equipment, medium and product Technical Field
[0001] The present application relates to the field of circuit technology, and in particular to a signal state switching method, circuit, device, equipment, medium and product. Background Art
[0002] A microcontroller unit (MCU) is a single-chip microcomputer that integrates the main parts of a microcomputer on a single chip, usually integrating a central processing unit (CPU) and peripheral devices such as a memory array.
[0003] In the related art, during the process of data transmission between the MCU and the chip of the external device, after each frame of data transmission is completed, the CPU in the MCU needs to switch the chip select (CS) signal to a high state and then a low state before transmitting the next frame of data, resulting in the CPU being unable to perform data transmission processing in a timely manner, causing the CPU resources to be not fully utilized and resulting in a waste of CPU resources.
[0004] Summary of the Invention
[0005] Based on this, it is necessary to provide a signal state switching method, circuit, device, equipment, medium and product to address the above technical problems, which can reduce the occupancy of CPU resources in the MCU and improve the utilization of CPU resources.
[0006] In a first aspect, the present application provides a signal state switching method, which is applied to a signal processing circuit connected between a microcontroller and an external chip, and includes:
[0007] When the microcontroller transmits data to an external chip, the signal processing circuit performs a signal state switching operation on a chip selection signal of the external chip.
[0008] The signal state switching method provided in an embodiment of the present application performs a signal state switching operation on the chip select signal of the external chip by a signal processing circuit connected between the microcontroller and the external chip when data is being transmitted between the microcontroller and the external chip, thereby achieving the state switching of the chip select signal of the external chip. In this method, the signal processing circuit replaces the CPU in the microcontroller to perform the state switching operation of the chip select signal on the external chip. This is equivalent to adding an auxiliary circuit to the microcontroller to automatically perform the state switching operation of the chip select signal, thereby freeing up the CPU resources in the microcontroller, allowing the CPU to be fully utilized for data transmission processing. Multiple frames of data can be sent at a time in an asynchronous communication mode, thereby improving the efficiency of the CPU in the microcontroller and also improving the utilization rate of CPU resources.
[0009] In one embodiment, when the microcontroller is transmitting data to an external chip, the signal processing circuit performs a signal state switching operation on a chip select signal of the external chip, including:
[0010] The signal processing circuit determines a current data volume count value according to the current data transmission volume between the microcontroller and the external chip;
[0011] The signal processing circuit performs a signal state switching operation on the chip selection signal of the external chip based on the current data amount count value.
[0012] In the signal state switching method provided in an embodiment of the present application, a signal processing circuit determines a current data volume count value based on the current data transmission volume between the microcontroller and the external chip, and performs a signal state switching operation on the chip select signal of the external chip based on the current data volume count value. In this method, data volume statistics are collected on the current data transmission volume between the microcontroller and the external chip, and the chip select signal state switching is performed based on the statistical data volume count value. Because the current data transmission volume between the microcontroller and the external chip can accurately reflect the data transmission state between the microcontroller and the external chip, the signal processing circuit can perform the signal state switching operation on the chip select signal of the external chip at the precise time, thereby improving the accuracy of the chip select signal state switching.
[0013] In one embodiment, the signal processing circuit performs a signal state switching operation on a chip select signal of an external chip based on a data amount count value, including:
[0014] The signal processing circuit outputs a control signal to the external chip according to the current data amount count value and the preset reference count value. The control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0015] In a signal state switching method provided in an embodiment of the present application, a signal processing circuit can output a control signal to an external chip for switching the signal state of a chip select signal of the external chip based on a current data volume count value and a reference count value. In this method, a reference count value is pre-set, so that the signal processing circuit can use this reference count value as a basis to determine whether the current amount of data transmitted between the microcontroller and the external chip has reached the time when the chip select signal of the external chip should be switched. Specifically, the comparison between the current data volume count value and the reference count value determines whether to output the control signal, thereby improving the accuracy of the control signal output timing and the chip select signal state switching accuracy. Furthermore, the entire process is determined based on the reference count value, which simplifies the logic for outputting the control signal, saves time in the intermediate process, and improves the efficiency of chip select signal switching.
[0016] In one embodiment, the signal processing circuit outputs a control signal to an external chip based on a current data amount count value and a preset reference count value, including:
[0017] The signal processing circuit outputs a control signal according to the current data amount count value and the reference count value;
[0018] The control signal is delayed according to the preset delay value and then output to the external chip.
[0019] In the signal state switching method provided in the embodiment of the present application, the signal processing circuit outputs a control signal based on the current data amount count value and the reference count value, and delays the control signal according to a preset delay value before outputting it to the external chip. In this method, the signal processing circuit outputs a control signal based on the comparison of the current data amount count value and the reference count value. On this basis, the control signal is delayed. On the one hand, sufficient time can be reserved for the microcontroller to transmit a single frame of data between the microcontroller and the external chip, so that the current frame of data between the microcontroller and the external chip can be fully transmitted. On the other hand, after determining that the single frame of data transmission between the microcontroller and the external chip is completed, the control signal is used to perform a signal state switching operation on the chip select signal of the external chip, thereby increasing the time accuracy of the chip select signal state switching of the external chip.
[0020] In one embodiment, the signal processing circuit outputs a control signal to an external chip based on a current data amount count value and a preset reference count value, including:
[0021] If the difference between the current data volume count value and the reference count value is a preset value, the signal processing circuit outputs a first control signal to the external chip, and the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
[0022] In a signal state switching method provided in an embodiment of the present application, a signal processing circuit outputs a first control signal to an external chip when the difference between a current data volume count value and a reference count value is a preset value, thereby switching the signal state of a chip select signal of the external chip from a low level to a high level. In this method, the difference between the current data volume count value and the reference count value is used as a judgment criterion. When the difference between the current data volume count value and the reference count value reaches the preset value, indicating that the data transmission of the current frame between the microcontroller and the external chip is about to be completed, the signal processing circuit then outputs the first control signal, which can timely and without delay switch the chip select signal from a low level to a high level, thereby improving the timeliness of the first control signal and the time accuracy of the state switching of the chip select signal of the external chip.
[0023] In one embodiment, the signal processing circuit outputs a control signal to an external chip based on a current data amount count value and a preset reference count value, and further includes:
[0024] If the current data amount count value is equal to the reference count value, the signal processing circuit outputs a second control signal to the external chip, where the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
[0025] In the signal state switching method provided in an embodiment of the present application, when the current data amount count value is equal to the reference count value, the signal processing circuit outputs a second control signal to the external chip to switch the signal state of the chip select signal of the external chip from a high level back to a low level. In this method, on the basis that the signal processing circuit has switched the chip select signal from a low level to a high level, once the current data amount count value is equal to the reference count value, it means that the data transmission of the current frame between the microcontroller and the external chip has been completed, then the signal processing circuit can output the second control signal to switch the chip select signal from a high level to a low level in a timely and undelayed manner, thereby improving the timeliness of the second control signal. In addition, the chip select signal of the external chip is first switched from a low level to a high level, and then from a high level to a low level, thereby completely and accurately achieving an operation of pulling the chip select signal high and then pulling it low.
[0026] In one embodiment, the method further includes: if the current data amount count value is equal to the reference count value, the signal processing circuit clears the current data amount count value.
[0027] In the signal state switching method provided in an embodiment of the present application, the signal processing circuit clears the current data amount count value when the current data amount count value is equal to the reference count value. In this method, clearing the current data amount count value, i.e., clearing the count data of the previous frame, allows the signal processing circuit to restart counting without being affected by the count data of the previous frame during the next frame of data transmission between the microcontroller and the external chip, and can accurately perform a signal state switching operation on the chip select signal of the external chip during the next frame of data transmission. Furthermore, the count value is cleared after each frame of data transmission, which allows the signal state to be continuously and accurately switched during the data transmission between the microcontroller and the external chip, thereby improving the continuity, accuracy, and efficiency of data transmission between the microcontroller and the external chip.
[0028] On the second aspect, the present application also provides a signal processing circuit, which is connected between the microcontroller and the external chip; the signal processing circuit is used to perform signal state switching operations on the chip select signal of the external chip when the microcontroller and the external chip transmit data.
[0029] The signal processing circuit provided in an embodiment of the present application is connected between a microcontroller and an external chip. When the microcontroller and the external chip are transmitting data, the signal processing circuit can switch the signal state of the external chip's chip select signal, thereby switching the state of the chip select signal of the external chip. In this signal processing circuit, the signal processing circuit switches the state of the chip select signal on behalf of the CPU, reducing the use of CPU resources, allowing CPU resources to be fully utilized for data transmission processing, and improving the utilization rate of CPU resources in the MCU.
[0030] In one embodiment, the signal processing circuit includes a counting circuit, one end of the counting circuit is connected to a clock pin of the microcontroller and a clock pin of the external chip, respectively, and the other end of the counting circuit is connected to a chip select signal of the external chip;
[0031] The counting circuit is used to determine the current data volume count value according to the current data transmission volume between the microcontroller and the external chip, and perform a signal state switching operation on the chip select signal of the external chip based on the data volume count value.
[0032] In the signal processing circuit provided in the embodiments of the present application, a counting circuit can obtain the current data transmission volume between the microcontroller and the external chip, determine the current data volume count value, and then perform a signal state switching operation on the chip select signal of the external chip based on the current data volume count value. In this signal processing circuit, the current data transmission volume between the microcontroller and the external chip can accurately reflect the data transmission status between the microcontroller and the external chip, so that the signal processing circuit performs the signal state switching operation on the chip select signal of the external chip when the data transmission status is appropriate, thereby improving the consistency between the operation and the data transmission status.
[0033] In one embodiment, the signal processing circuit further includes a delay circuit connected between the counting circuit and the external chip;
[0034] The counting circuit is further configured to output a control signal according to a current data amount count value and a reference count value of a single-frame data transmission amount;
[0035] The delay circuit is used to delay the control signal according to a preset delay value and then output it to the external chip. The control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0036] In the signal processing circuit provided in the embodiments of the present application, a counting circuit outputs a control signal based on a current data count value and a reference count value. A delay circuit, connected to the counting circuit and an external chip, then delays the control signal according to a preset delay value before outputting it to the external chip. In this signal processing circuit, the delay circuit delays the control signal, providing ample time for the microcontroller to transmit a single frame of data to the external chip. This improves the timing accuracy of the signal state switching operation for the external chip's chip select signal after a single frame of data transmission is completed between the microcontroller and the external chip.
[0037] In a third aspect, the present application also provides a signal state switching device, which includes a state switching module; the state switching module is used to perform a signal state switching operation on the chip select signal of the external chip when the microcontroller transmits data with the external chip.
[0038] In a fourth aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method steps of any one of the embodiments of the first aspect are implemented.
[0039] In a fifth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the method steps of any one of the embodiments of the first aspect above when the computer program is executed by a processor.
[0040] In a sixth aspect, the present application further provides a computer program product, comprising a computer program, which implements the method steps of any one of the embodiments of the first aspect above when executed by a processor.
[0041] 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
[0042] FIG1 is a schematic diagram of the state timing of different signals during data transmission;
[0043] FIG2 is an application diagram of a signal state switching circuit in one embodiment;
[0044] FIG3 is a schematic structural diagram of a signal processing circuit in one embodiment;
[0045] FIG4 is a schematic structural diagram of a signal processing circuit in another embodiment;
[0046] FIG5 is a schematic diagram of the timing of states of different signals during data transmission in one embodiment;
[0047] FIG6 is a schematic flow chart of a signal state switching method according to an embodiment;
[0048] FIG7 is a schematic diagram of a flow chart of a signal state switching operation in one embodiment;
[0049] FIG8 is a schematic diagram of a flow chart of outputting a control signal to an external chip in one embodiment;
[0050] FIG9 is a schematic flow chart of a signal state switching method in another embodiment;
[0051] FIG10 is a schematic structural diagram of a signal processing circuit in one embodiment;
[0052] FIG11 is a schematic diagram of the internal structure of a computer device in one embodiment.
[0053] Description of reference numerals: 100: microcontroller; 200: signal processing circuit; 300: external chip; 201: counting circuit; 202: delay circuit. DETAILED DESCRIPTION
[0054] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.
[0055] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are for the purpose of describing specific embodiments only and are not intended to limit this application; the terms "including" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions. In the description of the embodiments of this application, the technical terms "first" and "second" are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0056] Mention of "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. In the description of the embodiments of the present application, unless otherwise clearly specified and limited, technical terms such as "connection" should be understood in a broad sense. For example, it can be directly connected or indirectly connected through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meaning of the above terms in the embodiments of the present application can be understood according to the specific circumstances.
[0057] A microcontroller unit (MCU), also known as a single-chip microcomputer or MCU for short, is a chip-level computer that integrates a computer's central processing unit (CPU), random access memory (RAM), read-only memory (ROM), timer, and multiple I / O interfaces on a single chip with the emergence and development of large-scale integrated circuits.
[0058] Typically, an MCU can be connected to multiple external device chips (hereinafter referred to as "external chips") through a serial peripheral interface (SPI) to enable data transmission between the MCU and the multiple external chips.
[0059] During the data transmission between the MCU and the external chip, the data is transmitted sequentially frame by frame. The current communication implementation method is synchronous communication, as shown in Figure 1. That is, after waiting for the completion of a frame of data communication according to the clock signal (CLK), the chip select signal (CS) is first pulled high and then pulled low before the next frame of data is transmitted. In the related art, after each frame of data transmission is completed, the CPU in the MCU needs to control the chip select pin (i.e., CS pin) on the external chip to pull the chip select signal high and then low, so as to achieve the state switching of the chip select signal of the external chip, and then transmit the next frame of data. However, in the process of the CPU in the MCU controlling the chip select signal on the external chip to pull high and then low, the CPU cannot perform data transmission processing in a timely manner, resulting in insufficient utilization of CPU resources and a waste of CPU resources.
[0060] Based on this, a signal state switching method is provided in an embodiment of the present application. By connecting a signal processing circuit between a microcontroller and an external chip, when the microcontroller and the external chip are transmitting data, a signal state switching operation is performed on the chip select signal of the external chip, so that the signal processing circuit replaces the CPU to switch the level state at the CS pin on the external chip, thereby reducing the occupancy of CPU resources so that the CPU resources can be fully used for data transmission processing, thereby improving the utilization rate of CPU resources in the MCU.
[0061] It should be noted that the microcontroller and the external chip can be independently arranged in different modules / devices, or they can be integrated in the same module / device, such as integrating the microcontroller and the external chip in an electronic control unit (ECU). The communication between the microcontroller and the external chip can be understood as the communication between chip and chip, MCU and chip, MCU and MCU, MCU and CPU, or CPU and CPU. The communication process can be the transmission of data from the microcontroller to the external chip, or the transmission of data from the external chip to the microcontroller. In this embodiment, the application scenarios, structures, types, and functions of the microcontroller and the external chip can be diverse.
[0062] The signal state switching method provided in the embodiment of the present application is applied to a signal processing circuit. Based on this, before describing the signal state switching method provided in the embodiment of the present application, the signal processing circuit applied in the embodiment of the present application is first described.
[0063] As shown in Figure 2, Figure 2 is an application diagram of the signal processing circuit provided in an embodiment of the present application. The signal processing circuit 200 is connected between the microcontroller 100 and the external chip 300, and is used to switch the signal state of the chip select signal of the external chip 300 when the microcontroller 100 and the external chip 300 are transmitting data.
[0064] Among them, the microcontroller, also known as a single-chip microcomputer, is a control element formed by retaining the computing power of a central processing unit on a chip and integrating functions such as storage. In a general sense, it can be understood that the microcontroller includes a central processing unit. The external chip in this embodiment is a chip other than the chip where the microcontroller is located. When implementing some control processes, data transmission between the microcontroller and the external chip is required to achieve interaction. In actual applications, in the process of data transmission between the microcontroller and the external chip, a high-level chip select signal is required to select the external chip, and then data transmission is performed under a low-level chip select signal. Therefore, in the process of data transmission between the microcontroller and the external chip, it is necessary to switch the chip select signal of the external chip from being pulled high to being pulled low after each frame of data transmission is completed in order to perform data transmission.
[0065] When the microcontroller 100 is transmitting data with the external chip 300, the signal processing circuit 200 monitors the data transmission status between the microcontroller 100 and the external chip 300, and performs a signal state switching operation on the chip select signal of the external chip 300 according to the monitoring result, thereby realizing the state switching of the chip select signal on the external chip 300.
[0066] Optionally, the microcontroller 100 and the external chip 300 perform data transmission, which may be the microcontroller 100 transmitting data to the external chip 300 or the external chip 300 transmitting data to the microcontroller 100, and both are frame-by-frame data transmission.
[0067] Optionally, in a scenario where the chip select signal on the external chip 300 needs to be pulled high and then low after each frame of data transmission, the signal processing circuit 200 can output a high-level control signal to the external chip 300 after a frame of data is transmitted between the microcontroller 100 and the external chip 300 to switch the chip select signal on the external chip 300 from a low level to a high level. At the same time, before the next frame of data transmission between the microcontroller 100 and the external chip 300, the signal processing circuit 200 outputs a low-level control signal to the external chip 300 to switch the chip select signal on the external chip 300 from a high level to a low level.
[0068] Optionally, the signal processing circuit may be a physical circuit or a program script that can be implemented by an electronic computer device. In this embodiment, the form of the signal processing circuit is not specifically limited, as long as it supports the implementation of the signal state switching method.
[0069] The signal processing circuit provided in an embodiment of the present application is connected between a microcontroller and an external chip. When the microcontroller and the external chip are transmitting data, the signal processing circuit switches the chip select signal of the external chip, thereby switching the chip select signal state on the external chip. In this signal processing circuit, the signal processing circuit replaces the CPU in the microcontroller to switch the chip select signal state. This is equivalent to adding an auxiliary circuit to the microcontroller to automatically switch the chip select signal state, thereby freeing up the CPU resources in the microcontroller, allowing the CPU to be fully utilized for data transmission processing. Multiple frames of data can be sent at a time using asynchronous communication, thereby improving the efficiency of the CPU in the microcontroller and also improving the utilization rate of CPU resources.
[0070] The signal processing circuit 200 can switch the chip select signal of the external chip 300 based on the current data transmission volume between the microcontroller 100 and the external chip 300. To this end, in one embodiment, as shown in FIG3 , the signal processing circuit 200 includes a counting circuit 201. One end of the counting circuit 201 is connected to the clock (CLK) pin of the microcontroller 100 and the clock (CLK) pin of the external chip 300, respectively. The other end of the counting circuit 201 is connected to the chip select (CS) pin of the external chip 300.
[0071] Optionally, the microcontroller 100 is communicatively connected to at least one external chip 300 (external chip 1, external chip 2...external chip n are shown in Figure 3) through an SPI interface. Based on the multiplexing of a signal processing circuit 200, the signal state switching operation of the chip select signal corresponding to the external chip 300 can be realized during the data transmission between the microcontroller 100 and multiple external chips 300.
[0072] Among them, the counting circuit 201 is used to determine the current data volume count value according to the current data transmission volume between the microcontroller 100 and the external chip 300, and based on the current data volume count value, change the level state of the chip select pin on the external chip 300 to perform a signal state switching operation on the chip select signal of the external chip 300.
[0073] Optionally, the counting circuit 201 includes a counter. The counter is connected to the clock pins of the microcontroller 100 and the external chip 300, receives a clock signal transmitted from the clock signal of the microcontroller 100 / external chip 300, and automatically counts when the clock signal rises or falls. The clock signal output by the hour hand pin changes with the current data transmission volume. Optionally, the counter used in this embodiment can be, but is not limited to, a pulse counter.
[0074] Optionally, during data transmission between the microcontroller 100 and the external chip 300, the counting circuit 201 may count the current data transmission volume between the microcontroller 100 and the external chip 300, determine a corresponding current data volume count value, and simultaneously determine a single-frame data transmission volume between the microcontroller 100 and the external chip 300, as well as a preset reference count value. The counting circuit 201 then outputs a control signal to the external chip 300 based on the current data volume count value and the reference count value, so as to switch the signal state of the chip select signal of the external chip 300 through the control signal. Different current data count values correspond to different control signals.
[0075] It should be noted that during the single-frame data transmission process between the microcontroller 100 and the external chip 300, the current data transmission amount is continuously increasing, and the current data amount count value also increases accordingly. The preset reference count value can be the count value corresponding to the single-frame data transmission amount between the microcontroller 100 and the external chip 300.
[0076] Optionally, in order to implement a state switching operation on the chip select signal of the external chip 300 after the single frame data transmission between the microcontroller 100 and the external chip 300 is completed, the counting circuit 201 can compare the current data amount count value and the reference count value in real time. When the current data amount count value is close to the reference count value (for example, the difference between the current data amount count value and the reference count value is less than a preset value) or reaches the reference count value, the counting circuit 201 outputs a high-level control signal to the external chip 300, and the high-level control signal pulls up the CS pin on the external chip 300. level to control the chip select signal of the external chip 300 to switch from a low level to a high level; then, after the current data amount count value is equal to the reference count value, the counting circuit 201 clears the current data amount count value, and when the next frame of data is transmitted between the microcontroller 100 and the external chip 300, the counting circuit 201 restarts counting accordingly and outputs a low-level control signal to the external chip 300, and the low-level control signal pulls down the level at the CS pin on the external chip 300 to control the chip select signal of the external chip 300 to switch from a high level to a low level.
[0077] In the signal processing circuit provided in an embodiment of the present application, a counting circuit can obtain the current data transmission volume between the microcontroller and the external chip, determine the current data volume count value, and perform a signal state switching operation on the chip select signal of the external chip based on the current data volume count value. In this signal processing circuit, the counting circuit calculates the current data transmission volume between the microcontroller and the external chip, and performs the chip select signal state switching operation based on the calculated data volume count value. Because the current data transmission volume between the microcontroller and the external chip can accurately reflect the data transmission state between the microcontroller and the external chip, the signal processing circuit can perform the signal state switching operation on the chip select signal of the external chip at the right time, thereby improving the accuracy of the chip select signal state switching.
[0078] In some scenarios, considering that the signal output process of some counting circuits is to output a high-level control signal when the current data count value reaches a pre-designed value but does not reach a reference count value, and the single frame of data between the microcontroller and the external device has not been transmitted completely at this time, therefore, in order to improve the timing accuracy of the signal state switching operation of the chip select signal of the external chip 300 after the single frame of data transmission between the microcontroller 100 and the external chip 300 is completed, in one embodiment, as shown in FIG4 , the signal processing circuit 200 further includes a delay circuit 202. The delay circuit 202 is connected between the counting circuit 201 and the external chip 300.
[0079] The counting circuit 201 outputs a control signal based on the current data count and the reference count of the single-frame data transmission amount. The delay circuit 202 is used to delay the control signal according to a preset delay value before outputting it to the external chip 300. The control signal is used to switch the chip select signal of the external chip 300.
[0080] Optionally, the delay circuit 202 includes a delay device. The input of the delay device is connected to the counter circuit, and the output of the delay device is connected to an external chip. The delay device delays the control signal output by the counter circuit by a preset delay value before outputting it to the external chip. Optionally, the delay device used in this embodiment may be, but is not limited to, an analog delay device, a digital delay device, a reverberator, or the like.
[0081] Optionally, the counting circuit 201 compares the numerical value between the current data amount count value and the reference count value to output a control signal based on the comparison result. For example, the counting circuit 201 compares the current data amount count value and the reference count value in real time. When the current data amount count value is closer than the reference count value by a preset value, or when the current data amount count value reaches or equals the reference count value, the counting circuit 201 outputs a high-level control signal. After the current data amount count value equals the reference count value, the counting circuit 201 clears the current data amount count value and outputs a low-level control signal. The delay unit 202 delays the control signal output by the counting circuit 201 by a preset delay value to output the delayed control signal to the CS pin of the external chip 300.
[0082] It should be noted that for counting circuit 201, which outputs a high-level control signal only when the current data count reaches a reference count, delay processing is not required, and accordingly, delay circuit 202 is not required in the signal processing circuit. For example, if the single-frame data transmission volume between the microcontroller and the external chip is 16 bits, if the counting circuit can output a high-level control signal only when the current data count reaches 16 bits, then a delay circuit is not required.
[0083] In the signal processing circuit provided by the embodiment of the present application, a counting circuit outputs a control signal based on a current data amount count value and a reference count value, and a delay circuit connecting the counting circuit and an external chip delays the control signal according to a preset delay value before outputting it to the external chip. In this signal processing circuit, the counting circuit outputs a control signal based on a comparison between the current data amount count value and the reference count value. On this basis, the delay circuit delays the control signal. On the one hand, sufficient time can be reserved for the microcontroller to transmit a single frame of data between the microcontroller and the external chip, so that the current frame of data between the microcontroller and the external chip can be fully transmitted. On the other hand, after determining that the single frame of data transmission between the microcontroller and the external chip is completed, the control signal switches the chip select signal of the external chip by the control signal, thereby increasing the time accuracy of the chip select signal state switching of the external chip.
[0084] Next, in conjunction with FIG4 and FIG5, after each frame of data transmission between the microcontroller 100 and the external chip 300 is completed, the specific process of the signal processing circuit 200 controlling the chip select signal of the external chip 300 to be first pulled high and then pulled low is as follows:
[0085] Data transmission begins. Taking the microcontroller 100 transmitting data to the external chip 300 through the SPI interface as an example, the counting circuit 201 in the signal processing circuit 200 is connected to the CLK pin of the microcontroller 100 to output a CLK signal through the CLK pin to determine the current data transmission volume between the microcontroller 100 and the external chip 300, and to determine the current data volume count value corresponding to the current data transmission volume. For example, when the single-frame data transmission volume between the microcontroller 100 and the external chip 300 is 16 bits, the counting circuit 201 adopts a counting method of counting by adding 1 to the count value for each increase in data volume by 1 bit.
[0086] When the current data volume count reaches a pre-set value, for example, the preset count value is 15 in FIG5 , the counting circuit 201 outputs a high-level control signal (Ripple Carryout). As data is transmitted between the microcontroller 100 and the external chip 300, the current data volume count continues to increase. When the current data volume count reaches the reference count value, the counting circuit 201 outputs a low-level control signal. At the same time, the counting circuit 201 resets the current data volume count to zero, restarting the counting process for the next frame of data transmission between the microcontroller 100 and the external chip 300. The control signal output by the counting circuit 201 is input to the delay circuit 202. After being delayed by a preset delay value, the delay circuit 202 outputs the signal to the CS pin of the external chip. By changing the level of the CS pin on the external chip, the state of the chip select signal (Chip_CS) of the external chip is switched.
[0087] Among them, when the counting circuit 201 outputs a high-level control signal, it pulls up the level at the CS pin on the external chip to switch the chip select signal of the external chip from a low level to a high level; when the counting circuit 201 outputs a low-level control signal, it pulls down the level at the CS pin on the external chip to switch the chip select signal (Chip_CS) of the external chip from a high level back to a low level.
[0088] The signal processing circuit provided in the embodiment of the present application includes a connection counting circuit and a delay circuit, one end of the counting circuit is connected to the clock pin of the microcontroller and the clock pin of the external chip respectively, and the delay circuit is connected between the counting circuit and the external chip. The counting circuit outputs a control signal according to the current data amount count value and the reference count value, and the delay circuit delays the control signal according to the preset delay value and outputs it to the external chip. Among them, the counting circuit outputs a control signal specifically when the current data amount count value reaches a pre-designed value, outputs a high-level control signal to switch the chip select signal of the external chip from a low level to a high level; as data is transmitted, when the current data amount count value reaches the reference count value, outputs a low-level control signal to switch the chip select signal of the external chip from a high level to a low level again. In this signal processing circuit, a counting circuit outputs a control signal based on a comparison between the current data count value and a reference count value. This control signal is then delayed by a delay circuit. This allows sufficient time for the microcontroller to transmit a single frame of data to the external chip, allowing the current frame of data to be fully transmitted between the microcontroller and the external chip. Furthermore, after confirming that the single frame of data transmission between the microcontroller and the external chip is complete, a control signal is output to switch the state of the chip select signal of the external chip, thereby increasing the timing accuracy of the chip select signal state switching. Overall, the signal processing circuit switches the chip select signal of the external chip from a low level to a high level, and then from a high level back to a low level, completely and accurately achieving an operation of pulling the chip select signal high and then low.
[0089] It can be understood that the design of each structure in the signal processing circuit in the above embodiment is only one example of achieving the technical effect of the present application. In practical applications, it can also be adaptively modified to achieve easily conceivable technical effects. The embodiment of the present application does not limit its structure.
[0090] Next, the signal state switching method provided in the embodiments of the present application is described. The signal state switching method in the embodiments of the present application is described by taking the signal processing circuit in FIG. 2 as an example.
[0091] In one embodiment, as shown in FIG6 , the embodiment includes the following steps:
[0092] S101 , when the microcontroller is transmitting data to an external chip, the signal processing circuit performs a signal state switching operation on a chip select signal of the external chip.
[0093] Continuing with FIG. 2 , the signal processing circuit 200 is connected between the microcontroller 100 and the external chip 300. When the microcontroller 100 and the external chip 300 are transmitting data, the signal processing circuit 200 can monitor the data transmission status between the microcontroller 100 and the external chip 300, and switch the chip select signal of the external chip 300 based on the monitoring result, thereby switching the chip select signal on the external chip 300.
[0094] Optionally, in a scenario where the chip select signal on the external chip needs to be pulled high and then low after each frame of data transmission, the signal processing circuit can output a high-level control signal to the external chip after a frame of data is transmitted between the microcontroller and the external chip to switch the chip select signal on the external chip 300 from a low level to a high level. At the same time, before the next frame of data transmission is performed between the microcontroller 100 and the external chip 300, a low-level control signal is output to the external chip 300 to switch the chip select signal on the external chip 300 from a high level to a low level.
[0095] The signal state switching method provided in an embodiment of the present application implements a signal state switching operation on a chip select signal of the external chip by a signal processing circuit connected between the microcontroller and the external chip when data is being transmitted between the microcontroller and the external chip, thereby achieving state switching of the chip select signal of the external chip. In this method, the signal processing circuit replaces the CPU in the microcontroller in performing the state switching operation of the chip select signal on the external chip. This is equivalent to adding an auxiliary circuit to the microcontroller to automatically perform the state switching operation of the chip select signal, thereby freeing up CPU resources in the microcontroller, allowing the CPU to be fully utilized for data transmission processing, and enabling multiple frames of data to be sent at a time in an asynchronous communication mode, thereby improving the efficiency of the CPU in the microcontroller and also improving the utilization rate of CPU resources.
[0096] The signal processing circuit can perform a signal state switching operation on the chip select signal of the external chip according to the current data transmission volume between the microcontroller and the external chip. Based on this, in one embodiment, as shown in FIG7 , when the microcontroller and the external chip are performing data transmission, the signal processing circuit performs a signal state switching operation on the chip select signal of the external chip, including the following steps:
[0097] S201, the signal processing circuit determines a current data volume count value according to the current data transmission volume between the microcontroller and the external chip.
[0098] Optionally, the signal processing circuit can monitor the data transmission status between the microcontroller and the external chip, determine the current data transmission volume between the microcontroller and the external chip, and count and count the current data transmission volume to determine the count value corresponding to the current data transmission volume as the current data volume count value.
[0099] Optionally, the signal processing circuit may include a counting unit to count the current data transmission volume between the microcontroller and the external chip and determine a current data volume count value. For example, in the case of a counting unit (such as a pulse counter) that counts +1 for each additional bit of data volume, during the process of data transmission between the microcontroller and the external chip, if the signal processing circuit determines that the current data transmission volume between the microcontroller and the external chip is 15 bits, the counting unit outputs a current data volume count value of 15.
[0100] S202 : The signal processing circuit performs a signal state switching operation on the chip select signal of the external chip based on the current data amount count value.
[0101] Optionally, after obtaining the current data volume count value, the signal processing circuit can determine whether the current frame data between the microcontroller and the external chip has been transmitted based on the current data volume count value, and when it is determined that the transmission is completed, the chip select signal of the external chip is first pulled high and then pulled low to switch the signal state.
[0102] In the signal state switching method provided in an embodiment of the present application, a signal processing circuit determines a current data volume count value based on the current data transmission volume between the microcontroller and the external chip, and performs a signal state switching operation on the chip select signal of the external chip based on the current data volume count value. In this method, data volume statistics are collected on the current data transmission volume between the microcontroller and the external chip, and the chip select signal state switching is performed based on the statistical data volume count value. Because the current data transmission volume between the microcontroller and the external chip can accurately reflect the data transmission state between the microcontroller and the external chip, the signal processing circuit can perform the signal state switching operation on the chip select signal of the external chip at the precise time, thereby improving the accuracy of the chip select signal state switching.
[0103] In actual applications, data is transmitted frame by frame between the microcontroller and the external chip. Based on this, in one embodiment, the signal processing circuit switches the chip select signal of the external chip based on the current data amount count value, including the following steps:
[0104] The signal processing circuit outputs a control signal to the external chip according to the current data amount count value and the preset reference count value. The control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0105] The reference count value is a count value of a single-frame data transmission amount; the single-frame data transmission amount is the single-frame data amount transmitted between the microcontroller and the external chip.
[0106] Optionally, the signal processing circuit may predetermine the amount of data transmitted per frame between the microcontroller and the external chip, and determine a count value corresponding to the amount of data transmitted per frame according to a preset counting rule as a reference count value. The amount of data transmitted per frame between the microcontroller and the external chip may be preset or determined by the signal processing circuit based on historical transmission data statistics.
[0107] Optionally, when the signal processing circuit includes a counting unit to determine a count value corresponding to the amount of data transmitted, the preset counting rule is consistent with the counting rule of the counting unit. For example, when a counting unit is used that increments the count value by 1 for each additional bit of data, if the amount of data transmitted in a single frame between the microcontroller and the external chip is 16 bits, the corresponding reference count value is 16.
[0108] Optionally, the signal processing circuit can compare the numerical values between the current data volume count value obtained above and the reference count value, and output a control signal to the external chip based on the comparison result, and the control signal performs a signal state switching operation on the chip select signal of the external chip.
[0109] It should be noted that, during the single-frame data transmission process between the microcontroller and the external chip, the current data transmission volume is constantly increasing, and the current data volume count value also increases accordingly.
[0110] Optionally, in order to implement the state switching operation of the chip select signal of the external chip after the single frame data transmission between the microcontroller and the external chip is completed, the signal processing circuit can compare the numerical value between the current data volume count value and the reference count value to output a control signal to the external chip based on the comparison result.
[0111] Optionally, the signal processing circuit compares the current data volume count value and the reference count value in real time, and when the current data volume count value is equal to the reference count value (indicating that a single frame of data transmission between the microcontroller and the external chip is completed), a high-level control signal is output to the external chip, and the level at the CS pin on the external chip is pulled up by the high-level control signal to control the chip select signal of the external chip to switch from a low level to a high level; then, after the current data volume count value is equal to the reference count value, the signal processing circuit clears the current data volume count value, and when the next frame of data transmission is performed between the microcontroller and the external chip, the signal processing circuit restarts counting and outputs a low-level control signal to the external chip, and the level at the CS pin on the external chip is pulled down by the low-level control signal to control the chip select signal of the external chip to switch from a high level to a low level.
[0112] In the signal state switching method provided in an embodiment of the present application, a signal processing circuit can output a control signal to an external chip for switching the signal state of the chip select signal of the external chip based on a current data volume count value and a preset reference count value. In this method, a reference count value is pre-set, so that the signal processing circuit can use this reference count value as a basis to determine whether the current amount of data transmitted between the microcontroller and the external chip has reached the time when the chip select signal of the external chip should be switched. In other words, the determination of whether to output the control signal is based on a comparison between the current data volume count value and the reference count value. The entire process is determined based on the reference count value, which simplifies the process of outputting the control signal, saves time in the intermediate process, and improves the efficiency of switching the chip select signal.
[0113] To improve the timing accuracy of the signal state switching operation on the CS pin of the external chip after a single frame of data transmission between the microcontroller and the external chip is completed, in one embodiment, as shown in FIG8 , the signal processing circuit outputs a control signal to the external chip based on the current data amount count value and a preset reference count value, including the following steps:
[0114] S301: The signal processing circuit outputs a control signal according to the current data amount count value and the reference count value.
[0115] Optionally, the signal processing circuit compares the current data count value with the reference count value and outputs a control signal based on the comparison result. For example, the current data count value and the reference count value are compared in real time. If the current data count value is closer than a preset value to the reference count value, or if the current data count value reaches or equals the reference count value, a high-level control signal is output. If the current data count value equals the reference count value, the current data count value is reset to zero and a low-level control signal is output.
[0116] S302 , delaying the control signal according to a preset delay value and then outputting the delay signal to an external chip.
[0117] Optionally, the signal processing circuit further includes a delay unit to delay the output control signal by a preset delay value, and output the delayed control signal to an external chip.
[0118] In the signal state switching method provided by the embodiment of the present application, the signal processing circuit outputs a control signal based on the current data amount count value and the reference count value, and delays the control signal according to a preset delay value before outputting it to the external chip. In this method, considering that in some scenarios, the signal output process of the counting circuit is to output a high-level control signal when the current data amount count value reaches a pre-designed value but does not reach the reference count value, and at this time, the single frame of data between the microcontroller and the external device has not been transmitted completely, the above method compares the control signal output by the signal processing circuit based on the current data amount count value and the reference count value, and on this basis, delays the control signal. On the one hand, sufficient time can be reserved for the microcontroller to transmit the single frame of data between the microcontroller and the external chip, so that the current frame of data between the microcontroller and the external chip can be completely transmitted. On the other hand, after determining that the single frame of data transmission between the microcontroller and the external chip is completed, the control signal is output to perform a signal state switching operation on the chip select signal of the external chip, thereby increasing the time accuracy of the chip select signal state switching of the external chip.
[0119] During the single-frame data transmission process between the microcontroller and the external chip, the current data transmission volume continuously increases, and the current data volume count value also increases accordingly. The relationship between the current data volume count value and the reference count value also continuously changes, and the signal processing circuit outputs different control signals accordingly. Based on this, in one embodiment, the signal processing circuit outputs a control signal to the external chip based on the current data volume count value and the preset reference count value, including the following steps:
[0120] If the difference between the current data volume count value and the reference count value is a preset value, the signal processing circuit outputs a first control signal to the external chip, and the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
[0121] Optionally, during a single-frame data transmission process, the signal processing circuit obtains a continuously increasing current data amount count value and, when the current data amount count value is closer than a preset value to a reference count value (i.e., when the difference between the current data amount count value and the reference count value is a preset value), outputs a high-level first control signal to the external chip to switch the signal state of a chip select signal on the external chip from a low level to a high level. For example, when the reference count value is 16, the current data amount count value is 15, and the preset value is 1, the difference of 1 between the two equals the preset value, and the signal processing circuit outputs a high level to the external chip.
[0122] In a signal state switching method provided in an embodiment of the present application, a signal processing circuit outputs a first control signal to an external chip when the difference between a current data volume count value and a reference count value is a preset value, thereby switching the signal state of a chip select signal of the external chip from a low level to a high level. In this method, the difference between the current data volume count value and the reference count value is used as a judgment criterion. When the difference between the current data volume count value and the reference count value reaches the preset value, indicating that the data transmission of the current frame between the microcontroller and the external chip is about to be completed, the signal processing circuit then outputs the first control signal, which can timely and without delay switch the chip select signal from a low level to a high level, thereby improving the timeliness of the first control signal and the time accuracy of the state switching of the chip select signal of the external chip.
[0123] In one embodiment, the signal processing circuit outputs a control signal to an external chip based on a current data amount count value and a preset reference count value, further comprising the following steps:
[0124] If the current data amount count value is equal to the reference count value, the signal processing circuit outputs a second control signal to the external chip, where the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
[0125] Optionally, during a single-frame data transmission process, the signal processing circuit obtains a continuously increasing current data amount count value and, when the current data amount count value reaches a preset reference count value, that is, when the current data amount count value is equal to the reference count value, outputs a low-level second control signal to the external chip to switch the signal state of a chip select signal on the external chip from a high level to a low level. For example, when the reference count value is 16 and the current data amount count value is 16, the two are equal, and the signal processing circuit outputs a low level to the external chip.
[0126] In the signal state switching method provided in an embodiment of the present application, when the current data amount count value is equal to the reference count value, the signal processing circuit outputs a second control signal to the external chip to switch the signal state of the chip select signal of the external chip from a high level back to a low level. In this method, on the basis that the signal processing circuit has switched the chip select signal from a low level to a high level, once the current data amount count value is equal to the reference count value, it means that the data transmission of the current frame between the microcontroller and the external chip has been completed, then the signal processing circuit can output the second control signal to switch the chip select signal from a high level to a low level in a timely and undelayed manner, thereby improving the timeliness of the second control signal. In addition, the chip select signal of the external chip is first switched from a low level to a high level, and then from a high level to a low level, thereby completely and accurately achieving an operation of pulling the chip select signal high and then pulling it low.
[0127] In order to continuously execute the above signal state switching method during data transmission between the microcontroller and the external chip, the above method further includes the following steps:
[0128] If the current data amount count value is equal to the reference count value, the signal processing circuit clears the current data amount count value.
[0129] Optionally, during a single frame of data transmission, the signal processing circuit obtains a continuously increasing current data volume count value, and when the current data volume count value reaches a preset reference count value, that is, the current data volume count value is equal to the reference count value, the current data volume count value is cleared to zero, so as to obtain the current data transmission volume of the next frame of data and the corresponding new current data volume count value during the next frame of data transmission between the microcontroller and the external chip, and then based on the new current data volume count value, perform a signal state switching operation on the chip select signal of the external chip to continuously execute signal state switching.
[0130] In the signal state switching method provided in an embodiment of the present application, a signal processing circuit clears the current data amount count value when the current data amount count value is equal to a reference count value. In this method, clearing the current data amount count value, i.e., clearing the count data of the previous frame, allows the signal processing circuit to restart counting without being affected by the count data of the previous frame during the next frame of data transmission between the microcontroller and the external chip. This allows the signal state switching operation of the chip select signal of the external chip to be accurately performed during the next frame of data transmission. Furthermore, the count value is cleared after each frame of data transmission, which allows the signal state switching to be performed continuously during the data transmission between the microcontroller and the external chip, thereby improving the continuity, accuracy, and efficiency of the data transmission between the microcontroller and the external chip.
[0131] To facilitate understanding by those skilled in the art, the lightning data analysis method provided in this application is described in detail below. As shown in FIG9 , the method may include:
[0132] S401, the signal processing circuit determines a current data volume count value based on the current data transmission volume between the microcontroller and the external chip;
[0133] S402, the signal processing circuit compares the current data amount count value with the reference count value of the single frame data transmission amount;
[0134] S403, if the difference between the current data amount count value and the reference count value is a preset value, the signal processing circuit outputs a first control signal to the external chip, the first control signal being used to switch the signal state of the chip select signal of the external chip from a low level to a high level;
[0135] S404, if the current data amount count value is equal to the reference count value, the signal processing circuit outputs a second control signal to the external chip, the second control signal being used to switch the signal state of the chip select signal of the external chip from a high level to a low level;
[0136] S405, if the current data amount count value is equal to the reference count value, the signal processing circuit clears the current data amount count value;
[0137] S406 , the signal processing circuit delays the first control signal or the second control signal according to a preset delay value and then outputs the delay to an external chip.
[0138] It should be noted that for the descriptions in S401 to S406 above, reference may be made to the relevant descriptions in the above embodiments, and the effects are similar, so this embodiment will not be repeated here.
[0139] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0140] Based on the same inventive concept, embodiments of the present application also provide a signal state switching device for implementing the aforementioned signal state switching method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of the communication device embodiments for one or more energy storage systems provided below can be found in the aforementioned limitations of the signal state switching method and will not be further elaborated here.
[0141] In one embodiment, as shown in FIG10 , a signal state switching device is further provided. The device includes a state switching module 1001 for performing a signal state switching operation on a chip select signal of an external chip when the microcontroller transmits data to the external chip.
[0142] In one embodiment, the state switching module 1001 includes:
[0143] The counting submodule is used to determine the current data volume count value according to the current data transmission volume between the microcontroller and the external chip;
[0144] The switching submodule is used to perform a signal state switching operation on the chip select signal of the external chip based on the current data amount count value.
[0145] In one embodiment, the switching submodule further includes:
[0146] The switching operation unit is used to output a control signal to the external chip according to the current data volume count value and the preset reference count value. The control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0147] In one embodiment, the switching operation unit is further configured to:
[0148] According to the current data volume count value and the reference count value, a control signal is output; the control signal is delayed according to the preset delay value and then output to the external chip.
[0149] In one embodiment, the switching operation unit is further configured to:
[0150] If the difference between the current data amount count value and the reference count value is a preset value, a first control signal is output to the external chip, where the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
[0151] In one embodiment, the switching operation unit is further configured to:
[0152] If the current data amount count value is equal to the reference count value, a second control signal is output to the external chip, where the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
[0153] In one embodiment, the switching operation unit is further configured to:
[0154] If the current data count value is equal to the reference count value, the current data count value is cleared.
[0155] Each module in the above-mentioned signal state switching device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0156] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in Figure 11. The computer device includes a processor, memory, a communication interface, a display screen, and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal via wired or wireless communication. The wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near field communication), or other technologies. When the computer program is executed by the processor, a signal state switching method is implemented. The display screen of the computer device may be a liquid crystal display or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or may be a key, trackball, or touchpad provided on the computer device housing, or may be an external keyboard, touchpad, or mouse.
[0157] Those skilled in the art will understand that the structure shown in FIG11 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0158] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0159] When the microcontroller is transmitting data to an external chip, a signal state switching operation is performed on a chip select signal of the external chip.
[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0161] According to the current data transmission volume between the microcontroller and the external chip, a current data volume count value is determined; based on the current data volume count value, a signal state switching operation is performed on a chip select signal of the external chip.
[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0163] According to the current data amount count value and the preset reference count value, a control signal is output to the external chip, and the control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] According to the current data volume count value and the reference count value, a control signal is output; the control signal is delayed according to the preset delay value and then output to the external chip.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] If the difference between the current data amount count value and the reference count value is a preset value, a first control signal is output to the external chip, where the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0169] If the current data amount count value is equal to the reference count value, a second control signal is output to the external chip, where the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
[0170] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0171] If the current data count value is equal to the reference count value, the current data count value is cleared.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0173] When the microcontroller is transmitting data to an external chip, a signal state switching operation is performed on a chip select signal of the external chip.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0175] According to the current data transmission volume between the microcontroller and the external chip, a current data volume count value is determined; based on the current data volume count value, a signal state switching operation is performed on a chip select signal of the external chip.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0177] According to the current data amount count value and the preset reference count value, a control signal is output to the external chip, and the control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0179] According to the current data volume count value and the reference count value, a control signal is output; the control signal is delayed according to the preset delay value and then output to the external chip.
[0180] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0181] If the difference between the current data amount count value and the reference count value is a preset value, a first control signal is output to the external chip, where the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0183] If the current data amount count value is equal to the reference count value, a second control signal is output to the external chip, where the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0185] If the current data count value is equal to the reference count value, the current data count value is cleared.
[0186] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0187] When the microcontroller is transmitting data to an external chip, a signal state switching operation is performed on a chip select signal of the external chip.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0189] According to the current data transmission volume between the microcontroller and the external chip, a current data volume count value is determined; based on the current data volume count value, a signal state switching operation is performed on a chip select signal of the external chip.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0191] According to the current data amount count value and the preset reference count value, a control signal is output to the external chip, and the control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0193] According to the current data volume count value and the reference count value, a control signal is output; the control signal is delayed according to the preset delay value and then output to the external chip.
[0194] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0195] If the difference between the current data amount count value and the reference count value is a preset value, a first control signal is output to the external chip, where the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
[0196] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0197] If the current data amount count value is equal to the reference count value, a second control signal is output to the external chip, where the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0199] If the current data count value is equal to the reference count value, the current data count value is cleared.
[0200] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0201] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0202] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A signal state switching method, characterized in that: Applied to a signal processing circuit, the signal processing circuit is connected between a microcontroller and an external chip; the method comprises: When the microcontroller is performing data transmission with the external chip, the signal processing circuit performs a signal state switching operation on the chip selection signal of the external chip.
2. The signal state switching method according to claim 1, characterized in that: When the microcontroller and the external chip perform data transmission, the signal processing circuit performs a signal state switching operation on the chip select signal of the external chip, including: The signal processing circuit determines a current data volume count value according to a current data transmission volume between the microcontroller and the external chip; The signal processing circuit performs a signal state switching operation on the chip select signal of the external chip based on the current data amount count value.
3. The signal state switching method according to claim 2, characterized in that: The signal processing circuit performs a signal state switching operation on the chip select signal of the external chip based on the data amount count value, including: The signal processing circuit outputs a control signal to the external chip according to the current data amount count value and a preset reference count value, and the control signal is used to perform a signal state switching operation on a chip select signal of the external chip.
4. The signal state switching method according to claim 3, characterized in that: The signal processing circuit outputs a control signal to the external chip according to the current data amount count value and the reference count value, including: The signal processing circuit outputs the control signal according to the current data amount count value and the reference count value; The control signal is delayed according to a preset delay value and then output to the external chip.
5. The signal state switching method according to claim 3 or 4, characterized in that: The signal processing circuit outputs a control signal to the external chip according to the current data amount count value and a preset reference count value, including: If the difference between the current data volume count value and the reference count value is a preset value, the signal processing circuit outputs a first control signal to the external chip, and the first control signal is used to switch the signal state of the chip select signal of the external chip from a low level to a high level.
6. The signal state switching method according to claim 3 or 4, characterized in that: The signal processing circuit outputs a control signal to the external chip according to the current data amount count value and a preset reference count value, and further includes: If the current data amount count value is equal to the reference count value, the signal processing circuit outputs a second control signal to the external chip, and the second control signal is used to switch the signal state of the chip select signal of the external chip from a high level to a low level.
7. The signal state switching method according to claim 6, characterized in that: The method further comprises: If the current data amount count value is equal to the reference count value, the signal processing circuit clears the current data amount count value.
8. A signal processing circuit, characterized in that: The signal processing circuit is connected between the microcontroller and the external chip; the signal processing circuit is used to perform a signal state switching operation on the chip selection signal of the external chip when the microcontroller and the external chip are performing data transmission.
9. The signal processing circuit according to claim 8, characterized in that: The signal processing circuit comprises a counting circuit, one end of which is connected to a clock pin of the microcontroller and a clock pin of the external chip respectively, and the other end of which is connected to a chip select signal of the external chip; The counting circuit is used to determine the current data volume count value according to the current data transmission volume between the microcontroller and the external chip; and based on the data volume count value, perform a signal state switching operation on the chip select signal of the external chip.
10. The signal processing circuit according to claim 9, characterized in that: The signal processing circuit further includes a delay circuit, and the delay circuit is connected between the counting circuit and the external chip; The counting circuit is further used to output a control signal according to the current data amount count value and the reference count value of the single-frame data transmission amount; The delay circuit is used to delay the control signal according to a preset delay value and then output it to the external chip; the control signal is used to perform a signal state switching operation on the chip select signal of the external chip.
11. A signal state switching device, characterized in that: The device comprises a state switching module; The state switching module is used to perform a signal state switching operation on the chip selection signal of the external chip when the microcontroller and the external chip are performing data transmission.
12. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
13. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
14. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Parallel signal acquisition and processing system based on multiple DSPs
CN111897262A
Enabling control circuit and semiconductor memory
CN115599196A
Regulation method of peripheral control signal time sequence
CN1437119A
Microcontroller
US20040268023A1
Low power chip select (CS) latency option
US20060176744A1