Electronic device

The hardware-implemented sensor scanning module solves the hardware performance and power consumption problems of traditional mice at high report rates, achieving efficient and stable data acquisition and motion wake-up functions, thus improving the user experience.

CN224304152UActive Publication Date: 2026-05-29BEIJING ONMICRO ELECTRONICS CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
BEIJING ONMICRO ELECTRONICS CO LTD
Filing Date
2025-05-22
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Traditional mice face challenges in achieving high report rates, including high hardware performance requirements, increased power consumption, and the inability to support wake-up from deep sleep, making it difficult to meet the needs of high-end users.

Method used

The hardware-implemented sensor scanning module enables real-time data acquisition and processing by communicating directly with the sensor, reducing CPU involvement, supporting high reporting rates, and optimizing power consumption.

Benefits of technology

It achieves efficient, stable, and low-power sensor data acquisition, supports high report rates, improves user experience, and extends mouse battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224304152U_ABST
    Figure CN224304152U_ABST
Patent Text Reader

Abstract

The present disclosure provides an electronic device. An electronic device, comprising: a central processing unit (CPU) connected to a second bus in the electronic device; a sensor scanning module connected to a first sensor and a first bus in the electronic device, and configured to receive configuration information from the CPU through the first bus, collect data of the first sensor based on the configuration information, and transmit the collected data to a memory of the electronic device through the second bus; wherein the second bus is directly connected to the CPU and the memory, and the first bus is connected to the CPU and the memory through the second bus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of electronic technology, and more particularly to an electronic device. Background Technology

[0002] With the rapid development of esports and high-end gaming, users' demands for mouse performance are increasing. Traditional mouse report rates are typically below 1kHz, meaning the mouse reports its position and status to the computer a maximum of 1000 times per second. However, with the increase in game screen refresh rates and players' growing demands for operational precision, a 1kHz report rate is gradually becoming insufficient for high-end users. In recent years, the market demand for high report rate mice, such as 4kHz and 8kHz mice, has been growing. A high report rate means the mouse needs to report its position and status to the computer more frequently, thus providing a smoother and more precise control experience. However, achieving a high report rate mouse is not easy, mainly facing the following two challenges: 1) High hardware performance requirements: A high report rate requires higher data processing capabilities and faster transmission speeds, which places higher demands on the mouse's CPU clock speed; 2) Increased power consumption: A high report rate means the mouse needs to perform data acquisition and transmission more frequently, which leads to increased power consumption and affects battery life.

[0003] In conclusion, the market demand for high-report-rate mice is increasingly urgent, but achieving high-report-rate mice still faces many technical challenges. Therefore, developing a mouse that can solve the aforementioned problems in achieving high report rates while ensuring high performance has significant market value and application prospects. Utility Model Content

[0004] Embodiments of this disclosure provide an electronic device, including: a central processing unit (CPU) connected to a second bus in the electronic device; and a sensor scanning module connected to a first sensor and the first bus in the electronic device, configured to receive configuration information from the CPU via the first bus, acquire data from the first sensor based on the configuration information, and transmit the acquired data to a memory of the electronic device via the second bus; wherein the second bus is directly connected to the CPU and the memory, and the first bus is connected to the CPU and the memory via the second bus.

[0005] In some embodiments, the sensor scanning module includes a communication fault detection and recovery module, which is configured to: when the first sensor is connected to the sensor scanning module via a 2-wire serial peripheral interface (SPI), detect whether a preset first sensor ID value corresponding to the first sensor and a second sensor ID value read from the sensor ID register address are consistent; and when the first sensor ID value and the second sensor ID value are inconsistent, reset the first sensor state machine.

[0006] In some embodiments, resetting the first sensor state machine includes sending a pulse signal with a first length to the first sensor, wherein the first length is configured via a resynchronization register.

[0007] In some embodiments, the sensor scanning module is further configured to: set the status bit related to communication failure in the interrupt status register and wake up the CPU when the first sensor ID value and the second sensor ID value are inconsistent.

[0008] In some embodiments, the sensor scanning module further includes a sensor configuration module, wherein the first sensor ID value and the sensor ID register address are configured through registers in the sensor configuration module.

[0009] In some embodiments, the first sensor does not have an interrupt request pin connected to the electronic device, wherein the configuration information includes a scan frequency, and wherein the sensor scanning module is configured to periodically perform a scanning operation on the first sensor based on the scan frequency, wherein the scanning operation includes: periodically waking up at the scan frequency to read a status value in the status register of the first sensor; continuing to enter a sleep state if the status value indicates that the first sensor has no valid data; and reading the value of one or more data registers of the first sensor as the acquired data of the first sensor if the status value indicates that the first sensor has valid data.

[0010] In some embodiments, the sensor scanning module is further configured to: set the status bit in the interrupt status register related to the detected valid data and wake up the CPU when the status value indicates that the first sensor has valid data.

[0011] In some embodiments, the sensor scanning module includes a working mode configuration module, which is configured to configure the working modes of the sensor scanning module, wherein the working modes include: a sensor configuration mode, a single scan mode for sensors having an interrupt request pin connected to the electronic device, and a continuous scan mode for sensors not having an interrupt request pin connected to the electronic device.

[0012] In some embodiments, the first sensor is a sensor for sensing mouse movement data, wherein the movement data includes the mouse's X-axis coordinate data and Y-axis coordinate data.

[0013] In some embodiments, the sensor scanning module is a hardware module implemented using digital circuitry.

[0014] This disclosure provides a processing method for an electronic device, wherein the electronic device includes a central processing unit (CPU) and a sensor scanning module. The method includes: the sensor scanning module receiving configuration information from the CPU via a first bus in the electronic device; the sensor scanning module acquiring data from a first sensor connected to the sensor scanning module based on the configuration information; and the sensor scanning module transmitting the acquired data to a memory of the electronic device via a second bus. The second bus is directly connected to the CPU and the memory, and the first bus is connected to the CPU and the memory via the second bus.

