Sensor identification method and system based on TC234
By reading and comparing the sensor type determination flag bits in the memory, the AD type and SENT type sensor signals on the TC234 chip are automatically identified, which solves the upgrade problem caused by the inability to identify the signal type, and realizes the intelligence of the system and the accuracy of data processing. sex.
Patent Information
- Application Number
- CN202410627322.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-21
AI Technical Summary
When using the TC234 chip, AD type and SENT type sensor signals cannot be automatically recognized and switched, resulting in possible incorrect operations or configuration issues during the software upgrade process, affecting the operation of mass-produced parts.
Determine the flag bit by reading the sensor type in the memory, compare it with the preset flag bit, if it does not match, receive the sensor signal of the target channel, parse the signal to automatically identify the sensor type, and determine the signal value according to the type to ensure that the system operates in a short time. Accurately process sensor data within seconds.
Automatic identification and switching of sensor types is realized, avoiding incorrect operations during the upgrade process, reducing risks to mass-produced parts, and ensuring the intelligence of the system and the accuracy of data processing.
Smart Images

Figure CN118209151B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of signal acquisition, and in particular to a sensor identification method and system based on TC234. Background Art
[0002] PIN35 and PIN36 of the TC234 chip are capable of receiving, identifying and analyzing any of the two sensor signals: one of which is an AD signal and the other is a SENT signal. Based on this feature, there are two options when selecting sensors to adapt to the TC234 chip. Based on these two designs, there will be requirements such as VAVE (Value Analysis, Value Engineering) during the development process. When replacing sensors, if the two sensors cannot be identified and the corresponding programs cannot be run, it may cause trouble for the upgrade of mass-produced parts. Summary of the invention
[0003] In view of the above defects, an embodiment of the present invention discloses a sensor identification method based on TC234, which can automatically identify the sensor type and automatically switch to another one. After the code is upgraded, the operation of the original mass-produced parts will not be affected.
[0004] The first aspect of the embodiment of the present invention discloses a sensor identification method based on TC234, comprising:
[0005] Reading the sensor type determination flag in the memory to determine whether it is a preset flag, and if the determination flag is not the preset flag, receiving the sensor signal sent by the target channel;
[0006] Analyze the sensor signal, and determine the sensor type according to the sensor signal, wherein the sensor type is AD type or SENT type;
[0007] A signal value corresponding to the sensor signal is determined according to the sensor type.
[0008] The embodiment of the present invention can quickly and effectively determine whether the sensor type has been determined by reading the sensor type determination flag in the memory and comparing it with the preset flag. If the determination flag does not match the preset flag, that is, the sensor type has not been determined, the sensor signal sent by the target channel (specifically, the 35th pin and / or the 36th pin of the TC234 chip) is further received, thereby realizing automatic recognition and determination of the sensor type and improving the intelligence level of the system.
[0009] By automatically identifying and determining the sensor type, possible erroneous operations or configuration problems that may occur during the upgrade process due to failure to identify the sensor type can be avoided, which helps ensure the smooth progress of the upgrade process and reduces the risk of mass-produced parts being unusable. Moreover, the identification of the sensor type can be completed automatically in a short time, thereby determining the signal value according to the sensor type, which helps the system process and analyze sensor data more accurately and provides a reliable basis for subsequent decision-making.
[0010] As an optional implementation manner, in the first aspect of the embodiment of the present invention, parsing the sensor signal and determining the sensor type according to the sensor signal includes:
[0011] First, configure the sensor signal as a SENT type signal;
[0012] According to the sensor signal parsing register RSI value, when the register RSI value is 0, it means that the falling edge of the sensor signal is not detected, and the type corresponding to the sensor signal is configured as AD type; conversely, if the register RSI value is 1, it means that the falling edge of the sensor signal is detected, and the type corresponding to the sensor signal is configured as SENT type;
[0013] Write the sensor type determination flag and sensor type into the memory.
[0014] By initially configuring the sensor signal as a SENT type signal, this method provides a basis for subsequent analysis and judgment. This configuration method enables the system to start processing the sensor signal in a preset way, avoiding processing confusion or errors caused by unknown signal types.
[0015] Using the SENT special register RSI value to judge the characteristics of the sensor signal is an efficient and accurate method. When the register RSI value is 0, it means that the falling edge of the sensor signal is not detected, which is usually consistent with the signal characteristics of the AD type sensor; and when the RSI value is 1, it means that the falling edge is detected, which usually indicates the presence of a SENT type sensor. In this way, the system can quickly and accurately determine the sensor type.
[0016] Writing the sensor type determination flag and sensor type into the memory ensures that this information can be permanently stored and read and used in subsequent operations. This helps ensure that the system can accurately identify the sensor type and run the corresponding program when needed, thus avoiding upgrade troubles caused by incorrect sensor type identification.
[0017] As an optional implementation, in the first aspect of the embodiment of the present invention, when the value of the register RSI is 0, it means that the falling edge of the sensor signal is not detected, and the type corresponding to the sensor signal is configured as AD type, including:
[0018] When the interrupt request flag is successfully received and the register RSI value is 0, it means that the falling edge of SENT is not detected, the sensor reading status is set to not read out, and the target channel status is returned as sampling or no sampling signal is received;
[0019] According to the target channel state, the type corresponding to the sensor signal is configured as AD type.
[0020] The embodiment of the present invention can more accurately determine the type of sensor signal by successfully receiving the interrupt request flag and combining the register RSI value for judgment. When the interrupt request flag is successfully received and the RSI value is 0, the system can be sure that the falling edge of the SENT type sensor signal is not detected, so that the sensor type is configured as AD type with basis, and this double confirmation mechanism improves the accuracy and reliability of identification.
[0021] When determining that the sensor type is AD type, the method also considers the state of the target channel. Based on the state of the target channel, the system can further verify whether the configuration of the sensor type is correct. If the target channel state is sampling or no sampling signal is received, this indicates that the sensor signal is being processed or a valid sampling signal has not been received, which further supports the decision to configure the sensor type as AD type.
[0022] As an optional implementation, in the first aspect of the embodiment of the present invention, if the value of the register RSI is 1, it means that the falling edge of the sensor signal is detected, and the type corresponding to the sensor signal is configured as SENT type, including:
[0023] When the interrupt request flag is successfully received and the register RSI value is 1, it means that the falling edge of SENT is detected, the sensor read status setting is read successfully, and the target channel status is returned as a valid signal;
[0024] According to the target channel state, the type corresponding to the sensor signal is configured as a SENT type.
[0025] The embodiment of the present invention ensures the accuracy of detecting the falling edge of the SENT sensor signal by successfully receiving the interrupt request flag and judging the register RSI value. When the interrupt request flag is successfully received and the RSI value is 1, the system can be sure that the characteristics of the SENT sensor signal are detected, so as to configure the sensor type as SENT type based on the evidence. This double confirmation mechanism improves the accuracy and reliability of sensor type identification.
[0026] Secondly, when the sensor type is determined to be SENT, the method further considers the sensor reading status and the target channel status. The sensor reading status is set to readout success, and the target channel status is returned as signal valid, which further verifies the correctness of the sensor type configuration.
[0027] As an optional implementation manner, in the first aspect of the embodiment of the present invention, if the determination flag bit is the preset flag bit, then:
[0028] Determine the sensor type based on the value in NVM.
[0029] The embodiment of the present invention uses NVM (Non-Volatile Memory) to store sensor type information. For example, when the value in NVM is 0, it corresponds to an AD type sensor, and when the value in NVM is 1, it corresponds to a SENT type sensor. This ensures that the sensor type information can be retained even after the system is powered off or restarted, avoiding the tedious process of re-identifying the sensor type every time the system starts, thereby improving the startup speed and efficiency of the system.
[0030] Moreover, the method simplifies the process of sensor type identification. When the flag bit is determined to match the preset flag bit, the system can directly read the value in the NVM to obtain the sensor type without performing additional parsing or judgment operations, reducing the complexity and maintenance cost of the system.
[0031] As an optional implementation manner, in the first aspect of the embodiment of the present invention, determining the signal value corresponding to the sensor signal according to the sensor type includes:
[0032] When the sensor type is AD type, the sensor signal is configured as an AD signal, and the AD signal is analyzed to obtain a signal value;
[0033] When the sensor type is a SENT type, the sensor signal is configured as a SENT signal, and the SENT signal is parsed to obtain a signal value.
[0034] The embodiment of the present invention configures the sensor signal by sensor type, thereby ensuring the pertinence and accuracy of the signal processing process. AD sensors and SENT sensors differ in signal characteristics, processing methods, etc. Therefore, configuring them differently can ensure the correctness and effectiveness of signal processing.
[0035] By analyzing the configured sensor signal, the signal value can be accurately extracted. Both AD signal and SENT signal have their specific signal format and encoding method. Through the corresponding analysis method, the system can accurately decode the signal and obtain useful signal value.
[0036] For example, if an AD signal is to be parsed, a series of processing steps are usually required to obtain a signal value from the AD signal, and these steps may include sampling, quantization, encoding, etc.
[0037] Sampling: First, the analog signal needs to be discretized through the sampling process. Sampling refers to taking values of the analog signal at a certain time interval. This time interval is the sampling period, and its reciprocal is the sampling frequency. The selection of the sampling frequency needs to satisfy Shannon's sampling theorem, that is, the sampling frequency must be greater than twice the highest frequency component in the signal to avoid aliasing.
[0038] Quantization: The discrete signal after sampling needs to be quantized, that is, the value of each sampling point is approximated to the closest quantization level.
[0039] Coding: The quantized signal needs to be encoded to convert each quantization level into a corresponding digital code to obtain the final digital signal (i.e. AD signal).
[0040] After obtaining the AD signal, the signal value is the value represented by these digital codes. These values represent an approximate representation of the original analog signal.
[0041] Of course, the specific implementation method may vary depending on the hardware and software environment. In practical applications, factors such as filter design, noise suppression, calibration, and calibration drift compensation may also need to be considered to ensure the accuracy and reliability of the signal value obtained from the AD signal.
[0042] As an optional implementation, in the first aspect of the embodiment of the present invention, the preset flag bit is 0×55AA, or / and, and the memory is EEPROM.
[0043] The specific preset flag bit (0×55AA) of the embodiment of the present invention can increase the security and accuracy of the data. As a specific identifier, this flag bit plays a key verification role in the data storage and reading process. Only when the read flag bit matches the preset flag bit, the system will consider the data to be valid, thereby avoiding sensor type identification errors caused by data errors or tampering.
[0044] EEPROM is a non-volatile memory that can retain data after power failure, making it very suitable for storing information that needs to be preserved for a long time, such as sensor types. In addition, EEPROM also has the characteristics of high write times and long data retention time, ensuring data reliability and durability.
[0045] A second aspect of an embodiment of the present invention discloses a sensor identification system based on TC234, characterized in that it includes:
[0046] A reading unit, used for reading the sensor type determination flag in the memory to determine whether it is a preset flag, and if the determination flag is not the preset flag, receiving the sensor signal sent by the target channel;
[0047] An analysis unit, used for analyzing the sensor signal, and determining a sensor type according to the sensor signal, wherein the sensor type is an AD type or a SENT type;
[0048] A determination unit is used to determine a signal value corresponding to the sensor signal according to the sensor type.
[0049] The embodiment of the present invention can quickly and effectively determine whether the sensor type has been determined by reading the sensor type determination flag in the memory and comparing it with the preset flag. If the determination flag does not match the preset flag, that is, the sensor type has not been determined, the sensor signal sent by the target channel (specifically, the 35th pin and / or the 36th pin of the TC234 chip) is further received, thereby realizing automatic recognition and determination of the sensor type and improving the intelligence level of the system.
[0050] By automatically identifying and determining the sensor type, possible erroneous operations or configuration problems that may occur during the upgrade process due to failure to identify the sensor type can be avoided, which helps ensure the smooth progress of the upgrade process and reduces the risk of mass-produced parts being unusable. Moreover, the identification of the sensor type can be completed automatically in a short time, thereby determining the signal value according to the sensor type, which helps the system process and analyze sensor data more accurately and provides a reliable basis for subsequent decision-making.
[0051] A third aspect of an embodiment of the present invention discloses an electronic device, comprising: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the sensor identification method based on TC234 disclosed in the first aspect of the embodiment of the present invention.
[0052] A fourth aspect of an embodiment of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the sensor identification method based on TC234 disclosed in the first aspect of an embodiment of the present invention.
[0053] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0054] The embodiment of the present invention can read the sensor type determination flag in the memory and compare it with the preset flag, so as to quickly and effectively determine whether the sensor type has been determined. If the determination flag does not match the preset flag, that is, the sensor type has not been determined, the sensor signal sent by the target channel (specifically, the 35th pin and / or the 36th pin of the TC234 chip) is further received, thereby realizing automatic recognition and determination of the sensor type. It can automatically identify the sensor type and automatically switch to the corresponding analysis mode, and the operation of the original mass-produced parts will not be affected even after the software is upgraded. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0056] Figure 1 It is a flow chart of a sensor identification method based on TC234 disclosed in an embodiment of the present invention;
[0057] Figure 2 is a characteristic schematic diagram of an AD type sensor signal disclosed in an embodiment of the present invention;
[0058] Figure 3 is a characteristic schematic diagram of a SENT type sensor signal disclosed in an embodiment of the present invention;
[0059] Figure 4 is a flow chart of a sensor signal recognition process disclosed in an embodiment of the present invention;
[0060] Figure 5 It is a structural schematic diagram of a sensor identification system based on TC234 provided in an embodiment of the present invention;
[0061] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] It should be noted that the terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention are used to distinguish different objects rather than to describe a specific order. The terms "including" and "having" in the embodiments of the present invention and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0064] Embodiment 1
[0065] See also Figure 1 , Figure 1 It is a flow chart of the sensor identification method based on TC234 disclosed in the embodiment of the present invention. The execution subject of the method described in the embodiment of the present invention is composed of software and / or hardware, wherein the hardware part is mainly used to store the sensor type determination flag, preset flag, and sensor type value, etc. For example, the sensor type determination flag and preset flag can be stored through EEPROM, and the sensor type value can be stored through NVM, etc. The software part is mainly used for operations such as judgment and analysis to determine the sensor type and complete automatic switching to the analysis code corresponding to the target sensor type.
[0066] The embodiment of the present invention mainly focuses on the sensor signal recognition of pins 35 and 36 of the TC234 chip. Both pins can receive sensor signals collected by AD sensors and SENT sensors. The sensor signals include but are not limited to pressure signals, temperature signals, etc. After the sensor signal is recognized, it will automatically switch to the signal analysis program corresponding to the corresponding sensor type to analyze the signal of the corresponding sensor type and obtain the signal value.
[0067] If the sensor type cannot be identified, there are two existing methods. The first is solidification, that is, pin 35 or pin 36 of each TC234 chip can only be fixedly connected to an AD sensor or a SENT sensor. This method does not utilize subsequent expansion. The second is to achieve it through a switching switch, that is, to inform the TC234 chip of the sensor type currently connected to pin 35 or pin 36 through a switching switch. This method optimizes the first method, but cannot achieve intelligence. Especially when applied to batch operations of automobiles, it is inefficient and prone to misoperation and safety accidents.
[0068] In addition, when considering requirements such as VAVE (Value Analysis, Value Engineering), a new sensor type is used to replace an old sensor type, for example, an AD sensor is replaced with a SENT sensor. If the two sensors cannot be identified and the corresponding programs cannot be run, it may cause trouble for the upgrade of mass-produced parts.
[0069] Based on this, the embodiment of the present invention makes improvements to the software part of TC234 to realize automatic identification and switching of sensor types without affecting the operation of the original mass-produced parts.
[0070] like Figure 1 As shown, the sensor identification method based on TC234 includes the following steps:
[0071] S110, reading the sensor type in the memory to determine whether the flag is a preset flag, and if the determination flag is not the preset flag, receiving the sensor signal sent by the target channel.
[0072] The specific preset flag bit (0×55AA) of the embodiment of the present invention can increase the security and accuracy of the data. As a specific identifier, this flag bit plays a key verification role in the data storage and reading process. Only when the read flag bit matches the preset flag bit, the system will consider the data to be valid, thereby avoiding sensor type identification errors caused by data errors or tampering.
[0073] The memory for storing the sensor type determination flag bit can be, but is not limited to, EEPROM. As a non-volatile memory, EEPROM can keep data intact after power failure, so it is very suitable for storing information that needs to be stored for a long time, such as sensor type. In addition, EEPROM also has the characteristics of many write times and long data storage time, which ensures the reliability and durability of data.
[0074] The embodiment of the present invention can quickly and effectively determine whether the sensor type has been determined by reading the sensor type determination flag in the memory and comparing it with the preset flag. Then, the specific type of the sensor can be determined by reading the value in the NVM, thereby switching the parsing program to the sensor type.
[0075] NVM is used to store sensor type information. For example, when the value in NVM is 0, it corresponds to an AD type sensor. When the value in NVM is 1, it corresponds to a SENT type sensor. This ensures that the sensor type information can be retained even after the system is powered off or restarted, avoiding the tedious process of re-identifying the sensor type every time the system starts, thereby improving the system startup speed and efficiency.
[0076] If the flag bit is not consistent with the preset flag bit, the sensor type has not been determined. The sensor signal sent by the target channel (specifically the 35th pin and / or the 36th pin of the TC234 chip) can be received and analyzed to realize automatic identification and determination of the sensor type, thus improving the intelligence level of the system.
[0077] S120, analyzing the sensor signal, and determining a sensor type according to the sensor signal, wherein the sensor type is an AD type or a SENT type.
[0078] Please refer to Figure 2 As shown, Figure 2 It is a characteristic of an AD type sensor signal, which is an analog signal converted into a digital signal. In the AD type sensor signal, there is no rising edge and falling edge.
[0079] SENT (Single Edge Nibble Transmission), with international specification number SAE J2716, is mainly used for data transmission from automotive sensors to ECUs. This type of communication has the following characteristics:
[0080] High signal frequency, fast transmission speed, low cost; communication protocol based on 5V logic level; a one-way transmission protocol; data transmission can be divided into fast channel and slow channel; each frame is composed of pulses of different widths; the pulse width carries the information to be transmitted; each pulse transmits a half-byte of information (0-15);
[0081] The SENT protocol has the following basic rules:
[0082] The pulse sequence (i.e., frame structure) is fixed; the maximum allowable clock beat time error is ±20%; when the clock beat time is 3us, the longest allowable frame data duration does not exceed 1ms; the clock beat can be set between 3-90us; the encoding scheme defines a 4-bit CRC check bit.
[0083] like Figure 3 As shown in the figure, the SENT sensor signal is transmitted through a series of pulse sequences between two falling edge cycles. The SENT message starts with a synchronization pulse 201 (Synchronization / calibration pulse). The time interval between this pulse and the subsequent falling edge is equivalent to 56 clock ticks. After the synchronization pulse, there is a status / communication pulse 202 (Status and Serial Communication pulse), which is 12~27 clock ticks. The status / communication half byte is transmitted in the SENT format. Then there are 6 Data Nibbles containing sensor data, namely data pulse 203, data pulse 204, data pulse 205, data pulse 206, data pulse 207 and data pulse 208. Each Nibble is 12~27 clock ticks. ticks, where data pulse 203, data pulse 204 and data pulse 205 are recorded as signal 1, data pulse 206, data pulse 207 and data pulse 208 are recorded as signal 2, and data pulses are transmitted in units of 4 data bits, or "nibble" (one nibble is one Nibble); a check pulse 209 is provided at the end of each message (CRC and checksum pulse are 12~27 clock ticks), and a pause pulse 210 (pause pulse) with a fixed length not exceeding 1ms is inserted thereafter (optionally), so the length of the SENT message will vary with the value of the nibble.
[0084] Based on the difference between the AD sensor signal and the SENT sensor signal, it can be determined whether it is an AD sensor signal or a SENT sensor signal by detecting the falling edge.
[0085] For details, please refer to Figure 4 As shown, it may include the following steps:
[0086] S121. First, configure the sensor signal as a SENT type signal.
[0087] By initially configuring the sensor signal as a SENT type signal, this method provides a basis for subsequent analysis and judgment. This configuration method enables the system to start processing the sensor signal in a preset way, avoiding processing confusion or errors caused by unknown signal types.
[0088] S122. Analyze the register RSI value according to the sensor signal. When the register RSI value is 0, it indicates that the falling edge of the sensor signal is not detected, and the type corresponding to the sensor signal is configured as AD type. Conversely, if the register RSI value is 1, it indicates that the falling edge of the sensor signal is detected, and the type corresponding to the sensor signal is configured as SENT type.
[0089] The register RSI value in the embodiment of the present invention is the SENT special register RSI value. Using the SENT special register RSI value to judge the characteristics of the sensor signal is an efficient and accurate method. When the register RSI value is 0, it means that the falling edge of the sensor signal is not detected, which is usually consistent with the signal characteristics of the AD type sensor; and when the RSI value is 1, it means that the falling edge is detected, which usually indicates the existence of the SENT type sensor. In this way, the system can quickly and accurately determine the sensor type.
[0090] For the identification of AD sensor signals, if the interrupt request flag is successfully received and the register RSI value is 0, it means that the falling edge of the SENT signal is not detected, the sensor read status is set to not read (Sent_ReadDataErr_NoDataReceived), and the target channel status is returned as sampling or no sampling signal is received (e_PSSampling);
[0091] According to the target channel state, if the target channel state is e_PSSampling, it means that the sensor signal received by the target channel is an AD type signal, and the type corresponding to the sensor signal is configured as AD type.
[0092] For the identification of SENT sensor signals, if the interrupt request flag is successfully received and the register RSI value is 1, it means that the falling edge of SENT is detected, the sensor read status setting is read successfully, and the target channel status is returned as signal valid (e_PSValid);
[0093] According to the target channel state, if the target channel state is e_PSValid, it means that the sensor signal received by the target channel is a SENT type signal, and the type corresponding to the sensor signal is configured as SENT type.
[0094] S123, writing the sensor type determination flag and the sensor type into the memory.
[0095] Specifically, the sensor type determination flag is written into the EEPROM with the same content as the preset flag, and the sensor type is written into the NVM as the value in the NVM.
[0096] Writing the sensor type determination flag and sensor type into the memory ensures that this information can be permanently stored and read and used in subsequent operations. This helps ensure that the system can accurately identify the sensor type and run the corresponding program when needed, thus avoiding upgrade troubles caused by incorrect sensor type identification.
[0097] S130. Determine a signal value corresponding to the sensor signal according to the sensor type.
[0098] After completing the identification of the sensor type (the identified sensor type is recorded as the target sensor type), it can automatically switch to the program corresponding to the target sensor type, that is, the sensor signal collected by the received target sensor type is analyzed through its corresponding program to obtain the signal value.
[0099] The analysis methods of AD type signals and SENT type signals are all existing conventional technologies and will not be described in detail here.
[0100] Embodiment 2
[0101] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the structure of the sensor identification system based on TC234 disclosed in the embodiment of the present invention. Figure 5 As shown, the sensor identification system based on TC234 may include:
[0102] The reading unit 310 is used to read the sensor type determination flag in the memory to determine whether it is a preset flag, and if the determination flag is not the preset flag, receive the sensor signal sent by the target channel;
[0103] An analysis unit 320, configured to analyze the sensor signal and determine a sensor type according to the sensor signal, wherein the sensor type is an AD type or a SENT type;
[0104] The determination unit 330 is configured to determine a signal value corresponding to the sensor signal according to the sensor type.
[0105] Preferably, the parsing unit 320 may include:
[0106] First, configure the sensor signal as a SENT type signal;
[0107] According to the sensor signal parsing register RSI value, when the register RSI value is 0, it means that the falling edge of the sensor signal is not detected, and the type corresponding to the sensor signal is configured as AD type; conversely, if the register RSI value is 1, it means that the falling edge of the sensor signal is detected, and the type corresponding to the sensor signal is configured as SENT type;
[0108] Write the sensor type determination flag and sensor type into the memory.
[0109] Preferably, when the value of the register RSI is 0, it indicates that the falling edge of the sensor signal is not detected, and the type corresponding to the sensor signal is configured as AD type, including:
[0110] When the interrupt request flag is successfully received and the register RSI value is 0, it means that the falling edge of SENT is not detected, the sensor reading status is set to not read out, and the target channel status is returned as sampling or no sampling signal is received;
[0111] According to the target channel state, the type corresponding to the sensor signal is configured as AD type.
[0112] Preferably, if the register RSI value is 1, it indicates that a falling edge of the sensor signal is detected, and the type corresponding to the sensor signal is configured as a SENT type, including:
[0113] When the interrupt request flag is successfully received and the register RSI value is 1, it means that the falling edge of SENT is detected, the sensor read status setting is read successfully, and the target channel status is returned as a valid signal;
[0114] According to the target channel state, the type corresponding to the sensor signal is configured as a SENT type.
[0115] Preferably, if the determination flag is the preset flag, then: the sensor type is determined according to the value in the NVM.
[0116] Preferably, the determining unit 330 may include:
[0117] When the sensor type is AD type, the sensor signal is configured as an AD signal, and the AD signal is analyzed to obtain a signal value;
[0118] When the sensor type is a SENT type, the sensor signal is configured as a SENT signal, and the SENT signal is parsed to obtain a signal value.
[0119] Preferably, the preset flag bit is 0×55AA, or / and, the memory is EEPROM.
[0120] Embodiment 3
[0121] See also Figure 6 , Figure 6 FIG. 2 shows a schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention. Figure 6 As shown, the electronic device includes at least one processor 410, and a memory connected to the at least one processor 410, such as a ROM (read-only memory) 420, a RAM (random access memory) 430, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 410 can perform various appropriate actions and processes according to the computer program stored in the ROM 420 or the computer program loaded from the storage unit 480 to the random access memory RAM 430. In the RAM 430, various programs and data required for the operation of the motor can also be stored. The processor 410, the ROM 420, and the RAM 430 are connected to each other via a bus 440. The I / O (input / output) interface 450 is also connected to the bus 440.
[0122] A number of components in the motor are connected to the I / O interface 450, including: an input unit 460, such as a keyboard, a mouse, etc.; an output unit 470, such as various types of displays, speakers, etc.; a storage unit 480, such as a disk, an optical disk, etc.; and a communication unit 490, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 490 allows the motor to exchange information / data with other devices through a computer network such as the Internet or / and various telecommunication networks.
[0123] The processor 410 may be a variety of general or / and special processing components with processing and computing capabilities. Some examples of the processor 410 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 410 executes one or more steps of a sensor identification method based on TC234 described in the first embodiment above.
[0124] In some embodiments, a sensor identification method based on TC234 may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 480. In some embodiments, part or all of the computer program may be loaded or / and installed on the motor via the ROM 420 and / or the communication unit 490. When the computer program is loaded into the RAM 430 and executed by the processor 410, one or more steps of the sensor identification method based on TC234 described in the first embodiment above may be performed. Alternatively, in other embodiments, the processor 410 may be configured to perform a sensor identification method based on TC234 in any other appropriate manner (e.g., by means of firmware).
[0125] The above is a detailed introduction to a sensor identification method and system based on TC234 disclosed in the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A sensor identification method based on TC234, It is characterized in that include: Reading the sensor type determination flag in the memory to determine whether it is a preset flag, and if the determination flag is not the preset flag, receiving the sensor signal sent by the target channel; Analyze the sensor signal, and determine the sensor type according to the sensor signal, wherein the sensor type is AD type or SENT type; Determine a signal value corresponding to the sensor signal according to the sensor type; Parsing the sensor signal and determining the sensor type according to the sensor signal includes: First, configure the sensor signal as a SENT type signal; According to the sensor signal parsing register RSI value, when the register RSI value is 0, it means that the falling edge of the sensor signal is not detected, and the sensor type corresponding to the sensor signal is configured as AD type; conversely, if the register RSI value is 1, it means that the falling edge of the sensor signal is detected, and the sensor type corresponding to the sensor signal is configured as SENT type; Write the sensor type determination flag and sensor type into the memory.
2. The sensor identification method based on TC234 as claimed in claim 1, It is characterized in that When the value of the register RSI is 0, it means that the falling edge of the sensor signal is not detected, and the sensor type corresponding to the sensor signal is configured as AD type, including: When the interrupt request flag is successfully received and the register RSI value is 0, it means that the falling edge of SENT is not detected, the sensor reading status is set to not read out, and the target channel status is returned as sampling or no sampling signal is received; According to the target channel state, the sensor type corresponding to the sensor signal is configured as AD type.
3. The sensor identification method based on TC234 as claimed in claim 1, It is characterized in that If the register RSI value is 1, it means that the falling edge of the sensor signal is detected, and the sensor type corresponding to the sensor signal is configured as SENT type, including: When the interrupt request flag is successfully received and the register RSI value is 1, it means that the falling edge of SENT is detected, the sensor read status setting is read successfully, and the target channel status is returned as a valid signal; According to the target channel state, the sensor type corresponding to the sensor signal is configured as a SENT type.
4. The sensor identification method based on TC234 as claimed in claim 1, It is characterized in that If the determination flag is the preset flag, then: Determine the sensor type based on the value in NVM.
5. The sensor identification method based on TC234 as claimed in claim 1, It is characterized in that Determining a signal value corresponding to the sensor signal according to the sensor type includes: When the sensor type is AD type, configuring the sensor signal as an AD signal, parsing the AD signal to obtain a signal value; When the sensor type is a SENT type, the sensor signal is configured as a SENT signal, and the SENT signal is parsed to obtain a signal value.
6. The sensor identification method based on TC234 as claimed in claim 1, It is characterized in that The preset flag bit is 0×55AA, or / and, and the memory is EEPROM.
7. A sensor identification system based on TC234, It is characterized in that include: A reading unit, used for reading the sensor type determination flag in the memory to determine whether it is a preset flag, and if the determination flag is not the preset flag, receiving the sensor signal sent by the target channel; An analysis unit, used for analyzing the sensor signal, and determining a sensor type according to the sensor signal, wherein the sensor type is an AD type or a SENT type; a determining unit, configured to determine a signal value corresponding to the sensor signal according to the sensor type; Parsing unit, including: First, configure the sensor signal as a SENT type signal; According to the sensor signal parsing register RSI value, when the register RSI value is 0, it means that the falling edge of the sensor signal is not detected, and the sensor type corresponding to the sensor signal is configured as AD type; conversely, if the register RSI value is 1, it means that the falling edge of the sensor signal is detected, and the sensor type corresponding to the sensor signal is configured as SENT type; Write the sensor type determination flag and sensor type into the memory.
8. An electronic device, It is characterized in that include: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the sensor identification method based on TC234 according to any one of claims 1 to 6.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the sensor identification method based on TC234 according to any one of claims 1 to 6.
