Chip transmission speed detection method and electronic device
By detecting and averaging the bit transmission time of the signal waveform in the processing unit, the problem of data transmission errors caused by the difference in transmission speed between the sensor and the processor chip is solved, realizing automatic adjustment and stable data reading, which is suitable for a variety of sensing devices.
Patent Information
- Application Number
- CN202111069378.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-07-22
- Filing Date
- 2021-09-13
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-09-13
AI Technical Summary
In existing general asynchronous transceiver interfaces in electronic devices, the difference in transmission speed between the sensor and the processor chip leads to data transmission errors, which cannot be automatically adjusted, affecting the accuracy of data reading.
The processing unit acquires the signal waveform of the general asynchronous transceiver interface, detects the bit transmission time of three consecutive bit conversions, selects the minimum time for averaging, sets it as the chip transmission speed, and automatically detects and updates it when the processing unit is powered on to adapt to the connection of different devices.
It enables automatic detection and updating of chip transmission speed without changing the content of the operating signal, improving the accuracy of data reading and the stability of device operation, and is suitable for various connected sensing devices.
Smart Images

Figure CN115701007B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a chip transfer rate (Baud Rate) detection method and electronic device, particularly to a chip transfer rate detection method that does not require clock pin synchronization and can automatically adjust to accommodate data transmission of various products, as well as an electronic device for performing the chip transfer rate detection method. Background Technology
[0002] Various electronic devices often incorporate multiple sensors, such as temperature, humidity, distance, and orientation sensors. These sensors transmit their information to the device's processor via a Universal Asynchronous Receiver Transmitter (UART) interface. UART transmits data through the TX pin and receives data through the RX pin, without requiring synchronization via a clock signal. In this case, data transmission and reception are synchronized through transmission speed; that is, by confirming the timing of each bit's transmission or reception, the sender and receiver are synchronized, thus obtaining accurate information.
[0003] In existing electronic devices with general-purpose asynchronous transceiver interfaces, although the data transmission speed can be identified by the model number, differences in timing or manufacturing errors can cause discrepancies between the transmission speeds of the sender and receiver, leading to communication errors. To automatically adjust the transmission speed, a start bit must be set during data transmission, and the time from the start bit to a preset bit must be set as a high-level bit. The time elapsed to reach the first bit or the preset bit is then detected to calculate the transmission time for each bit. However, existing sensors often begin transmitting sensing data immediately upon power connection without specifying a corresponding message header format for the initial bit detection, making it difficult to achieve the goal of automatically adjusting the transmission speed.
[0004] In summary, the inventors of this invention have conceived and designed a chip transmission speed detection method and electronic device in order to improve upon the problems of known technologies and thereby enhance their industrial application. Summary of the Invention
[0005] In view of the problems described in the background art, the purpose of the present invention is to provide a chip transmission speed detection method and electronic device to avoid the problem of data transmission accuracy being affected by the difference in chip transmission speed between the sensor and the processor, thus causing data reading errors.
[0006] To achieve the above objectives, the present invention provides a chip transmission speed detection method, which involves a processing unit transmitting or receiving operation signals from an actuator through a universal asynchronous transceiver interface. The chip transmission speed detection method includes: activating the universal asynchronous transceiver interface of the processing unit to acquire the signal waveform of the operation signal within a preset time; detecting multiple bit transmission times of the signal waveform having three consecutive bit conversion waveforms; selecting multiple selection times with the smallest bit transmission times among the multiple bit transmission times and calculating the average time of the multiple selection times; and setting the processing unit to use the average time as the chip transmission speed for reading the operation signal.
[0007] Preferably, the multiple bit transmission times may include the low-level time detected during the process of the signal waveform transitioning from a high level to a low level and then back to a high level.
[0008] Preferably, the multiple bit transmission times may include the high-level time detected during the process of the signal waveform transitioning from a low level to a high level and then back to a low level.
[0009] Preferably, the chip transmission speed detection method can be executed when the processing unit is powered on to set the chip transmission speed.
[0010] Preferably, the chip transfer speed detection method may further include: after the processing unit has been operating for a fixed period of time, re-performing the chip transfer speed detection method to periodically update the chip transfer speed.
[0011] Preferably, the chip transfer speed detection method may further include re-performing the chip transfer speed detection method after the detection processing unit has reached a preset temperature to periodically update the chip transfer speed.
[0012] Preferably, the actuation device may include a temperature sensor, a humidity sensor, a distance sensor, and an orientation sensor.
[0013] This invention provides an electronic device comprising a processing unit and a universal asynchronous transceiver interface. The universal asynchronous transceiver interface is coupled to the processing unit and transmits or receives operation signals from an actuating device. The processing unit executes the chip transmission speed detection method described above. The actuating device may include a temperature sensor, a humidity sensor, a distance sensor, and a direction sensor.
[0014] As described above, the chip transmission speed detection method and electronic device of the present invention may have one or more of the following advantages:
[0015] (1) This chip transmission speed detection method and electronic device can be applied to various actuation devices connected to general asynchronous transceiver interfaces. Without changing the content of the operation signal, it can automatically detect the chip transmission speed, so that the processing unit can correctly read the operation signal, avoid abnormal signal reading, and improve the accuracy of chip operation.
[0016] (2) This chip transmission speed detection method and electronic device can automatically update the chip transmission speed, avoid signal reading errors caused by differences in chip transmission speed during operation, and improve the stability and reliability of the actuator operation.
[0017] (3) This chip transmission speed detection method and electronic device can adjust the acquisition time and select the number of chip processing times according to the device type or processing unit type, and is applicable to the operation of different actuators and chips, increasing the applicability of the chip transmission speed detection method. Attached Figure Description
[0018] To make the technical features, content, advantages, and effects of the present invention more apparent, the present invention will be described in conjunction with the following drawings:
[0019] Figure 1 This is a flowchart of a chip transmission speed detection method according to an embodiment of the present invention.
[0020] Figure 2 A flowchart illustrating the chip transmission speed setting in an embodiment of the present invention.
[0021] Figure 3 This is a schematic diagram of continuous bit conversion according to an embodiment of the present invention.
[0022] Figure 4 This is a waveform diagram illustrating the acquisition time according to an embodiment of the present invention.
[0023] Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present invention.
[0024] Figure Labels
[0025] S11~S15, S21~S27: Steps
[0026] H: High-level position
[0027] L: Low level
[0028] T: Preset time
[0029] t1~t15: Bit transfer time
[0030] t high High accuracy time
[0031] t lowLow-level time
[0032] W: Signal waveform
[0033] 10: Electronic devices
[0034] 11: Processing Unit
[0035] 12: General-purpose asynchronous transceiver interface
[0036] 21: Temperature sensor
[0037] 22: Humidity sensor
[0038] 23: Distance sensor
[0039] 24: Orientation Sensor Detailed Implementation
[0040] To facilitate understanding of the technical features, content, advantages, and effects of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and embodiments. The drawings used are for illustrative purposes only and to assist in the description. They may not represent the actual proportions and precise configurations of the present invention after implementation. Therefore, the proportions and configurations of the accompanying drawings should not be used to interpret or limit the scope of the present invention in actual implementation.
[0041] Please see Figure 1 , Figure 1 This is a flowchart of a chip transmission speed detection method according to an embodiment of the present invention. Figure 1 As shown, the chip transmission speed detection method includes the following steps (S11~S15):
[0042] Step S11: Configure the processing unit and connection device, and activate the universal asynchronous transceiver interface of the processing unit. Electronic devices include processing units, such as central processing units (CPUs) or microprocessor chips. These chips transmit signals to various actuators connected to the electronic device via the universal asynchronous transceiver interface, for example, receiving sensing signals detected by sensing devices or transmitting operation signals to various actuators. For instance, when temperature sensors, humidity sensors, distance sensors, and orientation sensors connected to the electronic device are powered on, the sensing signals are transmitted to the processing unit of the electronic device through the universal asynchronous transceiver interface. The chip processing speed setting during this transmission is crucial for the correct reading of various operation signals.
[0043] Step S12: Acquire the signal waveform of the operation signal within a preset time period. As described in the background art, the operation signal begins to be transmitted after the device is powered on, but the transmitted signal does not have a start bit for detecting data, making it impossible to determine the chip processing speed of the signal. Therefore, in order to automatically determine the chip processing speed, the signal waveform of the operation signal within a preset time period is first acquired, and the chip processing time of the operation signal is determined using this signal waveform within the preset time period.
[0044] Step S13: Detect multiple bit transmission times in the signal waveform that have three consecutive bit transition waveforms. After acquiring a signal waveform for a period of time, the processing unit determines whether there are three consecutive bit transition waveforms in the signal waveform, and defines the signal with three consecutive bit transition waveforms as one bit transmission time. In this embodiment, three consecutive bit transition waveforms can be the signal waveform changing from a high level to a low level and then back to a high level, and the low level time between two high levels is used as the bit transmission time. Similarly, three consecutive bit transition waveforms can also be the signal waveform changing from a low level to a high level and then back to a low level, and the high level time between two low levels is used as the bit transmission time. Since there are multiple high and low level switching within the preset time, multiple bit transmission times can be obtained.
[0045] Step S14: Select the smallest selection times among multiple bit transmission times and calculate the average time of the multiple selection times. After obtaining multiple bit transmission times, sort the multiple bit transmission times, select the smallest bit transmission times according to the sorting as selection times, and average them to obtain an average time. The reason for selecting the smallest bit transmission times for averaging instead of averaging all bit transmission times is mainly because the signal waveform of the operation signal does not produce high and low level changes for every bit. If the overall averaging is used, it may include the time of non-single bits, which may cause errors in the judgment process. Therefore, in this embodiment, the smallest number of bit transmission times among the obtained bit transmission times is selected for averaging. The number of selected times can be the minimum of 10 bit transmission times, but the present invention is not limited to this, and the number of selected times can be adjusted according to the length of the aforementioned obtained times.
[0046] Step S15: Set the processing unit to use the average time as the chip transmission speed for reading the operation signal. After the aforementioned waveform acquisition, bit conversion time judgment, and selection time averaging, an average time is obtained. After the processing unit obtains this average time, it sets this average time as the chip transmission speed for the operation signal. When the processing unit transmits or receives the operation signal through the general asynchronous transceiver interface, it reads the operation signal using this chip transmission speed.
[0047] In this embodiment, the chip transmission speed detection method only needs to acquire and analyze the waveform of a transmission signal after the actuator is powered on to obtain the chip transmission speed of the operation signal. It does not require setting different start or setting signals for the operation signal transmitted by the actuator, allowing electronic devices connected via a universal asynchronous transceiver interface to be compatible with various connected actuators, such as temperature sensors, humidity sensors, distance sensors, and orientation sensors, increasing device compatibility. Simultaneously, the chip transmission speed can be automatically set, reducing the setup process for setting the chip transmission speed while maintaining the accuracy of signal readings. This avoids operational anomalies caused by incorrect signal reading speeds, improving the stability of device operation.
[0048] Please see Figure 2 , Figure 2 A flowchart illustrating the chip transmission speed setting in an embodiment of the present invention. (See attached flowchart.) Figure 2 As shown, the chip transmission speed setting includes the following steps (S21~S27):
[0049] Step S21: Activate the Universal Asynchronous Transceiver Interface. When the electronic device receives power, the system powers the processing unit and activates the Universal Asynchronous Transceiver Interface. The Universal Asynchronous Transceiver Interface is connected to the sensing device via transmit and receive pins. The signals detected by the sensing device are transmitted to the processing unit.
[0050] Step S22: Confirm whether a transmission signal has been received. If yes, proceed to step S23. If no, re-detect whether a transmission signal from the sensing device has been received.
[0051] Step S23: Acquire a signal waveform over a period of time. After receiving the transmission signal from the sensing device, the processing unit acquires a signal waveform over a preset period of time from the transmission signal, and analyzes the signal waveform over the preset period to determine the chip transmission speed. The chip transmission speed detection method can be based on the aforementioned embodiment, detecting multiple bit transmission times with three consecutive bit transition waveforms in the signal waveform, selecting the minimum multiple bit transmission times, and averaging the selected times as the chip transmission speed.
[0052] Step S24: Set the chip transfer speed. Once the chip transfer speed is determined, the calculated average time is set as the chip transfer speed of the processing unit, so that the processing unit processes the signal according to the set chip transfer speed when reading the transmission signal.
[0053] Step S25: Receive transmission signal. After setting the chip transmission speed, the processing unit continuously transmits or receives transmission signals from the connected device through the general asynchronous transceiver interface, such as receiving sensing signals from a sensing device, and parses the sensing signal content using the appropriate chip processing speed.
[0054] Step S26: Confirm whether the chip transmission speed is automatically updated. If yes, proceed to step S27; otherwise, return to step S25 and continue receiving transmission signals.
[0055] Step S27: Set the automatic update time. During the operation of the electronic device, the chip transmission speed may vary due to various factors, such as different temperatures. Therefore, a mechanism for automatically updating the chip transmission speed can be set during the operation of the electronic device. In this embodiment, the processing unit is set to automatically update after a fixed period of operation. That is, after each time the chip transmission speed is set, a fixed period of time is elapsed, and the process returns to step S22 to repeat the detection and setting process, automatically updating to the latest chip transmission speed. In another embodiment, the processing unit can also update based on temperature changes. For example, the operating temperature of the processing unit is sensed, and when the temperature rises or falls to a preset temperature, the process returns to step S22 to repeat the detection and setting process, updating to the latest chip transmission speed.
[0056] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating continuous bit conversion according to an embodiment of the present invention. Figure 3 As shown in section (a), during the process of the signal waveform changing from a high level H to a low level L and then back to a high level H, the low-level time t detected between the two high-level H waveforms is... low It can be used as a bit transmission time. Conversely, in Figure 3 As shown in section (b), during the process of the signal waveform changing from a low level L to a high level H and then back to a low level L, the high-level time t detected between the two low-level L waveforms is... high This can be used as a bit transmission time. Based on the above judgment method, when a signal waveform over a period of time is obtained, the bit transmission time can be determined according to the high and low level changes of the signal waveform. This serves as the basis for calculating the chip's transmission speed. The actual waveform and the obtained content are shown in the following embodiment.
[0057] Please see Figure 4 , Figure 4 This is a waveform diagram illustrating the acquisition time according to an embodiment of the present invention. Figure 4 As shown, after the processing unit is powered on, the general asynchronous transceiver interface begins transmitting the operation signals of the connected device. First, it acquires the signal waveform W for a preset time T. This preset time T can be adjusted according to the type of connected device or the type of processing unit. Within the preset time T, it is determined that the signal waveform W has a transmission time of 15 bits (t1~t15) for three consecutive bit conversion waveforms.
[0058] Of the 15 bit transfer times obtained, including high-level and low-level bit transfer times, to obtain accurate bit transfer processing times, the first 11 smallest bit transfer times (t2, t3, t5, t6, t7, t9, t10, t11, t12, t14, t15) are selected and averaged, with an average time of 8.61 μs used as the chip transfer speed. In this embodiment, selecting the first 11 smallest bit transfer times and excluding 4 bit transfer times (t1, t4, t8, t13) can eliminate waveforms in the signal waveform W that exceed a single bit processing time, avoiding obtaining incorrect bit processing times and causing errors in the calculated chip transfer speed. In other embodiments, the preset time T and the number of selected bit transfer times can be changed according to the device type or processing unit type.
[0059] Please see Figure 5 , Figure 5 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 5 As shown, the electronic device 10 includes a processing unit 11 and a universal asynchronous transceiver interface 12. The electronic device 10 can be a computer device or a machine tool, where the processing unit 11 is a central processing unit or microprocessor chip within the electronic device 10, and the universal asynchronous transceiver interface 12 is coupled to the processing unit 11. The universal asynchronous transceiver interface 12 can be connected to an actuator to transmit or receive operating signals from the actuator, for example, by connecting to a temperature sensor 21, a humidity sensor 22, a distance sensor 23, and a direction sensor 24 to receive sensing signals from each sensor. When a sensing signal from a sensor is received, the processing unit 11 can execute the chip transfer speed detection method described in the above embodiments, allowing the electronic device 10 to correctly read the operating signals of the actuator. For the methods of executing the chip transfer speed detection method and setting the chip transfer speed, please refer to the foregoing embodiments; the same content will not be repeated here.
[0060] The above description is merely illustrative and not restrictive. Any equivalent modifications or alterations made without departing from the spirit and scope of this invention should be included within the scope of the appended claims.
Claims
1. A method for detecting chip transmission speed, characterized in that, The chip transmission speed detection method comprises: a processing unit transmitting or receiving an operation signal from an actuator via a general asynchronous transceiver interface; and the chip transmission speed detection method includes: The general asynchronous transceiver interface of the processing unit is activated to acquire a signal waveform of the operation signal within a preset time period; The transmission time of multiple bits in the signal waveform that has three consecutive bit transition waveforms is detected; Select the minimum selection times among the plurality of bit transmission times, and calculate an average time for the plurality of selection times; as well as The processing unit is configured to use the average time as the chip transmission speed for reading the operation signal.
2. The chip transmission speed detection method as described in claim 1, characterized in that, The multiple bit transmission times include the low-level time detected during the process of the signal waveform changing from a high level to a low level and then back to a high level.
3. The chip transmission speed detection method as described in claim 1, characterized in that, The multiple bit transmission times include the high-level time detected during the process of the signal waveform changing from a low level to a high level and then back to a low level.
4. The chip transmission speed detection method as described in claim 1, characterized in that, The chip transmission speed detection method is executed when the processing unit is powered on to set the chip transmission speed.
5. The chip transmission speed detection method as described in claim 1, characterized in that, Further includes: After the processing unit has been operating for a fixed period of time, the chip transmission speed detection method is repeated to periodically update the chip transmission speed.
6. The chip transmission speed detection method as described in claim 1, characterized in that, Further includes: Once the processing unit is detected to have reached a preset temperature, the chip transfer speed detection method is repeated to periodically update the chip transfer speed.
7. The chip transmission speed detection method as described in claim 1, characterized in that, The actuation device includes a temperature sensor, a humidity sensor, a distance sensor, and a direction sensor.
8. An electronic device, characterized in that, Include: One processing unit; A general asynchronous transceiver interface is coupled to the processing unit. The general asynchronous transceiver interface transmits or receives an operation signal from an actuating device, and the processing unit executes the chip transmission speed detection method as described in any one of claims 1 to 5.
9. The electronic device as claimed in claim 8, characterized in that, The actuation device includes a temperature sensor, a humidity sensor, a distance sensor, and a direction sensor.
Citation Information
Patent Citations
Substrate conveying method and device
CN101964317A
Electronic apparatus
CN103150283A