[0015] Embodiments of this disclosure provide a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor, can be used to implement any method for designing and / or processing an electronic device according to embodiments of this disclosure.

[0016] This disclosure presents an electronic device and a method for processing the electronic device. This electronic device and method can be used in the design and / or processing of a mouse microcontroller unit (MCU), overcoming the limitations of traditional software-based general-purpose input / output (GPIO) analog timing methods in high report rate scenarios, and providing an efficient, stable, and low-power solution for implementing high report rate mice. Attached Figure Description

[0017] The accompanying drawings are not necessarily drawn to scale. In all the drawings, for illustrative purposes, elements with similar structures or functions are often indicated by the same reference numerals or portions thereof. The drawings are merely for the purpose of facilitating the description of the various embodiments described herein. The drawings do not describe every aspect of the teachings disclosed herein and do not limit the scope of the claims. To prevent obscurity, not all components, connections, etc., are shown, and not all components have reference numerals. However, the pattern of component configuration can be readily discerned from the drawings. The drawings, together with the specification, illustrate exemplary embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure. The above and other aspects, features, and advantages of certain embodiments of the present disclosure will become more apparent from the following description taken in conjunction with the accompanying drawings, wherein:

[0018] Figure 1 A schematic diagram of an electronic device according to an embodiment of the present disclosure is shown;

[0019] Figure 2 An example structure of a sensor scanning module according to an embodiment of this disclosure is shown; and

[0020] Figure 3 A schematic flowchart of a processing method for an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0021] Before proceeding with the detailed description below, it may be advantageous to define certain words and phrases used throughout this patent document. The terms “coupled,” “connected,” and their derivatives refer to any direct or indirect communication or connection between two or more elements, regardless of whether those elements are physically in contact with each other. The terms “transmit,” “receive,” and “communicate,” and their derivatives cover both direct and indirect communication. The terms “comprising” and “including,” and their derivatives refer to, but are not limited to, those including, those including, those including, those including. The term “or” is inclusive, meaning and / or. The phrases “associated with,” “corresponding to,” and their derivatives refer to, including, being contained within, interconnected, containing, being included in, connected or connected to, coupled or coupled to, communicating with, cooperating, intertwined, juxtaposed, proximate, bound or bound to, having, having attributes, having a relationship or being related to, etc. The term “controller” refers to any device, system, or part thereof that controls at least one operation. Such a controller may be implemented in hardware, or a combination of hardware and software and / or firmware. The functionality associated with any particular controller may be centralized or distributed, local or remote. The phrase "at least one" when used with a list of items means that different combinations of one or more of the listed items may be used, and that only one item from the list may be required. For example, "at least one of A, B, and C" includes any of the following combinations: A, B, C, A and B, A and C, B and C, A and B and C.

[0022] Definitions of other specific words and phrases are provided throughout this patent document. Those skilled in the art will understand that, in many, if not most, cases, such definitions apply to the prior and future use of the words and phrases thus defined.

[0023] In this patent document, the application combination of modules and the hierarchical division of submodules are for illustrative purposes only. Without departing from the scope of this disclosure, the application combination of modules and the hierarchical division of submodules can be implemented in different ways. The embodiments of this disclosure can be implemented in different forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided to make this disclosure thorough and complete, and to fully convey exemplary implementation methods to those skilled in the art. The embodiments of this disclosure can be combined in any way to form other embodiments.

[0024] In the following description, embodiments of this disclosure will be exemplarily described using a mouse MCU as an example.

[0025] When implementing sensor scanning, mouse chips typically use software to simulate timing via GPIO. Some specific implementation examples are shown below.

[0026] The mouse sensor is responsible for sensing or acquiring mouse movement data, such as position, coordinates, and displacement. The sensor typically interacts with the host MCU via the Serial Peripheral Interface (SPI) communication protocol. To reduce cost and simplify design, most mouse sensors use a custom 2-wire SPI (CLK / DATA), a few use 3-wire SPI (CSN / CLK / DATA) or 4-wire SPI (CSN / CLK / MOSI / MISO), and an interrupt request (IRQ) pin. However, most mouse host MCUs only have a standard 4-wire SPI, a few have 3-wire SPI, and almost none have a custom 2-wire SPI that can directly scan the mouse sensor. Therefore, in most cases, the mouse host MCU uses GPIO to simulate SPI timing to implement sensor scanning and / or data reading operations.

[0027] As mentioned above, CSN (Chip Select Negative) is the chip select line for 3-wire or 4-wire SPI, CLK is the clock line for SPI, MISO (Master In Slave Out) is the master-slave output line for 4-wire SPI, MOSI (Master Out Slave In) is the master-slave input line for 4-wire SPI, and DATA is the data line for 2-wire or 3-wire SPI. For 2-wire or 3-wire SPI, read and write operations share the data line. Generally, at the start of each operation, the data line (DATA) is in output mode. The first bit of the operation is a control bit, such as controlling whether to read or write, and the next 7 bits are the address. In the case of a write operation, the data to be written is transmitted on the data line. In the case of a read operation, the data line needs to be switched to input mode, and the data to be read is transmitted on the data line.

[0028] Furthermore, most mid-to-low-end mice use single-sided printed circuit boards (PCBs) to reduce costs, thus omitting the IRQ pin. Only a few high-end mice use a double-sided design, with an IRQ pin on the MCU to connect to the sensor's IRQ pin.

[0029] For high-end mice with IRQ pins, a signal is generated on the IRQ pin when the mouse moves to notify the main MCU. The main MCU wakes up from sleep mode and then reads the coordinate data via SPI. This method of waking up the main MCU by mouse movement is called motion wake-up.

[0030] For low- to mid-range mice without IRQ pins, the MCU needs to actively wake up periodically to read the sensor status, which leads to high power consumption. To balance power consumption and user experience, mice without IRQs typically do not support wake-up by movement in deeper sleep states; they only support wake-up by buttons and scroll wheel.

