Electronic device and processing method of electronic device

The sensor scanning module implemented through hardware solves the hardware performance and power consumption problems of traditional mouse at high reporting rates, realizes efficient and stable data acquisition and mobile wake-up, and improves the performance and battery life of the mouse.

CN120448320APending Publication Date: 2025-08-08BEIJING ONMICRO ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510668192.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-22
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional mice face high hardware performance requirements and increased power consumption when achieving high reporting rates, which are difficult to meet the needs of high-end users for more frequent data acquisition and transmission, and cannot support mobile wake-up in deep sleep.

Method used

The sensor scanning module implemented by hardware realizes real-time data acquisition and processing by directly communicating with the sensor, reducing CPU participation, supporting high reporting rate and optimizing power consumption, and supporting mobile wake-up in deep sleep state.

Benefits of technology

It realizes efficient, stable and low-power sensor data acquisition, meets the needs of high reporting rates, improves user experience and extends battery life.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448320A_ABST
    Figure CN120448320A_ABST
Patent Text Reader

Abstract

The invention provides an electronic device and a processing method of the electronic device. An electronic device includes: a central processing unit (CPU) connected to a second bus in the electronic device; the 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 through the first bus, collect data of the first sensor based on the configuration information and scan the data of the first sensor according to the collected data. And transmitting the collected data to a memory of the electronic device through the second bus, wherein the second bus is directly connected with the CPU and the memory, and the first bus is connected with the CPU and the memory through the second bus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of electronic technology, and more particularly to an electronic device and a processing method for the electronic device. Background Art

[0002] With the rapid development of esports and high-end gaming, users are demanding increasingly higher performance from their mice. Traditional mouse report rates are typically below 1 kHz, meaning the mouse reports its position and status to the computer up to 1,000 times per second. However, with increasing game refresh rates and players' demands for more precise control, a 1 kHz report rate has gradually become insufficient to meet the needs of high-end users. In recent years, market demand for mice with higher report rates, such as 4 kHz and 8 kHz, has been growing. A high report rate requires the mouse to report its position and status more frequently to the computer, providing a smoother and more precise control experience. However, achieving a high-report rate mouse is not easy, primarily due to 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 requires more frequent data collection and transmission, which increases power consumption and impacts battery life.

[0003] In summary, the market demand for high-report-rate mice is increasingly urgent, but achieving such a high-report-rate mouse still faces numerous technical challenges. Therefore, developing a mouse that can address these challenges while maintaining high performance has significant market value and application prospects. Summary of the Invention

[0004] An embodiment of the present disclosure provides an electronic device, comprising: a central processing unit (CPU), which is connected to a second bus in the electronic device; a sensor scanning module, which 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, collect data of the first sensor based on the configuration information, and transmit the collected 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 a 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 having a first length to the first sensor, wherein the first length is configured by a resynchronization register.

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

