Disclosure of Invention
The application aims to provide a sensing chip with multiplexing pins and a pin multiplexing method, which are beneficial to reducing the complexity and cost of a system and improving the reliability and response speed of mode switching of the multiplexing pins.
The application provides a sensing chip with multiplexing pins, which is characterized by comprising multiplexing pins, an input judging unit, a detecting unit, a signal generating unit, a pin multiplexing unit, a first functional unit and a second functional unit, wherein the input judging unit is used for receiving input signals of the multiplexing pins and outputting enabling signals according to whether the input signals meet triggering conditions, the detecting unit is used for detecting target environment parameters and correspondingly generating detecting signals according to the target environment parameters, the target environment parameters are detection objects of the sensing chip, the signal generating unit is used for reading the detecting signals of the detecting unit at intervals of preset time and generating multiplexing signals according to the read detecting signals, the pin multiplexing unit is used for outputting control signals according to the multiplexing signals and the enabling signals, and the control signals are used for enabling the target functional units, wherein the target functional units are the first functional units or the second functional units.
As can be seen from the above, the application realizes the mode switching of multiplexing pins by multiplexing the pins of the sensing chip, for the situation that the number of pins is less than 8, even if only three pins are power supply, ground and output, and other redundant pins are not supported in the existing sensing chip, the multiplexing of pins can realize the multiplexing mode by multiplexing the pins, which is beneficial to improving the working performance of the sensing chip, and the multiplexing of pins of the sensing chip is realized by utilizing the function of the sensing chip itself, particularly, the multiplexing signal is generated by detecting the change condition of the detection signal corresponding to the target environment parameter detected by the detection unit, and the control signal is output by combining the input signal of the pins.
In addition, the mode switching of the multiplexing pins is determined by the signals detected by the sensing chip, so that manual intervention is reduced in the pin multiplexing process, and the reliability of the mode switching of the multiplexing pins is improved.
In addition, multiplexing of pin functions in the application combines target environment parameters (such as magnetic field, temperature and pressure) acquired by the sensing chip, realizes scene self-adaptive control, can be flexibly applied based on different sensing chips, and has better applicability by a pin multiplexing scheme.
On the whole, the scheme of the application is beneficial to reducing the complexity and cost of the system and improving the reliability and response speed of mode switching of multiplexing pins on the basis of realizing pin multiplexing, and the pin multiplexing scheme can also have better applicability.
In one implementation manner, the signal generating unit is specifically configured to determine a difference value of the detected signals in the specified time interval, and generate the multiplexed signal according to whether the difference value of the detected signals in the specified time interval is greater than or equal to a preset threshold.
In one implementation manner, the multiplexing signal comprises a first signal and a second signal, the control signal comprises a first control signal and a second control signal, the first control signal is used for enabling the first functional unit, the second control signal is used for enabling the second functional unit, the pin multiplexing unit is specifically used for outputting the first control signal when the enabling signal is a preset signal and the multiplexing signal is the first signal, and outputting the second control signal when the enabling signal is the preset signal and the multiplexing signal is the second signal.
In one implementation, the multiplexing pin is connected to an external trigger device, and when the trigger device is triggered, the multiplexing pin is output with a preset level, and the input judging unit is specifically configured to judge whether the input signal is the preset level, and if the input signal is the preset level, the input judging unit outputs an enabling signal.
In one implementation, the sensing chip is a magnetic angle sensing chip, the target environment parameter is a magnetic field angle, and the detection unit is specifically configured to detect the magnetic field angle and correspondingly generate a detection signal according to the detected magnetic field angle.
In one implementation, the first functional unit is used for starting linear calibration or nonlinear calibration, and the second functional unit is used for setting a zero angle value.
In one implementation, the enabling signal and the multiplexing signal are both digital signals, the multiplexing signal comprises a first signal and a second signal, the signal generating unit is specifically configured to read the detection signal of the detection unit every preset time, determine a difference value of the detection signal in a specified time interval, generate the first signal when the difference value of the detection signal in the specified time interval is greater than or equal to a preset threshold value, generate the second signal when the difference value of the detection signal in the specified time interval is less than the preset threshold value, the pin multiplexing unit at least comprises a logic gate circuit, the logic gate circuit is provided with an enabling end, the pin multiplexing unit is specifically configured to input the enabling signal and the multiplexing signal into the logic gate circuit, and input the enabling signal into the enabling end of the logic gate circuit, when the enabling signal is the preset signal, the logic gate circuit is enabled, and output the first control signal when the multiplexing signal is the first signal, and output the second control signal when the multiplexing signal is the second signal, the first control signal is used for enabling the first functional unit, and the second control signal is used for enabling the second functional unit.
From the above, the multiplexing of multiplexing pins is realized by adopting the digital signal processing circuit module in the sensing chip, the digital signal processing circuit has higher response speed, and the processing logic is simpler, thereby being beneficial to further simplifying the system complexity of the sensing chip and improving the response speed of the mode switching of the multiplexing pins.
In a second aspect, the application provides a pin multiplexing method applied to a sensing chip with multiplexing pins, the method comprising receiving input signals input by the multiplexing pins and outputting enable signals according to whether the input signals meet trigger conditions; detecting a target environment parameter, correspondingly generating a detection signal according to the detected target environment parameter, wherein the target environment parameter is a detection object of the sensing chip, reading the detection signal at intervals of preset time, generating a multiplexing signal according to the read detection signal, outputting a control signal according to the multiplexing signal and an enabling signal, and enabling the sensing chip to execute a target function, and the target function is a first function or a second function.
In one implementation, generating the multiplexed signal based on the read detection signal specifically includes determining a difference of the detection signals within a specified time interval, and generating the multiplexed signal based on whether the difference of the detection signals within the specified time interval is greater than or equal to a preset threshold.
In one implementation manner, the multiplexing signal comprises a first signal and a second signal, and the control signal is output according to the multiplexing signal and the enabling signal, and specifically comprises the steps of outputting the first control signal when the enabling signal is a preset signal and the multiplexing signal is the first signal, outputting the second control signal when the enabling signal is the preset signal and the multiplexing signal is the second signal, wherein the first control signal is used for enabling the sensing chip to execute a first function, and the second control signal is used for enabling the sensing chip to execute a second function.
In one implementation, the sensor chip is a magnetic angle sensor chip, and the target environmental parameter is a magnetic field angle.
In one implementation, the first function is to turn on a linear calibration or a nonlinear calibration;
In one implementation, the multiplexing signal comprises a first signal and a second signal, the multiplexing signal is generated according to the read detection signals, the multiplexing signal specifically comprises the steps of reading the detection signals of the detection units every preset time, determining the difference value of the detection signals in a specified time interval, generating the first signal when the difference value of the detection signals in the specified time interval is larger than or equal to a preset threshold value, generating the second signal when the difference value of the detection signals in the specified time interval is smaller than the preset threshold value, and outputting the control signals according to the multiplexing signal and the enabling signal, the multiplexing signal and the enabling signal specifically comprises the steps of processing the multiplexing signal and the enabling signal by using a digital signal processing circuit, wherein when the enabling signal is the preset signal, the digital signal processing circuit is enabled, and when the multiplexing signal is the first signal, the digital signal processing circuit is enabled to output the first control signal, when the multiplexing signal is the second signal, the digital signal processing circuit is enabled to output the second control signal, the first control signal is used for enabling the sensing chip to execute a first function, and the second control signal is used for enabling the sensing chip to execute a second function.
Detailed Description
With the development of chip functions, the number of required chip pins is also increasing, and in order to reduce the chip packaging volume, the number of pins which can be set on the chip is correspondingly smaller, especially, the number of pins which are set in the sensor chip is smaller, and generally, only 3-8 pins are provided, for example, some sensors only have three pins of power supply, ground and output, and other redundant pins are not supported, and at this time, the pins of the chip need to be multiplexed to ensure the chip functions.
In the following, a magnetic angle sensing chip designed by 8 pins is taken as an example, the magnetic angle sensing chip can generally select an output mode of a serial peripheral interface (SPI mode for short hereinafter) or an output format of an incremental encoder (ABZ mode for short hereinafter), 3 pins can be designed for ABZ mode output or SPI mode output in the magnetic angle sensing chip, 1 pin is designed for switching between ABZ mode output and SPI mode output, in addition, a power interface and a ground wire interface also occupy 2 pins, the magnetic angle sensing chip can be provided with other functions, however, the technical staff of the application finds that when a manufacturer performs actual mass production test, the communication calibration is carried out by adopting the SPI mode, so that the cost of the mass production test is increased, the manufacturer needs to use keys for calibration and display calibration to finish in the mass production test, and SPI communication is not adopted when a plurality of factories perform mass production test, and therefore, the pin design of the sensing chip needs to take account of the requirements of mass production test and the packaging size of the magnetic angle sensing chip. In order to meet the requirement of mass production test and reduce the cost of development test of the sensing chip, the 2 pins are required to complete three functions under the scene of mass production test, namely 1, starting linear calibration or nonlinear calibration, 2, setting the current angle value as a zero angle value, 3, displaying calibration completion or calibration failure signals, wherein the function 3 is used for displaying calibration completion or calibration failure signals and is an output signal of the chip, and one pin is preferably allocated for realizing the function, so that 1 pin is required to be multiplexed to realize the function 1, namely, starting the linear calibration or nonlinear calibration, and setting the current angle value as the zero angle value by the function 2.
In the related art, pin multiplexing is usually implemented by configuring a register or a state machine, for example, one or more registers dedicated for switching pin functions are configured in a chip, each bit of the registers is configured by software (programming/code) to switch the functions of each multiplexing pin, however, software configuration is complicated, complex program code is required to be programmed to set the functions of the pins, development cost is high, and when switching pin functions, not only bits in the registers need to be configured by software programming operation, but also data transmission based on communication between interfaces is required to implement configuration of bits in the registers, which increases complexity of a system and may have a certain delay.
In order to solve the problems of high complexity of a pin multiplexing system, low response speed of mode switching of multiplexing pins and the like in the related art, an embodiment of the application provides a sensing chip with multiplexing pins, and the embodiment of the application is described below with reference to the accompanying drawings. As one of ordinary skill in the art can know, with the development of technology and the appearance of new scenes, the technical scheme provided by the embodiment of the application is also applicable to similar technical problems.
Referring first to fig. 1, an embodiment of the present application provides a sensor chip with multiplexing pins, where the sensor chip includes multiplexing pins 11, an input judging unit 12, a detecting unit 13, a signal generating unit 14, a pin multiplexing unit 15, a first functional unit 161, and a second functional unit 162. Each unit in the sensor chip is specifically described below.
In the embodiment of the present application, the input judging unit 12 is connected to the multiplexing pin 11, and is configured to receive an input signal of the multiplexing pin 11, judge whether the input signal meets a trigger condition, and output an enable signal according to whether the input signal meets the trigger condition.
In the embodiment of the application, the multiplexing pin 11 is connected with the external trigger device 2, when the trigger device 2 is triggered, a designated signal is output to the multiplexing pin 11, and whether the trigger device 2 is triggered or not and whether the input is effective or not is determined by judging the input signal and the trigger condition of the multiplexing pin 11. The triggering device 2 may be a device such as a button, a switch, etc. which does not need to be in communication interaction based on a communication protocol, and corresponding input signals are different when the triggering device is different.
For example, when the trigger device is a key, the input signal of the multiplexing pin is a level signal, when the key is pressed, the level of the input multiplexing pin changes, if the key is pressed, the level of the input multiplexing pin changes from a high level to a low level, at this time, whether the input signal is valid or not can be judged by judging whether the input signal of the multiplexing pin corresponds to the level changing from high to low, for example, whether the input signal is valid or not by detecting whether a falling edge exists in the input signal, for example, the trigger condition can be that the falling edge of the input signal is detected, for example, whether the input signal is valid or not is judged by detecting whether the input signal is low, for example, the trigger condition can be that the input signal is low, and for example, when the multiplexing pin is a digital IO pin, the trigger condition can be that the input signal is digital signal 0.
In the embodiment of the present application, the input judging unit 12 is preferably implemented by a digital processing circuit, and the input signal is required to be processed into a digital signal, for example, a multiplexing pin may use a digital IO pin, after the trigger device is triggered, the multiplexing pin reads the state of the trigger device, and judges whether the voltage (the designated signal) is higher than/lower than the threshold value by detecting the logic value, the input signal of the multiplexing pin may be a digital signal of 0 or 1, for example, when the multiplexing pin is an analog IO pin, the input signal may be converted from an analog signal to a digital signal by a comparing circuit. The digital signal processing mode is beneficial to eliminating noise and distortion in analog signal processing, improving the reliability of the sensing chip, and the circuit design mode is realized, so that the system operation of the sensing chip is simplified, the system complexity is reduced, the time delay of software operation is reduced, and the response speed of the sensing chip is improved.
It should be noted that the foregoing is merely illustrative, and not intended to limit the scope of the present application, and the triggering component may be other components, which are not listed herein.
In the embodiment of the present application, the detection unit 13 is configured to detect a target environmental parameter, and generate a detection signal according to the target environmental parameter, where the target environmental parameter is a detection object of the sensor chip. It can be understood that the sensing chip is used for converting non-electrical quantities such as physical quantities, chemical quantities, biological quantities and the like in the environment into electrical signals, and each different sensing chip has a corresponding detection object, specifically, for example, the sensing chip is a magnetic angle sensing chip, the magnetic angle sensing chip is used for detecting a magnetic field angle, and it can be understood that a target environment parameter is a magnetic field angle, for example, the sensing chip is a temperature sensing chip, the temperature sensing chip is used for detecting a temperature, the target environment parameter is a temperature, and for example, the sensing chip is a photoelectric encoder, and the target environment parameter can be a luminous flux.
Specifically, the detecting unit 13 may include an sensing module, an analog-to-digital conversion module, and a signal processing module, where the sensing module in the detecting unit 13 generates a change of current or voltage after detecting a target environmental parameter, the analog-to-digital conversion module converts the current/voltage into a digital quantity, and the signal processing module processes the digital quantity with a digital process to calculate a corresponding detection signal. The sensing module is a Hall disk, and the sensing chip is a photoelectric encoder, and the sensing module consists of an optical code disk and a photosensitive element.
In the embodiment of the present application, the signal generating unit 14 is connected to the detecting unit 13, and the signal generating unit 14 is configured to read the detecting signal of the detecting unit at intervals of a preset time, and generate a multiplexed signal according to the read detecting unit. Specifically, the signal generating unit 14 may generate the multiplexed signal based on the change condition of the detection signal in the specified time interval, for example, the signal generating unit 14 may generate the multiplexed signal according to whether or not the difference value of the detection signals read in the specified time interval is greater than or equal to a preset threshold value, and for example, the signal generating unit 14 may generate the multiplexed signal based on the change rate of the detection signals read in the specified time interval. The signal generating unit 14 may also generate the multiplexed signal based on whether or not the detected signal read at every preset time deviates from the initial signal by more than the first value. It should be noted that this is only an example, and does not limit the scope of the present application.
The specified time interval may be different from or the same as the preset time, and the preset time and the specified time interval may be set according to actual requirements, and the preset threshold may also be set according to specific requirements. Of course, the shorter the preset time is, the faster the sampling frequency is, the more timely the change of the detection signal is monitored, and by combining with a proper specified time interval, the computing resource of the sensing chip can be saved, if the sampling frequency is too low, the change amount of the detection signal can be small, but the object for generating the target environmental parameter has very large variation, for example, the magnetic angle sensing chip detects the rotation angle of the magnet, under the condition that the preset time is 1 second, the rotation speed of the magnet can be very large, and the rotation can be performed for a plurality of circles, but the sampled angle has very small variation.
When the sensor chip is a magnetic angle sensor chip, for example, the signal generating unit reads the detection signal of the detecting unit every 1 microsecond (an example of a preset time), and generates a multiplexed signal according to whether or not the difference of the detection signals is greater than 5 ° (an example of a preset threshold value) within 1 second (an example of a specified time interval). For another example, the signal generating unit reads the detection signal every 1 microsecond, and determines whether or not the difference of the detection signals is 7 ° or more within 1.5 seconds to generate the multiplexed signal. For another example, the signal generating unit reads the detection signal of the detecting unit every 1 microsecond, and generates the multiplexed signal according to whether the rate of change of the detection signal is greater than or equal to 0.5 °/millisecond within 1 millisecond.
In the embodiment of the application, the signal generating unit 14 generates the multiplexing signal according to the read detection signal, wherein the signal generating unit 14 can be realized by adopting a digital signal processing circuit, the multiplexing signal output after being processed by the signal generating unit 14 can also be realized by adopting a software instruction, the output multiplexing signal is an instruction signal at the moment, and it can be understood that a micro control unit (Microcontroller Unit, MCU) is configured in the sensing chip, and the signal generating unit is realized by the MCU. Of course, the signal generating unit of the sensing chip in the embodiment of the application preferably adopts a digital circuit processing mode, and the transmission among the units is preferably transmitted by adopting digital signals, so that the operation cost of a system on complex data is reduced, the complexity of the system is simplified, the response speed of the sensing chip is further improved, the noise-leaning capability is improved, and the reliability is improved.
In the embodiment of the present application, the input end of the pin multiplexing unit 15 is connected to the output end of the input judging unit 12 and the output end of the signal generating unit 14, respectively, and the output end of the pin multiplexing unit 15 is connected to the first functional unit 161 and the second functional unit 162, respectively. The pin multiplexing unit 15 is configured to output a control signal according to the multiplexing signal and the enable signal, where the control signal is used to enable a target functional unit, and the target functional unit is the first functional unit 161 or the second functional unit 162. It can be understood that the pin multiplexing unit 15 performs switching of the functions of the multiplexing pins 11 in combination with the enable signal and the multiplexing signal, if the multiplexing pin 11 is currently operated in the first functional mode (i.e., the input state of the multiplexing pin is used to enable the sensing chip to implement the first function), the multiplexing pin 11 is operated in the second functional mode if the control signal output after the processing of the pin multiplexing unit 15 is the enable second functional unit 162, and the multiplexing pin 11 is still operated in the first functional mode if the control signal output after the processing of the pin multiplexing unit 15 is the enable first functional unit 161.
The multiplexing signal in the embodiment of the application comprises a first signal and a second signal, the control signal comprises a first control signal and a second control signal, the first control signal is used for enabling the first functional unit 161, the second control signal is used for enabling the second functional unit 162, the pin multiplexing unit 15 is specifically used for outputting the first control signal when the enabling signal is a preset signal and the multiplexing signal is the first signal, and outputting the second control signal when the enabling signal is the preset signal and the multiplexing signal is the second signal.
Specifically, in the embodiment of the present application, the pin multiplexing unit 15 receives the enable signal, and when the enable signal is a preset signal, the pin multiplexing unit 15 is enabled to work. The pin multiplexing unit may be implemented by configuring an MCU in the sensor chip, and it is understood that the pin multiplexing unit 15 determines whether the enable signal is valid through software instruction operation, for example, the enable signal is an instruction signal, the pin multiplexing unit 15 is configured to determine whether the enable signal is a preset instruction (at this time, the preset signal is a preset instruction), if the enable signal is the preset instruction, the enable signal is valid, and the pin multiplexing unit 15 is enabled to operate. The pin multiplexing unit may also determine whether the enable signal is valid by processing by a hardware circuit (such as a digital signal processing circuit), for example, the enable signal is input to an enable terminal of a circuit in the pin multiplexing unit 15, and the pin multiplexing unit may be that the circuit is enabled to operate when the enable signal is digital signal 0, and the preset signal is digital signal 0, or may be that the circuit is enabled to operate when the enable signal is digital signal 1, and the preset signal is digital signal 1. The preset signal in the embodiment of the application can be set according to the type of the enabling signal and the enabling logic of the pin multiplexing unit.
In the case where the enable signal is valid (even if the enable signal is a preset signal), the pin multiplexing unit 15 may output the control signal based on only the multiplexed signal, or may output the control signal based on the enable signal and the multiplexed signal.
Specifically, in the embodiment of the application, the control signal may be an instruction signal or a digital signal, for example, when the control signal is a digital signal, the digital signal is sent to the enabling end corresponding to the target functional unit to enable the target functional unit, and the control signal may also be an instruction signal, so that the target functional unit triggers the work through an instruction. For example, when the control signal is a digital signal, the pin multiplexing unit may be an enable terminal connected to the enable terminal of the first functional unit and the enable terminal of the second functional unit, respectively, the first functional unit is enabled when the enable terminal receives the digital signal 0, the second functional unit is enabled when the enable terminal receives the digital signal 1, and at this time, the first control signal is the digital signal 0, and the second control signal is the digital signal 1, so that the enabling of different functional units can be realized according to the output control signal.
As can be seen from the above, the embodiment of the present application utilizes the function of the sensing chip itself to implement pin multiplexing of the sensing chip, specifically, generates a multiplexing signal by detecting the change condition of the detection signal corresponding to the target environmental parameter detected by the detection unit, and compared with the configuration of the pin multiplexing implemented by the bits of the software operation configuration register in the related art, the embodiment of the present application does not need to specially set the register to implement pin multiplexing configuration, and when the pin function is switched, compared with the configuration of the bits of the software configuration register in the related art, the pin function is changed, and the configuration of the register is implemented by the signal transmitted based on the communication function between interfaces.
In addition, the application directly generates the multiplexing signal based on the change condition of the detection signal correspondingly output by the target environment parameter detected by the sensing chip, the mode switching of the multiplexing pin is determined by the signal detected by the sensing chip, the manual intervention is reduced in the pin multiplexing process, and the reliability of the mode switching of the multiplexing pin is improved. In addition, multiplexing of pin functions in the application combines target environment parameters (such as magnetic field, temperature and pressure) acquired by the sensing chip, realizes scene self-adaptive control, can be flexibly applied based on different sensing chips, and has better applicability by a pin multiplexing scheme.
In the following, taking the foregoing sensor chip as an example of the magnetic angle sensor chip, multiplexing pins of the magnetic angle sensor chip are multiplexed by a digital circuit processing manner, so as to realize that the multiplexing pins respectively work in an "on linear calibration or nonlinear calibration" mode (a first functional mode) and a "set zero angle value" mode (a second functional mode), and an example is illustrated of multiplexing schemes of the multiplexing pins in the embodiment of the present application.
The multiplexing pin of the magnetic angle sensing chip is a digital IO, the multiplexing pin is connected with an external key (trigger device), when the key is pressed/triggered, a low level (input signal) is sent to the multiplexing pin, at the moment, the multiplexing pin can transmit a digital signal 0 (input signal) to the input judging unit, when the key is not pressed/triggered, the multiplexing pin can receive a high level, at the moment, the multiplexing pin can input an input signal of 1 to the input judging unit.
The input judging unit receives the input signal input from the multiplexing pin, receives the input signal of the multiplexing pin, processes the processed input signal and the digital signal 0 (trigger condition) through a logic gate circuit (such as an OR gate) and other circuits, and outputs an enabling signal, wherein if the input signal is the digital signal 0, the input judging unit correspondingly outputs the digital signal 0 (enabling signal), and if the input signal is the digital signal 1, the input judging unit correspondingly outputs the digital signal 1.
The detection unit of the magnetic angle sensing chip detects the angle of the magnetic field (target environment parameter), after detecting the change of the angle of the magnetic field, the detection unit correspondingly changes current/voltage, the detection unit can convert the current/voltage into an angle value (detection signal) and then transmit the angle value to the signal generation unit, specifically, the detection unit can convert the current/voltage into a digital quantity through ADC (analog-to-digital conversion), the angle value is calculated in a digital processing mode, and then the angle value is transmitted to the signal generation unit.
The signal generating unit reads the angle value of the detecting unit every 1 microsecond (preset time), and determines a difference value of the read angle value within 1 second, generates a digital signal 0 (first signal) when the difference value of the angle value within 1 second is greater than or equal to 5 ° (preset threshold value), and generates a digital signal 1 (second signal) when the difference value of the angle value within 1 second is less than 5 °.
The pin multiplexing unit at least comprises a logic gate circuit (such as an OR gate), wherein the logic gate circuit is provided with an enabling end, an enabling signal and a multiplexing signal are input into the logic gate circuit, the enabling signal is input to the enabling end of the logic gate circuit, the logic gate circuit enables to work when the enabling signal is a digital signal 0 (preset signal), the logic gate circuit carries out logic processing on the enabling signal and the multiplexing signal, the multiplexing signal is output with a digital signal 0 (first control signal) when the multiplexing signal is a digital signal 0 (first signal), the multiplexing signal is output with a digital signal 1 (second control signal), the first control signal is used for enabling to start a linear calibration or nonlinear calibration functional unit (first functional unit), and the second control signal is used for enabling a zero point angle value setting functional unit (second functional unit).
It should be noted that, the circuit and the specific example referred to in this exemplary embodiment are one implementation manner of the embodiment of the present application, and the present application is not limited to the foregoing embodiment, and may be specifically designed according to practical requirements, and all are within the scope of protection of the present application.
The application also provides a pin multiplexing method applied to a sensing chip with multiplexing pins, which comprises the following steps:
step 200, receiving input signals input by the multiplexing pins and outputting enabling signals according to whether the input signals meet triggering conditions or not;
Step S201, detecting a target environment parameter, and correspondingly generating a detection signal according to the detected target environment parameter, wherein the target environment parameter is a detection object of the sensing chip;
Step S202, reading detection signals at intervals of preset time, and generating multiplexing signals according to the read detection signals;
step S203, a control signal is output according to the multiplexing signal and the enabling signal, wherein the control signal is used for enabling the sensing chip to execute a target function, and the target function is a first function or a second function.
In the embodiment of the present application, step S202 generates a multiplexed signal according to the read detection signal, which may specifically include determining a difference value of the detection signal in a specified time interval, and generating the multiplexed signal according to whether the difference value of the detection signal in the specified time interval is greater than or equal to a preset threshold.
The multiplexing signal comprises a first signal and a second signal, and the control signal is output according to the multiplexing signal and the enabling signal, and specifically comprises the steps of outputting the first control signal when the enabling signal is a preset signal and the multiplexing signal is the first signal, outputting the second control signal when the enabling signal is the preset signal and the multiplexing signal is the second signal, wherein the first control signal is used for enabling the sensing chip to execute a first function, and the second control signal is used for enabling the sensing chip to execute a second function.
The sensing chip in the embodiment of the application can be a magnetic angle sensing chip, the target environment parameter is a magnetic field angle, the target environment parameter is detected, and a detection signal is correspondingly generated according to the detected target environment parameter, specifically, the magnetic field angle is detected, and the detection signal is correspondingly generated according to the detected magnetic field angle.
In the embodiment of the application, the first function can be to start linear calibration or nonlinear calibration, and the second function can be to set a zero angle value.
The multiplexing signal comprises a first signal and a second signal, the multiplexing signal is generated according to the read detection signals, the multiplexing signal can be concretely generated by reading the detection signals of the detection units every preset time, determining the difference value of the detection signals in a specified time interval, generating the first signal when the difference value of the detection signals in the specified time interval is larger than or equal to a preset threshold value, generating the second signal when the difference value of the detection signals in the specified time interval is smaller than the preset threshold value, and outputting a control signal according to the multiplexing signal and the enabling signal.
The pin multiplexing method in the embodiment of the present application corresponds to the function implementation process of each unit in the sensor chip with multiplexing pins in the foregoing embodiment of the present application, and the parameters and related detailed schemes involved in the embodiment of the present application may refer to the specific description of the foregoing embodiment of the present application, which is not repeated herein.
As can be seen from the above, in the embodiment of the present application, the function of the sensing chip is utilized to implement pin multiplexing of the sensing chip, specifically, the multiplexing signal is generated by the change condition of the detection signal corresponding to the target environmental parameter detected by the sensing chip, and the control signal is output by combining the input signal of the multiplexing pin, and compared with the implementation of pin multiplexing by the bits of the software operation configuration register in the related art, the present application does not need to specially set a register to implement configuration of pin multiplexing; in addition, when the pin function is switched, compared with the mode of software configuration registers in the related art for changing the pin function, signals transmitted based on the communication function between interfaces are needed for configuring the registers.
In addition, the mode switching of the multiplexing pins is determined by the signals detected in the sensor chip, so that manual intervention is reduced in the pin multiplexing process, and the reliability of the mode switching of the multiplexing pins is improved. In addition, multiplexing of pin functions in the embodiment of the application combines target environment parameters (such as magnetic field, temperature and pressure) acquired by the sensing chip, realizes scene self-adaptive control, can be flexibly applied based on different sensing chips, and has better applicability.
Finally, it should be emphasized that the foregoing is merely a preferred embodiment of the present application, and is not intended to limit the application, but rather that various changes and modifications can be made by those skilled in the art without departing from the spirit and principles of the application, and any modifications, equivalent substitutions, improvements, etc. are intended to be included within the scope of the present application.