[0031] For example, let's take a wireless mouse with a 125Hz report rate as an example to illustrate sleep and wake-up modes. In this example, when the mouse moves, the main control MCU scans the sensor every 8ms and transmits the data via radio frequency. This state is called the active state. That is, in the active state, the main control MCU scans the sensor every 8ms and transmits and receives data via radio frequency every 8ms.

[0032] If no data is detected within a certain period (e.g., 1 minute) after the mouse's last movement, the mouse can enter a Level 1 sleep state. The scanning frequency remains the same, but the RF transceiver frequency decreases, for example, performing an RF transceiver every 100ms to maintain the connection. That is, in Level 1 sleep state, the main control MCU scans the sensor every 8ms and transmits data via RF every 100ms. Level 1 sleep state can last for a period of time, such as 9 minutes. If data is detected during the duration of Level 1 sleep state, the main control MCU switches to active state. If no data is detected during the duration of Level 1 sleep state, the mouse can enter a Level 2 sleep state. In this state, the RF transceiver frequency becomes even lower, for example, performing an RF transceiver every 500ms to maintain the connection. At this time, to save power, the MCU will not wake up to scan or read the sensor. Therefore, in Level 2 sleep state, wake-up via movement is not supported; wake-up can only be achieved through other methods such as mouse buttons and scroll wheel.

[0033] In some embodiments, the main control MCU simulates SPI timing through GPIO pins; the software simulates the timing of the SPI communication protocol by controlling the high and low level changes of the GPIO pins, thereby interacting with the sensor; the sensor transmits the collected motion data to the MCU through GPIO, and the MCU then processes the data.

[0034] This approach may have the following drawbacks:

[0035] Simulating timings using GPIO consumes a significant amount of CPU resources, leading to reduced system efficiency.

[0036] Due to the rate limitation of GPIO, the real-time performance and accuracy of sensor data reading are limited, making it difficult to meet the requirements of high reporting rates (such as 4KHz / 8KHz);

[0037] The timing of software simulations may be unstable, leading to data transmission errors or frame loss.

[0038] For low- to mid-range mice without IRQ pins, motion wake-up from deep sleep (e.g., the second-level sleep state as described above) is not supported.

[0039] In other words, the mouse MCU uses GPIO to simulate timing to implement sensor scanning. While this can meet the needs of mice with low report rates (e.g., below 1kHz), the following problems may still exist:

[0040] Insufficient real-time performance: The GPIO simulation timing method introduces latency, affecting the real-time performance of the mouse.

[0041] High resource consumption: Software timing simulation consumes a lot of CPU resources, affecting the overall system performance.

[0042] High power consumption: The CPU cannot sleep when GPIO simulates timings. Frequent CPU participation will increase power consumption and affect the mouse's battery life.

[0043] Insufficient accuracy and stability: The sampling frequency and timing stability of GPIO may not be guaranteed, leading to misjudgment of data or uneven sampling, which affects the user experience.

[0044] Low report rate: Unable to meet the mouse demand for high report rates.

[0045] Unable to support wake-up from motion: Mid-to-low-end mice without IRQ cannot support wake-up from deep sleep.

[0046] To address the aforementioned issues, this disclosure proposes a hardware-based device and method for scanning mouse sensors. The sensor scanning module, implemented in dedicated hardware, communicates directly with the sensor to achieve real-time acquisition and processing of sensor data, without requiring software or CPU intervention to directly participate in sensor data scanning.

[0047] The apparatus and method according to embodiments of this disclosure can achieve at least one or more of the following advantages:

[0048] Reduce CPU involvement: By scanning sensors with hardware, CPU involvement is significantly reduced, thus reducing system resource consumption.

[0049] Reduced clock speed and power consumption: Due to the high efficiency of the hardware modules, the main control MCU can run at a lower CPU clock speed, thereby reducing power consumption and extending the mouse's battery life.

[0050] Achieving a high report rate: The real-time performance and high efficiency of the hardware module enable the main control MCU to achieve a high report rate (such as 4KHz / 8KHz) at a very low clock frequency, meeting the performance needs of high-end users.

[0051] Enhancing User Experience: The asynchronous design of the hardware modules and uniform data sampling can effectively improve the linearity of the cursor and scroll wheel, reduce data loss and misjudgment, and significantly improve the user's operating experience.

[0052] Supports wake-up on movement: In deep sleep mode, only the hardware scanning module wakes up periodically to read the sensor status, and the CPU does not need to be woken up (the MCU usually accounts for a high proportion of mouse power consumption, while peripherals generally have very low power consumption), which enables mid-to-low-end mice to support wake-up on movement.

[0053] This disclosure presents a hardware-implemented mouse sensor scanning module that overcomes the limitations of traditional software-simulated timing methods, providing an efficient, stable, and low-power solution for mouse sensor scanning.

[0054] The following description, in conjunction with the accompanying drawings, will further illustrate an example of a mouse MCU architecture according to an embodiment of this disclosure.

[0055] Figure 1 A schematic diagram of an electronic device 100 according to an embodiment of the present disclosure is shown.

[0056] An example electronic device 100 of a mouse MCU architecture according to an embodiment of the present disclosure may include a central processing unit (CPU) 108, a memory 107, a sensor scanning module 102, a first bus 105, a second bus 106, etc.

[0057] In some embodiments, the second bus 106 can be directly connected to the CPU 108 and the memory 107, and the first bus 105 can be connected to the CPU 108 and the memory 107 through the second bus 106.

[0058] In some embodiments, the sensor scanning module 102 may be connected to a first sensor (not shown) and a first bus 105 in the electronic device 100. The sensor scanning module 102 may be configured to receive configuration information from, for example, a CPU 108 or software via the first bus 105, acquire data from the first sensor based on the configuration information, and directly transmit the acquired data to the memory 107 and / or CPU 108 of the electronic device 100 via a second bus 106.