[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 scanning frequency, and wherein 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: periodically waking up at the scanning frequency to read a status value in a status register of the first sensor; continuing to enter a sleep state when the status value indicates that the first sensor has no valid data; and reading the values of one or more data registers of the first sensor as the collected data of the first sensor when the status value indicates that the first sensor has valid data.

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

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

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

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

[0014] An embodiment of the present disclosure provides a processing method for an electronic device, wherein the electronic device includes a central processing unit (CPU) and a sensor scanning module, wherein 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 collecting data of a first sensor connected to the sensor scanning module based on the configuration information; and the sensor scanning module transmitting the collected data to a memory of the electronic device via a 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.

[0015] An embodiment of the present disclosure provides a computer-readable storage medium having computer-readable instructions stored thereon. When the instructions are executed by a processor, the instructions can be used to implement any method for designing and / or processing an electronic device according to an embodiment of the present disclosure.

[0016] This disclosure provides an electronic device and a processing method for the electronic device. These electronic devices and processing methods can be used in the design and / or processing of a mouse microcontroller unit (MCU). They address the limitations of traditional software-based general-purpose input / output (GPIO) simulation timing in high-report-rate scenarios, providing an efficient, stable, and low-power solution for implementing a high-report-rate mouse. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings are not necessarily drawn to scale, and for illustrative purposes, elements of similar structure or function may generally be represented by the same reference numerals or portions thereof throughout the drawings. The drawings are merely for the convenience of describing 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 the drawings from becoming obscure, not all components, connections, etc. are shown, and not all components have reference numerals. However, the pattern of component configuration can be easily seen from the drawings. The drawings, together with the specification, illustrate example 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 in conjunction with the drawings, in which:

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

[0019] Figure 2 shows an example structure of a sensor scanning module according to an embodiment of the present disclosure; 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 DESCRIPTION

[0021] Before proceeding with the detailed description below, it may be helpful to set forth the definitions of certain words and phrases used throughout this patent document. The terms "couple," "connect," and their derivatives refer to any direct or indirect communication or connection between two or more elements, regardless of whether those elements are in physical contact with each other. The terms "transmit," "receive," and "communicate," and their derivatives, encompass both direct and indirect communication. The terms "include," "comprise," and their derivatives, mean including, but not limited to. The term "or" is inclusive, meaning and / or. The phrases "associated with," "corresponding to," and their derivatives, mean including, included within, interconnected, containing, contained within, connected or connected with, coupled or coupled with, communicate with, cooperate with, intertwine, juxtapose, approach, bound or bound with, have, have an attribute of, have a relationship with, or have a relationship with, etc. The term "controller" refers to any device, system, or portion thereof that controls at least one operation. Such a controller may be implemented using hardware, or a combination of hardware and software and / or firmware. The functionality associated with any particular controller may be centralized or distributed, whether local or remote. The phrase "at least one of," when used with a list of items, means that different combinations of one or more of the listed items may be used, and only one of the items in the list may be needed. 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, and A, B, and C.

[0022] Definitions for other specific words and phrases are provided throughout this patent document. Those of ordinary skill in the art should understand that in many, if not most instances, such definitions apply to prior and future uses of such defined words and phrases.

[0023] In this patent document, the application combination of modules and the division level of submodules are only for illustration. Without departing from the scope of the present disclosure, the application combination of modules and the division level of submodules can be different. The embodiments of the present disclosure can be implemented in different forms and should not be interpreted as being limited to the embodiments set forth herein. On the contrary, 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 the present disclosure can be arbitrarily combined to form additional embodiments.

[0024] Hereinafter, the embodiments of the present disclosure will be exemplarily described by taking a mouse MCU as an example.

[0025] When implementing sensor scanning, a mouse chip typically uses software to simulate timing via GPIO. Some specific example implementations are shown below.

[0026] A mouse sensor is responsible for sensing or collecting mouse movement data, such as mouse position, coordinates, and displacement. The sensor typically exchanges data with the host MCU via the Serial Peripheral Interface (SPI) protocol. To reduce cost and simplify design, most mouse sensors use a customized 2-wire SPI (CLK / DATA), with a few adopting 3-wire SPI (CSN / CLK / DATA) and 4-wire SPI (CSN / CLK / MOSI / MISO), along with an interrupt request (IRQ) pin. However, most mouse controller MCUs only have standard 4-wire SPI, a few have 3-wire SPI, and few have customized 2-wire SPI capable of directly scanning the mouse sensor. Therefore, in most cases, the mouse controller MCU uses GPIOs to emulate SPI timing to implement sensor scanning and / or data reading.

[0027] As mentioned above, CSN (Chip Select Negative) is the chip select line for 3-wire or 4-wire SPI, CLK is the SPI clock line, MISO (Master In Slave Out) is the master input / slave output line for 4-wire SPI, MOSI (Master Out Slave In) is the master output / 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 same data line. Generally, at the beginning of each operation, the data line (DATA) is in the output state. The first bit of the operation is the control bit, such as read or write, and the next seven bits are the address. If the operation is a write operation, the data line is then transmitted on the data line to be written. If the operation is a read operation, the data line is switched to the input state, and the data to be read is then transmitted on the data line.

[0028] In addition, most low-end and mid-range mice use single-sided printed circuit (PCB) boards to reduce costs, omitting the IRQ pin. Only a few high-end mice use a double-sided board design, in which an IRQ pin is provided on the MCU to connect to the sensor's IRQ pin.

[0029] For high-end mice with IRQ pins, when the mouse moves, a signal is generated on the IRQ pin to notify the main MCU, waking the main MCU from sleep mode. The main MCU 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-end mice without IRQ pins, the MCU must actively wake up periodically to read the sensor status, resulting in high power consumption. To balance power consumption and user experience, mice without IRQ pins generally do not support motion wake-up in deeper sleep states, supporting only button and scroll wheel wake-up.

[0031] For example, let's use a wireless mouse with a 125Hz report rate to illustrate sleep states and wakeup methods. In this example, when the mouse moves, the main MCU scans the sensor every 8ms and sends the data via radio. This state is called the Active state. That is, in the Active state, the main MCU scans the sensor every 8ms and sends and receives data via radio every 8ms.

[0032] If no data is scanned within a certain period of time (for example, one minute) after the last mouse movement, the mouse can enter a sleep state. While the scanning frequency remains unchanged, the RF transmission and reception frequency is reduced, for example, every 100ms to maintain a connection. In other words, in the sleep state, the main MCU scans the sensor every 8ms and transmits and receives data via RF every 100ms. This sleep state can last for a period of time, for example, nine minutes. If data is scanned within the sleep state, the main MCU switches to an active state. If no data is scanned within the sleep state, the mouse can enter a sleep state. In this state, the RF transmission and reception frequency is reduced, for example, every 500ms to maintain a connection. To save power, the MCU will not wake up to scan or read sensors. Therefore, wakeup by motion is not supported in the sleep state, and can only be activated by other means such as mouse buttons and the 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 movement data to the MCU through GPIO, and the MCU then processes the data.

[0034] This approach may have the following disadvantages:

[0035] The GPIO simulation timing method will occupy a lot of CPU resources, resulting in 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 simulation may be unstable, resulting in data transmission errors or frame drops;

[0038] For low-end mice without IRQ pins, they cannot support motion wake-up in deep sleep state (for example, the secondary sleep state described above).

[0039] In other words, the mouse MCU implements sensor scanning through GPIO analog timing. Although this can meet the needs of mice with low report rates (for example, below 1 kHz), the following problems may still exist:

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

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

[0042] High power consumption: The CPU cannot sleep during GPIO simulation timing. Frequent CPU involvement will lead to increased power consumption and affect the battery life of the mouse.

[0043] Insufficient accuracy and stability: The sampling frequency and timing stability of GPIO may not be guaranteed, resulting in data misjudgment or uneven sampling, affecting the user experience.

[0044] Low report rate: Cannot meet the needs of mice with high report rates.

[0045] Unable to support motion wake-up: Low-end mice without IRQ cannot support motion wake-up in deep sleep state.

[0046] In order to solve the above problems, the present disclosure proposes a device and method for mouse sensor scanning based on hardware implementation, which directly communicates with the sensor through a sensor scanning module implemented by dedicated hardware to realize real-time collection and processing of sensor data without the need for software or CPU to directly participate in sensor data scanning.

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

[0048] Reduce CPU involvement: Through hardware scanning sensors, the CPU involvement is significantly reduced, reducing system resource usage.

[0049] Reduce main frequency and power consumption: Due to the high efficiency of the hardware module, the main control MCU can run at a lower CPU main frequency, thereby reducing power consumption and extending the battery life of the mouse.

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

[0051] Improve user experience: The asynchronous design and uniform data sampling of the hardware module 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 motion wake-up: In deep sleep state, 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 the mouse power consumption, while the peripherals are generally very low). This allows mid- and low-end mice to support the motion wake-up function.

[0053] The mouse sensor scanning module implemented by hardware in the present disclosure solves the limitations of the traditional software simulation timing method and provides an efficient, stable and low-power solution for mouse sensor scanning.

[0054] Next, an example of the mouse MCU architecture according to an embodiment of the present disclosure will be further described with reference to the accompanying drawings.

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

[0056] An example electronic device 100 according to the mouse MCU architecture of 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 , and a second bus 106 .

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

[0058] In some embodiments, the sensor scanning module 102 can be connected to a first sensor (not shown) and a first bus 105 in the electronic device 100. The sensor scanning module 102 can be configured to receive configuration information from, for example, the CPU 108 or software via the first bus 105, collect data from the first sensor based on the configuration information, and directly transmit the collected data to the memory 107 and / or the CPU 108 of the electronic device 100 via the 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 a main bus of the system 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, a hardware-implemented data packaging module can be provided between the sensor scanning module 102 and the second bus 106 to perform hardware packaging on the data collected by the sensor scanning module 102, generating data packets that comply with the protocol or format (e.g., Host Interface Device (HID) protocol) required for communication with the CPU 108 and / or memory 107 on the second bus 106. This allows the collected data to be directly transmitted to a host (e.g., the CPU 108 and / or memory 107) via the second bus 106. In some embodiments, the data packaging module can also be a submodule within the sensor scanning module 102, which is not limited by this disclosure.

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

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