[0059] In some embodiments, the first bus 105 may be an Advanced Peripheral Bus (APB) serving as a sub-bus of the system for connecting one or more peripheral devices, and the second bus 106 may be an Advanced High Performance Bus (AHB) serving as the backbone bus of the system and directly connected to the CPU and / or memory.

[0060] In some embodiments, the sensor scanning module 102 can be directly connected to the second bus 106. In some embodiments, another hardware-implemented data packetization module can also be provided between the sensor scanning module 102 and the second bus 106 to perform hardware packetization of the data collected by the sensor scanning module 102, generating data packets conforming to the protocol or format (e.g., Host Interface Device (HID) protocol, etc.) for communication with the CPU 108 and / or memory 107 on the second bus 106, thereby directly transmitting the collected data to the host (e.g., CPU 108 and / or memory 107, etc.) via the second bus 106. In some embodiments, the data packetization module can also be a sub-module within the sensor scanning module 102, which is not limited in this disclosure.

[0061] In some embodiments, the sensor scanning module 102 may be a hardware module implemented using digital circuitry.

[0062] In some embodiments, the hardware-implemented sensor scanning module 102 can be primarily used to efficiently acquire and process data from a sensor. This sensor may be, for example, a first sensor used to sense mouse movement data (e.g., position, coordinates (e.g., X-axis coordinate data and Y-axis coordinate data), displacement, etc.).

[0063] In some embodiments, to ensure the real-time performance, accuracy, and stability of sensor data, the sensor scanning module 102 may further include, for example, Figure 2 One or more of the submodules shown.

[0064] Specifically, Figure 2 An example structure of a sensor scanning module according to an embodiment of this disclosure is shown.

[0065] like Figure 2 As shown, the sensor scanning module 102 may include one or more of the following: a communication interface configuration module 201, a parameter configuration module 202, a sensor configuration module 203, a timing configuration module 204, an interrupt configuration module 205, a communication fault detection and recovery module 206, a low-power management module 207, a working mode configuration module 208, a timing module 209, and a data module 210. These modules can be interconnected to form a sensor scanning module 102 with multiple corresponding functions.

[0066] The communication interface configuration module 201 is responsible for physical connection and data communication with the sensor, including 2 / 3 / 4-wire SPI selection and IRQ pin configuration.

[0067] The parameter configuration module 202 can be used to configure some relevant parameters when the sensor scanning module 102 performs scanning.

[0068] The sensor configuration module 203 can be used to configure some register addresses and sensor IDs of the sensor to be scanned, according to the sensor's user manual.

[0069] The timing configuration module 204 can be used to configure the timing signals of the sensor scanning module according to the specific timing requirements of the sensor, so as to ensure the synchronization and real-time performance of data acquisition.

[0070] The interrupt configuration module 205 can be used to trigger an interrupt notification to the main control CPU when data acquisition is completed or an abnormality occurs.

[0071] The communication fault detection and recovery module 206 can be used to resynchronize after a 2-wire SPI detects a synchronization failure.

[0072] In some embodiments, when the first sensor is connected to the sensor scanning module 203 via a 2-wire SPI, the communication fault detection and recovery module 206 can be configured to detect whether the preset first sensor ID value corresponding to the first sensor and the second sensor ID value read from the sensor ID register address are consistent; and if the first sensor ID value and the second sensor ID value are inconsistent, to perform operations such as resetting or resynchronizing the first sensor state machine.

[0073] In some embodiments, resetting the first sensor state machine may include sending a CLK pulse signal of a first length to the first sensor. This first length can be configured via a resynchronization (RESYNC) register.

[0074] In some embodiments, the sensor scanning module 102 may also be configured to: set the status bit related to communication failure in the interrupt status register (ISR) and wake up the CPU when the first sensor ID value and the second sensor ID value are inconsistent.

[0075] In some embodiments, the first sensor ID value and the sensor ID register address can be configured through the corresponding registers in the sensor configuration module 203 as described above.

[0076] The low-power management module 207 can be used to manage the power consumption of the module, support sleep and wake-up functions, and optimize energy consumption.

[0077] The operating mode configuration module 208 can be used to set the operating mode of the sensor scanning module 102. In some embodiments, the operating mode of the sensor scanning module 102 may include one or more of the following: sensor configuration mode, single scan mode, continuous scan mode, etc. In some embodiments, the single scan mode may be used for sensors having an interrupt request (IRQ) pin connected to the electronic device 100 and / or the sensor scanning module 102. In some embodiments, the continuous scan mode may be used for sensors that do not have an interrupt request (IRQ) pin connected to the electronic device 100 and / or the sensor scanning module 102.

[0078] In some embodiments, the configuration information of the sensor scanning module 102 may include a scanning frequency. If the first sensor does not have an interrupt request (IRQ) pin connected to the electronic device 100 and / or the sensor scanning module 102, the sensor scanning module 102 may be configured to periodically wake up based on the configured scanning frequency to perform a scanning operation on the first sensor.

[0079] In some embodiments, the scanning operation may include: periodically waking up at a scanning frequency to read the status value in the status register of the first sensor; continuing to enter a sleep state if the status value indicates that the first sensor has no valid data; and reading the value of one or more data registers of the first sensor as the acquired data of the first sensor if the status value indicates that the first sensor has valid data.

[0080] In some embodiments, the sensor scanning module 102 may also be configured to set the status bit in the interrupt status register (ISR) associated with the detected valid data and wake up the CPU when the status value indicates that the first sensor has valid data.

[0081] The timing module 209 can be used to generate the time interval for periodic scanning in continuous scanning mode or when performing continuous scanning.

[0082] Data module 210 can be used to store the collected coordinate data.

[0083] The parameters or settings that need to be configured for the sensor scanning module 102 as described above can be obtained from software (e.g., CPU and / or memory, etc.) via the first bus 105, or they can be determined and pre-configured based on the specifications, user manuals, specific timing requirements, etc. of the corresponding peripheral devices such as sensors. This document does not impose any restrictions on these parameters.