[0063] In some embodiments, in order to ensure the real-time, accuracy and stability of sensor data, the sensor scanning module 102 may also include the following 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 the present disclosure is shown.

[0065] like Figure 2 As shown, the sensor scanning module 102 may include one or more of 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, an operating mode configuration module 208, a timing module 209, and a data module 210. These one or more modules may be interconnected to form a sensor scanning module 102 having 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 may be used to configure some register addresses and sensor IDs of the sensors to be scanned according to the user manual of the sensors.

[0069] The timing configuration module 204 can be used to configure the timing signal 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 collection.

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

[0071] The communication failure detection and recovery module 206 can be used to resynchronize the 2-wire SPI after detecting 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 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 or resynchronize the first sensor state machine.

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

[0074] In some embodiments, the sensor scanning module 102 may be further configured to set a status bit related to the communication failure in an 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 may be configured via 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 modes of the sensor scanning module 102 can include one or more of the following: sensor configuration mode, single scan mode, continuous scan mode, etc. In some embodiments, the single scan mode can be used for sensors that have 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 can 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. In the event that 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 a status value in a status register of the first sensor; continuing to enter a sleep state when the status value indicates that the first sensor has no valid data; and reading the values of one or more data registers of the first sensor as the collected data of the first sensor when the status value indicates that the first sensor has valid data.

[0080] In some embodiments, the sensor scanning module 102 may be further configured to set a status bit related to valid data scanned in an interrupt status register (ISR) and wake up the CPU if the status value indicates that the first sensor has valid data.

[0081] The timing module 209 may be configured to generate a periodic scanning time interval in a continuous scanning mode or when performing continuous scanning.

[0082] The 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 described above may be obtained from software (e.g., a CPU and / or memory, etc.) via the first bus 105, or may be determined and pre-configured based on specifications, user manuals, specific timing requirements, etc. of corresponding peripheral devices such as sensors, and are not limited herein.

[0084] The sensor scanning module 102 of the present disclosure is described below with reference to specific embodiments.

[0085] As described above, the sensor scanning module 102 according to the embodiment of the present disclosure may include one or more of 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, a data module 210, etc.