[0084] The sensor scanning module 102 of this disclosure will be described again below with reference to specific embodiments.

[0085] As described above, the sensor scanning module 102 according to the embodiments of this disclosure may include one or more of the following: a communication interface configuration module 201, a parameter configuration module 202, a sensor configuration module 203, a timing configuration module 204, an interrupt configuration module 205, a communication fault detection and recovery module 206, a low power management module 207, a working mode configuration module 208, a timing module 209, and a data module 210.

[0086] The communication interface configuration module 201 is responsible for physical connection and data communication with the sensor, including SPI data line selection and IRQ pin configuration.

[0087] The sensor configuration module 203 can be used to configure the addresses and / or data of some sensors to be scanned that the sensor scanning module 102 needs to use in scanning modes (e.g., single scan mode and continuous scan mode). For example, these addresses and / or data may include one or more of the following: sensor ID register address, sensor ID value, sensor status register address, sensor X-axis coordinate low-order data register address, sensor X-axis coordinate high-order data register address, sensor Y-axis coordinate low-order data register address, sensor Y-axis coordinate high-order data register address, etc.

[0088] The parameter configuration module 202 can be used to configure parameters such as scanning frequency, scanning mode, sensor coordinate data format, and sensor coordinate high-order data format (only applicable to coordinate data formats greater than 8 bits, such as 12-bit and 16-bit). The high-order data format refers to the arrangement of the high-order and low-order bytes when storing multi-byte data in memory. For example, in some embodiments, the high-order data format may include big-endian, little-endian, etc. The parameter configuration module 202 operates in sensor configuration mode and is mainly used to initialize or set some sensor parameters.

[0089] The timing configuration module 204 configures the TNS and TR registers to meet the specific timing requirements of different sensors for SPI. This includes the time from the chip select line CSN being pulled low to the generation of the first bit of the clock signal, and the time from sending the address to reading the data. The TR register is used for timing configuration of the DATA direction switching in 2-wire or 3-wire SPI. The TNS register is used for timing configuration of the period from when the SPI CSN is active until the clock signal is generated.

[0090] The communication fault detection and recovery module 206 is primarily designed for sensors with a 2-wire SPI interface. Because 2-wire SPI lacks a CSN signal, clock interference can cause the sensor state machine to fail to recover, leading to subsequent communication errors. In one example, the communication fault detection method may include: before reading data, reading the sensor ID value from the sensor ID register address configured by the sensor configuration module 203, and comparing the read sensor ID value with the sensor ID value preset by the sensor configuration module 203 corresponding to the first sensor. If the two ID values ​​are inconsistent, a communication fault is considered to have occurred. When a communication fault occurs, the sensor state machine can be reset by applying a long pulse to the clock signal CLK. The pulse length varies depending on the sensor, and is configured through the RESYNC register, thereby enabling the 2-wire SPI to restore communication after a communication fault.

[0091] The interrupt configuration module 205 can be used to enable or disable one or more interrupt modes, such as scan completion interrupt (an interrupt generated when a scan is completed in single-scan mode), valid data scan interrupt (e.g., an interrupt generated when valid data is scanned in continuous scan mode), communication failure interrupt (an interrupt generated when the ID values ​​of the two sensors are inconsistent, as described above in the case of a 2-wire SPI sensor), and resynchronization completion interrupt (an interrupt generated after recovery is completed following a communication failure). One or more of the above interrupt modes can be enabled according to actual needs. For example, communication failure interrupt and resynchronization completion interrupt can be configured when the first sensor is a 2-wire SPI sensor, while they can be left unconfigured when the first sensor is a 3-wire or 4-wire SPI sensor.

[0092] The low-power management module 207 can generally be used in conjunction with the interrupt configuration module 205. For example, when the sensor scanning module 102 is scanning the sensor, the CPU can be set to sleep mode, and the CPU will only be woken up when the corresponding enabled interrupt occurs, thereby reducing the CPU's involvement in sensor scanning and saving power.

[0093] The working mode configuration module 208 can configure the sensor scanning module 102 to work in one or more of the following modes: sensor configuration mode, single scan mode, continuous scan mode, etc.

[0094] When the sensor is connected to the electronic device 100 and / or the sensor scanning module 102 via an IRQ pin, when the mouse moves, the sensor can instruct the sensor scanning module 102 to read the data after generating data via IRQ. After reading the data, the sensor scanning module 102 can generate a scan completion interrupt and wake up the MCU. This scanning mode can be called single scan mode.

[0095] When the sensor and electronic device 100 and / or sensor scanning module 102 are not connected to an IRQ pin, the sensor scanning module 102 can periodically wake up and read the status value of the corresponding data status bit in the sensor status register address configured by the sensor configuration module 203 according to the configured scanning frequency, and determine the corresponding status. When the mouse is not moving, the data status bit of the sensor status register may not be set, for example, indicating that the sensor has no valid data. In this case, the sensor scanning module 102 can continue to enter the sleep state. When the mouse moves, the data status bit of the sensor status register can be set, for example, indicating that the sensor has valid data. In this case, the sensor scanning module 102 will continue to read data from one or more data registers of the sensor (e.g., sensor X-axis coordinate low-order data register address, sensor X-axis coordinate high-order data register address, sensor Y-axis coordinate low-order data register address, sensor Y-axis coordinate high-order data register address, etc.), generate a valid data scanning interrupt after reading data, and wake up the MCU. This scanning mode can be called continuous scanning mode.

[0096] The timing module 209 can be used for timing in continuous scan mode or during continuous scanning. For example, it can be used to generate periodic time intervals (e.g., corresponding to a configured scan frequency) to periodically wake up the sensor scanning module 102 to perform sensor scanning operations according to a specific sequence. For example, for a 2-wire SPI sensor, the specific sequence could be reading the sensor ID -> reading the sensor's status register -> reading the sensor's data; for a 3-wire or 4-wire SPI sensor, the specific sequence could be reading the sensor's status register -> reading the sensor's data.

[0097] When the mouse moves and generates valid data, the sensor scanning module 102 can store the scanned data in the data module 210 and further read it through software (e.g., CPU).

[0098] In some embodiments, the above-mentioned modules or functions of the sensor scanning module 102 can be implemented by one or more registers and related circuits as shown in Table 1 below.

[0099] [Table 1]

[0100]

[0101]

[0102] The following describes some example operating modes of the sensor scanning module 102 according to embodiments of the present disclosure.

[0103] The operating mode of the sensor scanning module 102 may include a sensor configuration mode.

[0104] The sensor configuration mode is mainly used to configure some parameters of the sensor during initialization, such as DPI / CPI (optical resolution), frame rate (the speed at which data is generated when the mouse moves), data bit depth (e.g., 8 bits / 12 bits / 16 bits), and board angle (the angle at which the sensor is placed on the mouse board affects the generation of X and Y data).

[0105] Before using the sensor scanning module 102, the sensor and / or sensor scanning module 102 need to be initialized according to the selected sensor specifications.

[0106] During initialization, the WORK_MODE register can be configured to sensor configuration mode.

[0107] The configuration (CONFIG) registers can be set according to the sensor's datasheet or device manual to configure 2-wire / 3-wire / 4-wire SPI and IRQ pins, sensor coordinate data format, scan enable, wake-up enable, etc. Simultaneously, the TR and TNS registers can be set to configure the SPI timing.

[0108] For sensors with a 2-wire SPI interface, the RESYNC register needs to be configured, and the resynchronization enable in CFG_CSR can be configured first to initiate a resynchronization to reset the sensor's state machine.

[0109] The sensor can be configured by manipulating the CFG_ADDR and CFG_DATA registers, enabling a series of customized sensor initialization processes such as sensor reset, calibration, and parameter configuration.

[0110] During register write operations, the register address of the sensor to be written can be configured in CFG_ADDR, the register data to be operated can be configured in CFG_DATA, the data direction in CFG_CSR can be configured as output, and the write enable in CFG_CSR can be started. As a result, the sensor scanning module 102 will start a transmission and write the data to the register address corresponding to the sensor.

[0111] During register read operations, the register address of the sensor to be read can be configured in CFG_ADDR, the data direction in CFG_CSR can be configured as input, and the read enable in CFG_CSR can be activated. As a result, the sensor scanning module 102 will initiate a transmission to read the data in the register address corresponding to the sensor into CFG_DATA.

[0112] For 2-wire SPI sensors, the sensor ID register address and sensor ID value need to be configured in ID_ADDR and ID_VALUE respectively according to the sensor datasheet or device manual for communication fault detection in scan mode.

[0113] For sensors without an IRQ pin, the FREQ register needs to be configured according to the mouse's report rate and the sensor's frame rate (for example, if the mouse's report rate is 125, then the FREQ register needs to be configured to 125, and the sensor's frame rate also needs to be configured to generate data once every 8ms during movement).

[0114] For sensors without IRQ pins, the sensor's status register address needs to be configured in STATUS_ADDR according to the sensor datasheet or device manual, which is used to detect the sensor's data status during continuous scanning.

[0115] For sensors with 8-bit data format, the register addresses for the sensor's X and Y axis coordinate data must be configured in XL_DATA_ADDR and YL_DATA_ADDR according to the sensor datasheet or device manual. For sensors with 12-bit and 16-bit data lengths, the register addresses for the higher-order bits of the sensor's X and Y axis coordinate data must also be configured in XH_DATA_ADDR and YH_DATA_ADDR according to the sensor datasheet or device manual, so that coordinate data can be read from the corresponding addresses during scan mode.

[0116] This allows enabling interrupts such as scan completion interrupt and / or valid data scan interrupt in the interrupt enable register (IER). For 2-wire SPI sensors, it is also necessary to enable communication failure interrupt and resynchronization end interrupt.

[0117] Afterwards, the working mode can be configured to the corresponding scanning mode through the working mode register WORK_MODE, and the scanning enable in the CONFIG register can be enabled. Then, the sensor scanning module 102 will start scanning according to the corresponding scanning mode.

[0118] Scanning modes can include single scan modes.

[0119] The single-scan mode is mainly for the case where the sensor scanning module 102 is connected to a sensor with an IRQ pin.

[0120] In this mode, when the mouse is not moving, the MCU, sensor scanning module 102, and sensor can all be in sleep mode, thereby reducing power consumption.

[0121] When the mouse starts to move, the sensor can generate coordinate data at a frame rate preset in the sensor configuration mode and wake up the sensor scanning module 102 via the IRQ pin.

[0122] For a sensor with a 2-wire SPI interface, the sensor scanning module 102 can initiate a read operation, read the ID value in the ID_ADDR register and compare it with the ID value preset in ID_VALUE. If the two are the same, subsequent data reading and other operations can continue.

[0123] In the coordinate data reading operation, for 8-bit format sensors, the sensor scanning module 102 can directly initiate two read operations using the values ​​in XL_DATA_ADDR and YL_DATA_ADDR as register addresses, storing the read data in the lower 8 bits of X_DATA and Y_DATA. For 12-bit and 16-bit sensors, the sensor scanning module 102 also needs to initiate two read operations using the values ​​in XH_DATA_ADDR and YH_DATA_ADDR as register addresses, storing the read data in the higher bits of X_DATA and Y_DATA.

[0124] Then, the sensor scanning module 102 can set the status bits in the ISR related to scan completion (e.g., scan completion interruption) and wake up the CPU. The CPU can determine whether the scan is complete by the corresponding status bits, and thus can read the data of X_DATA and Y_DATA.

[0125] The CPU can also send the read data out via USB or radio frequency, and then continue to enter sleep mode to wait for a new wake-up signal.

[0126] Scanning modes can also include continuous scan modes.