[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, which are required by the sensor scanning module 102 in scanning modes (e.g., single scanning mode and continuous scanning 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 the scanning frequency, scanning mode, sensor coordinate data format, and the sensor coordinate high-order data format (applicable only 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 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 or little-endian byte order. The parameter configuration module 202 operates in sensor configuration mode and is primarily used to initialize or set certain sensor parameters.

[0089] The timing configuration module 204 configures the TNS and TR registers to meet the specific SPI timing requirements of different sensors. These include the time from when the chip select line CSN is pulled low to when the first bit's clock signal is generated, and the time from when the address is sent to when the data is read. The TR register is used to configure the timing for switching the DATA direction of a 2-wire or 3-wire SPI. The TNS register is used to configure the timing from when the SPI CSN line is valid to when the clock is generated.

[0090] The communication fault detection and recovery module 206 primarily targets 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, a communication fault detection method may include: before reading data, reading a sensor ID value from a sensor ID register address configured by the sensor configuration module 203, and comparing the read sensor ID value with a sensor ID value corresponding to the first sensor preset by the sensor configuration module 203. If the two ID values do not match, a communication fault is considered. 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 between sensors, and is configured using the resynchronization (RESYNC) register. This allows the 2-wire SPI to restore communication after a communication fault.

[0091] The interrupt configuration module 205 can be used to configure the enabling or disabling of one or more interrupt modes, such as a scan completion interrupt (generated upon completion of a scan in single-scan mode), a valid data scan interrupt (generated upon detection of valid data in continuous-scan mode), a communication failure interrupt (generated when the two sensor ID values are inconsistent in the case of a 2-wire SPI sensor as described above), and a resynchronization complete interrupt (generated after recovery is complete after a communication failure). One or more of these interrupt modes can be enabled or disabled based on actual needs. For example, if the first sensor is a 2-wire SPI sensor, a communication failure interrupt and a resynchronization complete interrupt can be configured, but if the first sensor is a 3-wire or 4-wire SPI sensor, these interrupts can be disabled.

[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 sensors, the CPU can be set to a sleep state and awakened only when an enabled corresponding interrupt is generated, thereby reducing the CPU's participation in sensor scanning and saving power.

[0093] The operating mode configuration module 208 can configure the sensor scanning module 102 to operate in one or more of a sensor configuration mode, a single scan mode, a continuous scan mode, and the like.

[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 via IRQ after generating data. The sensor scanning module 102 reads the data, generates a scan completion interrupt after reading the data, and wakes up the MCU. This scanning mode can be called a single scan mode.

[0095] If the sensor is not connected to the electronic device 100 and / or the sensor scanning module 102 via its 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 in 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 is moving, the data status bit in the sensor status register may 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 sensor data registers (for example, the sensor X-axis coordinate low-order data register address, the sensor X-axis coordinate high-order data register address, the sensor Y-axis coordinate low-order data register address, the sensor Y-axis coordinate high-order data register address, etc.). Upon reading data, a valid data scan interrupt is generated, waking up the MCU. This scanning mode can be referred to as continuous scanning mode.

[0096] The timing module 209 can be used for timing in continuous scanning mode or during continuous scanning. For example, it can be used to generate periodic time intervals (e.g., corresponding to the configured scanning 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 may be: read sensor ID -> read sensor status register -> read sensor data; for a 3-wire or 4-wire SPI sensor, the specific sequence may be: read sensor status register -> read sensor 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 (eg, CPU, etc.).

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

[0099] [Table 1]

[0100] Register Name describe CONFIG The configuration register is used to configure the 2-wire / 3-wire / 4-wire SPI and IRQ pins, sensor coordinate data format, scan enable, wake-up enable, etc. WORK_MODE The operating mode register is used to configure the operating mode of the sensor scanning module, such as sensor configuration mode, single scan mode, continuous scan mode, etc. IER The interrupt enable register is used to configure the enable or disable of each interrupt mode. ISR The interrupt status register corresponds to the enable or disable status of each interrupt mode in the interrupt enable register and is used by the CPU to obtain the interrupt source when an interrupt occurs. ID_ADDR Used to configure the mouse sensor ID register address. ID_VALUE Used to configure the value of the mouse sensor ID. STATUS_ADDR Used to configure the mouse sensor status register address. XL_DATA_ADDR Used to configure the low-order data register address of the mouse sensor X-axis coordinate. YL_DATA_ADDR Used to configure the low-order data register address of the Y-axis coordinate of the mouse sensor. XH_DATA_ADDR Used to configure the X-axis coordinate high-order data register address. YH_DATA_ADDR Used to configure the Y-axis coordinate high-order data register address. X_DATA Used to store the X-axis coordinate data collected by the sensor. Y_DATA Used to store the Y-axis coordinate data collected by the sensor. FREQ Used to configure the scanning frequency during continuous scanning. RESYNC Used to configure the length of the CLK pulse for resynchronization after an error in 2-wire SPI communication. CFG_CSR In sensor configuration mode, data direction configuration (reading and writing share the same DATA line in 2-wire and 3-wire SPI, so the module needs to be told the direction of the second byte data), read and write enable and status indication, 2-wire SPI enable resynchronization and status indication. CFG_ADDR In sensor configuration mode, configure the register address of the mouse sensor to be operated. CFG_DATA In sensor configuration mode, the data of the sensor register to be operated. If it is a write operation, this is the data to be written; if it is a read operation, this is the data to be read. TR DATA timing configuration: the time from the end of the first byte address to the generation of the first bit clock of the next byte. TNS CSN timing configuration: the time from when CSN is pulled low to when the clock is generated, and the time from when the last 1-bit clock is clocked to when CSN is pulled high.

[0101] Some example operating modes of the sensor scanning module 102 according to an embodiment of the present disclosure are described below.

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

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

[0104] Before using the sensor scanning module 102 , it is necessary to first initialize the sensor and / or the sensor scanning module 102 according to the selected sensor specifications.

[0105] During initialization, the working mode register WORK_MODE can be configured as sensor configuration mode.

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

[0107] For sensors with a 2-wire SPI interface, you need to configure the resynchronization (RESYNC) register, and you can first configure the resynchronization enable in CFG_CSR to initiate a resynchronization to reset the sensor's state machine.

[0108] The sensor can be configured by operating the CFG_ADDR and CFG_DATA registers to implement a series of sensor customization initialization processes such as sensor reset, calibration, and parameter configuration.

[0109] During the register write operation, 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. The sensor scanning module 102 will start a transmission and write the data to the register address corresponding to the sensor.

[0110] During the register read operation, 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 started, so that the sensor scanning module 102 will start a transmission and read the data in the register address corresponding to the sensor into CFG_DATA.

[0111] For 2-wire SPI sensors, configure the sensor ID register address and sensor ID value to ID_ADDR and ID_VALUE, respectively, according to the sensor datasheet or device manual. This is used for communication fault detection in scanning mode.

[0112] For sensors without IRQ pins, the FREQ register needs to be configured according to the mouse report rate and the sensor frame rate (for example, if the mouse report rate is 125, the FREQ register needs to be configured to 125, and the sensor frame rate needs to be configured to generate data every 8ms when moving).

[0113] For sensors without an IRQ pin, configure the sensor's status register address to STATUS_ADDR according to the sensor specification or device manual to detect the sensor's data status during continuous scanning.

[0114] For sensors with 8-bit data formats, the register addresses of the sensor's X- and Y-axis coordinate data must be configured in XL_DATA_ADDR and YL_DATA_ADDR according to the sensor specification or device manual. For sensors with 12-bit and 16-bit data lengths, the register addresses of the sensor's X- and Y-axis coordinate high-order data must also be configured in XH_DATA_ADDR and YH_DATA_ADDR according to the sensor specification or device manual. These addresses are used to read coordinate data in scan mode.

[0115] You can enable the scan completion interrupt and / or valid data scan interrupt in the interrupt enable register (IER). For 2-wire SPI sensors, you also need to enable the communication fault interrupt and resynchronization end interrupt.

[0116] Afterwards, the working mode may be configured as a corresponding scanning mode through the working mode register WORK_MODE, and the scan enable in the CONFIG register may be enabled, and the sensor scanning module 102 will start scanning according to the corresponding scanning mode.

[0117] The scanning mode may include a single scanning mode.

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

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

[0120] When the mouse starts to move, the sensor may generate coordinate data according to the frame rate preset in the sensor configuration mode and wake up the sensor scanning module 102 through the IRQ pin.

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

[0122] When reading coordinate data, for 8-bit 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 must also initiate two read operations using the values in XH_DATA_ADDR and YH_DATA_ADDR as register addresses, storing the read data in the upper bits of X_DATA and Y_DATA.

[0123] Afterwards, the sensor scanning module 102 may set a status bit in the ISR related to scanning completion (e.g., scanning completion interrupt) and wake up the CPU. The CPU can determine that the current scanning is complete based on the corresponding status bit and can read the data of X_DATA and Y_DATA.

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

[0125] The scanning mode may also include a continuous scanning mode.

[0126] The continuous scanning mode is mainly used for the case where the sensor scanning module is connected to a sensor that does not have an IRQ pin.

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

[0128] The sensor scanning module 102 can periodically wake up and perform scanning operations according to the frequency specified in FREQ. For example, for a 2-wire SPI sensor, the scanning operation may include reading the sensor ID, then reading the sensor status register, and then reading the sensor data. For a 3-wire or 4-wire SPI sensor, the scanning operation may include reading the sensor status register and then reading the sensor data.

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

[0130] During a scan operation, the sensor scanning module 102 can initiate a read operation to read the status value in STATUS_ADDR and determine the state of the data valid bit in the status value. If the mouse is not moving, the data valid bit may be 0 (e.g., indicating that the sensor currently has no (new) valid data). Therefore, the sensor scanning module 102 can continue to sleep and wait until the next wake-up opportunity to wake up again.

[0131] When the mouse moves, the data valid bit may be 1, and the sensor scanning module 102 may continue to perform subsequent data scanning operations.

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

[0133] When reading coordinate data, for 8-bit 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 must also initiate two read operations using the values in XH_DATA_ADDR and YH_DATA_ADDR as register addresses, storing the read data in the upper bits of X_DATA and Y_DATA.

[0134] Afterwards, the sensor scanning module 102 may set a status bit in the ISR related to valid data being scanned (e.g., a valid data scan interrupt) and wake up the CPU. The CPU can determine that valid data is currently scanned based on the corresponding status bit and can read the data of X_DATA and Y_DATA.

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

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

[0137] The sensor scanning module 102 may initiate a read operation, read the ID value in the ID_ADDR register and compare it with the ID value preset in the ID_VALUE. When the read ID value is different from the ID value in the ID_VALUE, it is considered that a communication failure has occurred.

[0138] At this point, the sensor scanning module 102 can set a status bit in the ISR associated with a communication failure (e.g., a communication interruption) and wake up the CPU. The CPU can determine the current communication failure state based on the corresponding status bit and can reconfigure WORK_MODE to the sensor configuration mode.

[0139] For example, the sensor scanning module 102 may configure the resynchronization enable in the CFG_CSR to initiate a resynchronization, and at this time, the CPU may enter the sleep state.

[0140] After resynchronization is complete, the sensor scanning module 102 can set the resynchronization end interrupt status bit in the ISR and wake up the CPU. The CPU can determine that the current resynchronization end interrupt is a resynchronization end interrupt based on 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.

[0141] The disclosed embodiments innovatively propose a hardware-based sensor scanning module. Mice using this scanning module not only offer significant advantages in high performance, low power consumption, and user experience, but also add a wake-on-motion feature to mid-range and low-end mice, demonstrating significant innovation and application value within the industry.

[0142] 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.

[0143] The electronic device may include a central processing unit (CPU) and a sensor scanning module. Figure 3As shown, a processing method 300 for an electronic device according to an embodiment of the present 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 a 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.

[0144] 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 a 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.

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

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

[0147] 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.

[0148] In some embodiments, the first sensor does not have an interrupt request pin connected to the electronic device, wherein the configuration information includes a scanning frequency, and wherein 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: periodically waking up at the scanning frequency to read a status value in a status register of the first sensor; continuing to enter a sleep state when the status value indicates that the first sensor has no valid data; and reading the values of one or more data registers of the first sensor as the collected data of the first sensor when the status value indicates that the first sensor has valid data.

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

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

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

[0152] In some embodiments, the sensor scanning module is a hardware module implemented by a digital circuit.

[0153] An embodiment of the present disclosure further provides a computer-readable medium having instructions stored thereon. When executed, the instructions may be used to implement the method 300 described above or any other method according to an embodiment of the present disclosure.

[0154] 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 requiring efficient, stable, and low-power high-frequency data acquisition, and this disclosure does not limit this.

[0155] It should be understood that the methods described above in conjunction with the various embodiments or drawings are merely examples. The embodiments of the present disclosure may also add, delete, replace, or combine any steps or elements in the methods or structures shown above. The steps in the methods of the embodiments of the present disclosure may be performed in parallel or in any other order not shown, and this is not limited herein.

[0156] Although the present disclosure has been described with exemplary embodiments, various changes and modifications may be suggested to one skilled in the art. It is intended that the present disclosure encompass such changes and modifications as fall within the scope of the appended claims.

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

[0158] Exemplary embodiments of the present disclosure have been disclosed herein, and although specific terms are employed, they are used and interpreted in a general and descriptive sense only, and not for purposes of limitation. In some cases, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise indicated. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made to the present disclosure without departing from the spirit and scope of the claims.

Claims

1. An electronic device comprising: a central processing unit (CPU), the CPU being 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 via the first bus, collect data from the first sensor based on the configuration information, and transmit the collected data to a memory of the electronic device via the 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, wherein The sensor scanning module includes a communication fault detection and recovery module, which is configured to: In a case where the first sensor is connected to the sensor scanning module via a 2-wire serial peripheral interface SPI, detecting whether a preset first sensor ID value corresponding to the first sensor is consistent with a second sensor ID value read from a sensor ID register address; as well as When 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, wherein: Resetting the first sensor state machine includes: A pulse signal having a first length is sent to the first sensor, wherein the first length is configured by a resynchronization register.

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

5. The electronic device according to claim 2, wherein: 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. The electronic device according to claim 1 , wherein: The first sensor does not have an interrupt request pin connected to the electronic device, wherein the configuration information includes a scanning 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: Periodically waking up at the scanning frequency to read a status value in a status register of the first sensor; If the state value indicates that the first sensor has no valid data, continue to enter the dormant state; and When the status value indicates that the first sensor has valid data, values of one or more data registers of the first sensor are read as the collected data of the first sensor.

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

8. The electronic device according to claim 1, wherein The sensor scanning module includes a working mode configuration module, and the working mode configuration module 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 a sensor having an interrupt request pin connected to the electronic device, and a continuous scan mode for a sensor not having an interrupt request pin connected to the electronic device.

9. The electronic device according to claim 1, wherein: The first sensor is a sensor for sensing movement data of a mouse, wherein the movement data includes X-axis coordinate data and Y-axis coordinate data of the mouse.

10. The electronic device according to claim 1, wherein The sensor scanning module is a hardware module implemented by a digital circuit.

11. A method for processing an electronic device, wherein: The electronic device includes a central processing unit (CPU) and a sensor scanning module, wherein the method includes: The sensor scanning module receives configuration information from the CPU via a first bus in the electronic device; The sensor scanning module collects data of a first sensor connected to the sensor scanning module based on the configuration information; and The sensor scanning module transmits the collected data to the memory of the electronic device via the 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.