[0127] The continuous scan mode is mainly for sensors that do not have an IRQ pin when the sensor scan module is connected to the 102 sensor.

[0128] In this mode, both the MCU and the sensor can be in sleep mode when the mouse is not moving, thereby reducing power consumption.

[0129] The sensor scanning module 102 can be woken up periodically according to the frequency in FREQ to perform scanning operations. For example, for a 2-wire SPI sensor, the scanning operation may include reading the sensor ID -> reading the sensor's status register -> reading the sensor's data; for a 3-wire or 4-wire SPI sensor, the scanning operation may include reading the sensor's status register -> reading the sensor's data.

[0130] In some embodiments, for a sensor with a 2-wire SPI interface, the communication fault detection operation described above can be performed before performing the scanning operations of reading the sensor's status register and reading the sensor's data.

[0131] During the scanning operation, the sensor scanning module 102 can initiate a read operation to read the status value in STATUS_ADDR and determine the status of the valid data bit in the status value. When the mouse is not moving, the valid data bit can be 0 (for example, indicating that the sensor currently has no (new) valid data, etc.), so the sensor scanning module 102 can continue to enter sleep mode and wait for the next wake-up opportunity to wake up again.

[0132] When the mouse moves, the valid bit of the above data can be 1, and the sensor scanning module 102 can continue to perform subsequent data scanning operations.

[0133] For example, for a sensor with a 2-wire SPI interface, the sensor scanning module 102 can initiate a read operation to read the ID value in the ID_ADDR register and the ID value preset in ID_VALUE. If the two are the same, subsequent data reading and other operations can continue.

[0134] In the coordinate data reading operation, for 8-bit format sensors, the sensor scanning module 102 can directly initiate two read operations using the values ​​in XL_DATA_ADDR and YL_DATA_ADDR as register addresses, storing the read data in the lower 8 bits of X_DATA and Y_DATA. For 12-bit and 16-bit sensors, the sensor scanning module 102 also needs to initiate two read operations using the values ​​in XH_DATA_ADDR and YH_DATA_ADDR as register addresses, storing the read data in the higher bits of X_DATA and Y_DATA.

[0135] Then, the sensor scanning module 102 can set the status bits in the ISR related to the detection of valid data (e.g., valid data scanning interruption) and wake up the CPU. The CPU can determine that valid data has been detected through the corresponding status bits, and thus can read the data of X_DATA and Y_DATA.

[0136] The CPU can also send the read data via USB or RF and then enter sleep mode to wait for a new wake-up signal. In other words, in continuous scan mode, even if there is no IRQ pin connected between the sensor and electronic device 100 and / or the sensor scanning module 102, the CPU can be kept in sleep mode as much as possible, while only the sensor scanning module 102 performs periodic wake-ups and data scanning, thus still supporting mobile wake-up from deep sleep and saving power.

[0137] In addition, the sensor scanning module 102 can also perform functions such as communication fault detection and communication fault handling through the communication fault detection and recovery module 206. These functions are mainly for sensors with a 2-wire SPI interface.

[0138] The sensor scanning module 102 can initiate a read operation to read the ID value in the ID_ADDR register and compare it with the ID value preset in ID_VALUE. If the read ID value is different from the ID value in ID_VALUE, a communication failure is considered to have occurred.

[0139] At this time, the sensor scanning module 102 can set the status bits related to communication failure (e.g., communication failure interruption) in the ISR and wake up the CPU. The CPU can determine that the current state is a communication failure through the corresponding status bits, and thus reconfigure the WORK_MODE to the sensor configuration mode.

[0140] For example, the sensor scanning module 102 can be configured with the resynchronization enable in CFG_CSR to initiate a resynchronization, at which time the CPU can enter a sleep state.

[0141] Once resynchronization is complete, the sensor scanning module 102 can set the resynchronization completion interrupt status bit in the ISR and wake up the CPU. The CPU can determine whether it is a resynchronization completion interrupt through the corresponding status bit, and can then configure the working mode to the corresponding scanning mode through the working mode register WORK_MODE, and enable the scan enable in the CONFIG register, so that the sensor scanning module 102 can start scanning according to the corresponding scanning mode.

[0142] The embodiments disclosed herein innovatively propose a hardware-based sensor scanning module. Mice using this scanning module not only offer significant advantages in terms of high performance, low power consumption, and user experience, but also add motion wake-up functionality to mid-to-low-end mice, demonstrating significant innovative value and application potential within the industry.

[0143] Next, Figure 3 A schematic flowchart of a processing method 300 for an electronic device according to an embodiment of the present disclosure is shown.

[0144] Electronic devices may include a central processing unit (CPU) and a sensor scanning module. For example... Figure 3As shown, a processing method 300 for an electronic device according to an embodiment of this disclosure may include: in step S301, the sensor scanning module receives configuration information from the CPU via a first bus in the electronic device; in step S302, the sensor scanning module collects data from a first sensor connected to the sensor scanning module based on the configuration information; and in step S303, the sensor scanning module transmits the collected data to the memory of the electronic device via a second bus. In some embodiments, the second bus is directly connected to the CPU and the memory, and the first bus is connected to the CPU and the memory via the second bus.

[0145] In some embodiments, the sensor scanning module includes a communication fault detection and recovery module, which is configured to: when the first sensor is connected to the sensor scanning module via a 2-wire serial peripheral interface (SPI), detect whether a preset first sensor ID value corresponding to the first sensor and a second sensor ID value read from the sensor ID register address are consistent; and when the first sensor ID value and the second sensor ID value are inconsistent, reset the first sensor state machine.

[0146] In some embodiments, resetting the first sensor state machine includes sending a pulse signal with a first length to the first sensor, wherein the first length is configured via a resynchronization register.

[0147] In some embodiments, the sensor scanning module is further configured to: set the status bit related to communication failure in the interrupt status register and wake up the CPU when the first sensor ID value and the second sensor ID value are inconsistent.

[0148] In some embodiments, the sensor scanning module further includes a sensor configuration module, wherein the first sensor ID value and the sensor ID register address are configured through registers in the sensor configuration module.

[0149] In some embodiments, the first sensor does not have an interrupt request pin connected to the electronic device, wherein the configuration information includes a scan frequency, and wherein the sensor scanning module is configured to periodically perform a scanning operation on the first sensor based on the scan frequency, wherein the scanning operation includes: periodically waking up at the scan frequency to read a status value in the status register of the first sensor; continuing to enter a sleep state if the status value indicates that the first sensor has no valid data; and reading the value of one or more data registers of the first sensor as the acquired data of the first sensor if the status value indicates that the first sensor has valid data.

[0150] In some embodiments, the sensor scanning module is further configured to: set the status bit in the interrupt status register related to the detected valid data and wake up the CPU when the status value indicates that the first sensor has valid data.

[0151] In some embodiments, the sensor scanning module includes a working mode configuration module, which is configured to configure the working modes of the sensor scanning module, wherein the working modes include: a sensor configuration mode, a single scan mode for sensors having an interrupt request pin connected to the electronic device, and a continuous scan mode for sensors not having an interrupt request pin connected to the electronic device.

[0152] In some embodiments, the first sensor is a sensor for sensing mouse movement data, wherein the movement data includes the mouse's X-axis coordinate data and Y-axis coordinate data.

[0153] In some embodiments, the sensor scanning module is a hardware module implemented using digital circuitry.

[0154] Embodiments of this disclosure also provide a computer-readable medium having instructions stored thereon that, when executed, can be used to implement method 300 as described above or any other method according to embodiments of this disclosure.

[0155] This disclosure uses a mouse MCU as an example for illustrative description. It should be understood that the methods or architectures provided in the embodiments of this disclosure can also be applied to any other device or product that requires efficient, stable, and low-power high-frequency data acquisition, and this disclosure does not impose any limitations.

[0156] It should be understood that the methods described above in conjunction with various embodiments or accompanying drawings are merely examples. Embodiments of this disclosure may also allow for any additions, deletions, substitutions, or combinations of any steps or elements in the methods or structures shown above. The steps in the methods of the embodiments of this disclosure may be performed in parallel or in any other order not shown, and this is not limiting.

[0157] Although this disclosure has been described with reference to exemplary embodiments, various changes and modifications may be suggested to those skilled in the art. This disclosure is intended to cover such changes and modifications that fall within the scope of the appended claims.

[0158] Nothing described in this disclosure should be construed as implying that any particular element, step, or function is an essential element that must be included within the scope of the claims. The scope of the patent subject matter is defined only by the claims.

[0159] Exemplary embodiments according to this disclosure have been disclosed herein, and although specific terminology has been used, it is used and interpreted in a general and descriptive sense only and not for limiting purposes. In some instances, features, characteristics, and / or elements described in connection with particular embodiments may be used alone or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise stated. Therefore, those skilled in the art will understand that various changes in form and detail may be made to this disclosure without departing from the spirit and scope of the claims.

Claims

1. An electronic device, characterized in that, include: A central processing unit (CPU) is connected to a second bus in the electronic device; A sensor scanning module is connected to a first sensor and a first bus in the electronic device, and is configured to receive configuration information from the CPU via the first bus, acquire data from the first sensor based on the configuration information, and transmit the acquired data to the memory of the electronic device via a second bus. The second bus is directly connected to the CPU and the memory, and the first bus is connected to the CPU and the memory through the second bus.

2. The electronic device according to claim 1, characterized in that, The sensor scanning module includes a communication fault detection and recovery module, which is configured as follows: When the first sensor is connected to the sensor scanning module via a 2-wire serial peripheral interface SPI, it is detected whether the preset first sensor ID value corresponding to the first sensor and the second sensor ID value read from the sensor ID register address are consistent. as well as If the first sensor ID value and the second sensor ID value are inconsistent, the state machine of the first sensor is reset.

3. The electronic device according to claim 2, characterized in that, Resetting the first sensor state machine includes: A pulse signal with a first length is sent to the first sensor, wherein the first length is configured via a resynchronization register.

4. The electronic device according to claim 2, characterized in that, The sensor scanning module is also configured to: set the status bit related to communication failure in the interrupt status register and wake up the CPU when the first sensor ID value and the second sensor ID value are inconsistent.

5. The electronic device according to claim 2, characterized in that, The sensor scanning module further includes a sensor configuration module, wherein the first sensor ID value and the sensor ID register address are configured through registers in the sensor configuration module.

6. The electronic device according to claim 1, characterized in that, The first sensor does not have an interrupt request pin connected to the electronic device, wherein the configuration information includes a scan frequency, and The sensor scanning module is configured to periodically perform a scanning operation on the first sensor based on the scanning frequency, wherein the scanning operation includes: The sensor is periodically woken up at the stated scanning frequency to read the status value in the status register of the first sensor. If the status value indicates that the first sensor has no valid data, it will continue to enter a sleep state; and When the status value indicates that the first sensor has valid data, the value of one or more data registers of the first sensor is read as the acquired data of the first sensor.

7. The electronic device according to claim 6, characterized in that, The sensor scanning module is further configured to: set the status bit in the interrupt status register related to the detected valid data and wake up the CPU when the status value indicates that the first sensor has valid data.

8. The electronic device according to claim 1, characterized in that, The sensor scanning module includes a working mode configuration module, which is configured to configure the working mode of the sensor scanning module. The operating modes include: a sensor configuration mode, a single scan mode for sensors having an interrupt request pin connected to the electronic device, and a continuous scan mode for sensors not having an interrupt request pin connected to the electronic device.

9. The electronic device according to claim 1, characterized in that, The first sensor is a sensor used to sense the movement data of the mouse, wherein the movement data includes the X-axis coordinate data and Y-axis coordinate data of the mouse.

10. The electronic device according to claim 1, characterized in that, The sensor scanning module is a hardware module implemented using digital circuitry.