Data storage interface device, data processing method, electronic equipment and medium
By designing a data storage interface device on the MCU, parallel processing and clock signal adjustment of multiple QSPI interfaces are realized, which solves the problems of long power backup time caused by the low speed of the SPI/QSPI interface and the large space occupied by the high-speed interface, and optimizes storage rate and module volume.
Patent Information
- Application Number
- CN202410890903.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-11
AI Technical Summary
The low rate of the existing SPI/QSPI interface results in long power backup time, while the high rate interface causes the backup module to occupy a large space, and there are limited paths to improve the interface rate.
Design a data storage interface device that realizes parallel processing of multiple QSPI interfaces through the processing unit, clock unit and enabling unit, merges them into a higher bandwidth bus, adjusts the phase of the clock signal, and ensures that the communication between multiple controllers is The timing is consistent and the chip select signal is controlled for flexible communication.
It achieves an increase in storage rate on a low-cost MCU, reduces the size of the backup power module, optimizes power consumption and current, solves the problems of long backup time and large space, and simplifies PCB design and communication control.
Smart Images

Figure CN118760648A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of peripheral interface technology, and in particular to a data storage interface device, a data processing method, an electronic device, and a computer-readable storage medium. Background Art
[0002] SPI (Serial Peripheral Interface, currently the most commonly used serial peripheral interface) is widely used in the communication between MCU (Microcontroller Unit) and peripherals. It is the most commonly used low-speed interface and is usually used to connect SPI flash (a controller), sensors and other peripherals. The SPI interface is generally divided into single-line mode, standard mode, dual-line mode (Dual SPI), and 4-wire mode (QSPI). Among them, the QSPI (quad-wire SPI interface mode) mode is mostly used to connect external flash.
[0003] Generally, an MCU supports multiple SPI / QSPI interfaces. The main function of the external flash of the QSPI interface is to store the startup code and some information that needs to be saved when the power is off. When the system is abnormally powered off, the MCU will use the power provided by the capacitor / backup energy storage circuit on the circuit board to quickly store the data in the external flash. The whole process usually takes dozens of milliseconds. If the amount of data is large, it will not be able to be stored in time. If the amount of data is reduced, the information record will be incomplete.
[0004] There are usually two ways to increase the interface rate: increasing the interface clock rate and increasing the bit width. The maximum interface rate supported by the currently used SPIflash is fixed and cannot be increased. Summary of the invention
[0005] An embodiment of the present invention provides a data storage interface device, a data processing method, an electronic device and a computer-readable storage medium to solve the problems in the prior art of long backup power time caused by low-speed interfaces and large space occupied by backup power modules caused by high-speed interfaces.
[0006] The embodiment of the present invention discloses a data storage interface device, which is applied to a microcontroller. The device includes: a processing unit, a clock unit and an enabling unit;
[0007] The microcontroller is connected to a plurality of controllers via the data storage interface device;
[0008] The processing unit is used to process the bus signal inside the microcontroller to obtain a target signal, and output the target signal to a controller corresponding to the target signal;
[0009] The clock unit is used to adjust the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and output the target clock signal to the processing unit and the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same;
[0010] The enabling unit is used to output a chip select signal inside the microcontroller to the processing unit and the plurality of controllers; the chip select signal is used to control the communication between the microcontroller and the controllers.
[0011] Optionally, the clock unit is connected to the controller via a clock channel, and the device further comprises: a calibration unit;
[0012] The calibration unit is used to check whether the clock calibration value is stored in the clock unit;
[0013] The calibration unit is used for calibrating the clock channel when the clock unit does not have the clock calibration value, obtaining the clock calibration value, and outputting the value to the clock unit.
[0014] Optionally, the bus signal includes a control signal, an address signal and a data signal, and the processing unit includes a control address module, a data processing module and a signal selector; the processing unit is used to process the bus signal inside the microcontroller to obtain a target signal, and output the target signal to the controller corresponding to the target signal, including:
[0015] The connection relationship between the control address module and the signal selector depends on whether the microcontroller needs to transmit the control signal and the address signal, and the connection relationship between the data processing module and the signal selector depends on whether the microcontroller needs to transmit the data signal; the connection relationship includes a connection relationship and a disconnection relationship;
[0016] The control address module is used to perform format conversion and equal division on the control signal and the address signal, and output the obtained target control signal and the target address signal to the controller corresponding to the target control signal and the target address signal;
[0017] The data processing module is used to divide the data signal according to the target bit width, and output the obtained target data signal to the controller corresponding to the target data signal;
[0018] The signal selector is used to determine the controllers corresponding to the target control signal, the target address signal and the target data signal respectively;
[0019] The target control signal, the target address signal and the target data signal are used as the target signal.
[0020] Optionally, the calibration unit includes an upper boundary calibration module, a lower boundary calibration module, a global calibration module and a determination module; the calibration unit is used to calibrate the multiple clock channels when the clock unit does not have the clock calibration value, obtain the clock calibration value, and output it to the clock unit, including:
[0021] The upper boundary calibration module is used to perform upper boundary calibration according to the upper boundary default value to obtain the upper boundary calibration value;
[0022] The lower boundary calibration module is used to perform lower boundary calibration according to the lower boundary default value to obtain a lower boundary calibration value;
[0023] The global calibration is used to perform global calibration according to a global default value to obtain a global calibration value when the upper boundary calibration value is the same as the lower boundary calibration value;
[0024] The determination module is used to determine the clock calibration value and output it to the clock unit when the upper boundary calibration value is different from the lower boundary calibration value or when the global calibration value meets the requirements.
[0025] Optionally, the clock unit is used to adjust the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and output the target clock signal to the processing unit and the controller, including:
[0026] The clock unit is used to determine the delay beat number according to the clock calibration value, adjust the phase of the clock signal according to the delay beat number and the high-frequency clock signal, obtain the target clock signal, and output the target clock signal to the processing unit and the controller; wherein the frequency of the clock signal is less than the frequency of the high-frequency clock signal.
[0027] Optionally, the enabling unit is connected to the multiple controllers via an enabling switch, and the enabling switch is used to control the controllers to operate.
[0028] Optionally, the calibration unit further includes an error reporting module;
[0029] The error reporting module is used to output an error reporting signal to the microcontroller when the global calibration value does not meet the requirements; the error reporting signal is used to indicate that the microcontroller calibration fails.
[0030] The embodiment of the present invention further discloses a data processing method, which is applied to a data storage interface device, wherein the data storage interface device comprises: a plurality of data storage interfaces, a processing unit, a clock unit and an enabling unit, and a microcontroller is connected to a controller via the data storage interface device. The method comprises:
[0031] Processing the bus signal inside the microcontroller to obtain a target signal, and outputting the target signal to a controller corresponding to the target signal;
[0032] The clock signal inside the microcontroller is adjusted according to the clock calibration value to obtain a target clock signal, and the target clock signal is output to the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same;
[0033] The chip select signal inside the microcontroller is output to the plurality of controllers; the chip select signal is used to control the communication between the microcontroller and the controllers.
[0034] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0035] The memory is used to store computer programs;
[0036] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0037] The embodiment of the present invention further discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the embodiment of the present invention.
[0038] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0039] The embodiments of the present invention include the following advantages:
[0040] A data storage interface device provided by an embodiment of the present invention is applied to a microcontroller, comprising: a processing unit, a clock unit and an enabling unit; the microcontroller is connected to multiple controllers through the data storage interface device; the processing unit is used to process a bus signal inside the microcontroller, obtain a target signal, and output the target signal to a controller corresponding to the target signal; the clock unit is used to adjust the clock signal inside the microcontroller according to a clock calibration value, obtain a target clock signal, and output the target clock signal to the processing unit and the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same; the enabling unit is used to output a chip select signal inside the microcontroller to the processing unit and the multiple controllers; the chip select signal is used to control the communication between the microcontroller and the controller.
[0041] In an embodiment of the present invention, a plurality of data storage interfaces are integrated through a data storage interface device so that parallel processing is performed between the plurality of data storage interfaces. The processing unit in the data storage interface device is used to merge similar sub-buses into a bus with a higher bandwidth, so that communication with a plurality of controllers is achieved through a high-speed interface. The problems of long backup power time caused by low-speed interfaces and large space occupied by backup power modules caused by high-speed interfaces in the prior art are solved, and an optimal combination of power consumption, current, backup power time and backup power is achieved, thereby reducing the size of the backup power module. The clock unit in the data storage interface device solves the limitation that each signal line of the parallel bus must meet the timing requirements of the same clock together, and proposes a more flexible idea of multiple sub-buses, each meeting its own timing requirements. The enabling unit in the data storage interface device can control the communication between the microcontroller and the controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a schematic diagram of an application environment provided in an embodiment of the present invention;
[0043] Figure 2 is a structural block diagram of a data storage interface device provided in an embodiment of the present invention;
[0044] Figure 3 is a logical schematic diagram of a processing unit provided in an embodiment of the present invention;
[0045] Figure 4 is a schematic diagram of the principle of a tapping method provided in an embodiment of the present invention;
[0046] Figure 5 is a schematic diagram of a phase adjustment timing provided in an embodiment of the present invention;
[0047] Figure 6is a flowchart of the steps of a clock calibration method provided in an embodiment of the present invention;
[0048] Figure 7 is a flowchart of a single-channel clock calibration method provided in an embodiment of the present invention;
[0049] Figure 8 is a flowchart of the steps of an upper boundary clock calibration method provided in an embodiment of the present invention;
[0050] Fig. 9 is a flowchart of the steps of a lower boundary clock calibration method provided in an embodiment of the present invention;
[0051] Fig.10 is a flowchart of the steps of a global clock calibration method provided in an embodiment of the present invention;
[0052] Fig.11 is a flow chart of steps of a data processing method provided in an embodiment of the present invention;
[0053] Fig.12 is a schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention;
[0054] Fig.13 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0056] Generally, an MCU supports multiple SPI / QSPI interfaces. The main function of the external flash of the QSPI interface is to store the startup code and some information that needs to be saved when the power is off. When the system is abnormally powered off, the MCU will use the power provided by the capacitor / backup energy storage circuit on the circuit board to quickly store the data in the external flash. The whole process usually takes dozens of milliseconds. If the amount of data is large, it will not be able to be stored in time. If the amount of data is reduced, the information record will be incomplete.
[0057] The relationship between the amount of stored data and the duration is: interface rate * backup power duration ∝ amount of stored data.
[0058] To increase the amount of stored data, it is necessary to increase the interface rate or the backup power time. Increasing the backup power time requires increasing the power capacity, which will correspondingly increase the cost and volume of the equipment, and also bring about problems with power reliability.
[0059] Problems with existing power backup solutions:
[0060] 1. When using a low-end MCU without a high-speed flash memory interface, the interface speed is slow and the data backup time is long, the backup power must be increased, and the number of backup supercapacitors must be increased, resulting in increased cost and volume.
[0061] 2. Using high-end CPUs, the flash memory interface speed is high and the chip cost is high; the power consumption of the whole machine increases, the required current is also large, and the backup supercapacitor that supports large current is larger and more expensive, which cannot reduce the product cost and volume.
[0062] There are usually two ways to increase the interface rate: increasing the interface clock rate and increasing the bit width. The maximum interface rate supported by the currently used SPI flash is fixed and cannot be increased. An embodiment of the present invention provides a data storage interface device, which realizes the interface rate by merging multiple QSPI interfaces on a low-cost MCU to increase the total interface bit width.
[0063] The core of the embodiment of the present invention is based on the existing QSPI interface protocol, and integrates multiple QSPI interfaces into a multi-channel parallel QSPI bus system (data storage interface device) at a higher level to improve the external storage rate of the MCU.
[0064] Reference Figure 1 , shows a schematic diagram of an application environment provided in an embodiment of the present invention, a data storage interface device is provided in the microcontroller, and the microcontroller is connected to multiple controllers through the data storage interface device, so as to realize communication with multiple controllers through a high-speed interface. The data storage interface device is mainly implemented by three parts: a processing unit, a clock unit and an enabling unit, and these three units are all implemented by FPGA (Field Programmable Gate Array) digital logic.
[0065] To facilitate the description of the subsequent design scheme, in the embodiment of the present invention, a 16-bit wide parallel QSPI bus system is composed of 4 channels of QSPI to describe the design principle. The specific project design can flexibly configure the number of channels according to the actual quantity requirements. For example, a 32-bit wide parallel QSPI bus system can be composed of 8 channels of QSPI, and then 8 controllers can be connected externally, and so on.
[0066] Reference Figure 2 , shows an interface block diagram of a data storage interface device provided in an embodiment of the present invention, which may specifically include the following units:
[0067] The processing unit 201 is used to process the bus signal inside the microcontroller, obtain the target signal, and output the target signal to the controller corresponding to the target signal;
[0068] In the embodiment of the present invention, the processing unit is mainly used to receive the bus signal inside the microcontroller. After processing the bus signal, it is divided into 4 QSPI signals and sent to 4 external controllers (SPI flash) at the same time.
[0069] Specifically, refer to Figure 3 , shows a logical schematic diagram of a processing unit provided in an embodiment of the present invention, the processing unit includes three parts: a control address module, a data processing module and a signal selector.
[0070] The control address module receives the control and address signals of the internal bus, and converts the formats of the control and address signals. The control and address signals are evenly divided into 4 identical parts, and sent to 4 controllers (SPI flash) through the signal selector. The control and command of each peripheral SPI flash interface are completely consistent, and the 4 SPI flashes are controlled at the same time, and the control functions are also completely consistent.
[0071] The data processing module transmits the data signals from the bus in parallel according to the target bit width.
[0072] The signal selector selects the control address module when transmitting the control and address signals, and selects the data processing module when transmitting the data signal.
[0073] In the processing unit, no matter it is a control signal, address signal or data signal, the four ports transmitting outwards must refer to the clock signal of the port. Figure 1 As shown, the reference clock bit of signal lines D0-D3 is CLK0, the reference clock bit of signal lines D4-D7 is CLK1, and so on.
[0074] Through the processing unit provided in the embodiment of the present invention, the bus signal can be processed uniformly and the processed target signal can be split. This parallel processing and transmission method improves the efficiency and speed of the data storage interface in processing data. The control and command of each controller are completely consistent through the control address module, which simplifies the design and implementation of the data storage interface device and reduces the complexity. The control address module or the data processing module can be selected as needed through the signal selector. This flexible signal selection mechanism enables the data storage interface device to adapt to different application scenarios and requirements. In addition, each signal port for outward transmission refers to the clock signal of this port, ensuring the synchronization and accuracy of signal transmission, thereby improving the reliability and stability of the data storage interface device. Through parallel processing and transmission of data, the processing unit can more effectively utilize the resources of the data storage interface device, reduce resource waste, and improve overall performance.
[0075] The clock unit 202 is used to adjust the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and output the target clock signal to the processing unit and the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same;
[0076] like Figure 1 As shown, the unified clock from the data storage interface device to each QSPI interface is divided into 4 paths. After each clock passes through a clock unit, it is divided into two paths, one of which is sent to the external QSPI interface CLK and the other is sent to the internal processing unit as the reference clock of the corresponding four data lines. The function of the clock unit is to independently adjust the phase of the output 4 target clock signals.
[0077] In the embodiment of the present invention, the total parallel interface clock is divided into 4 parts, and the clock unit on each clock compensates for the signal delay difference between the four external controllers (SPI flash) by adjusting the phase of the clock signal, so that the 16 signal lines and clock lines of the parallel interface do not need to be of equal length. It is only necessary that the CLK, D0-D3 signals of each QSPI interface in the four external QSPI interfaces are of equal length, so that the routing of each external controller device can be designed by itself without being related to the routing length of the other three controller devices. Therefore, there will be no restrictions on the placement of each controller device, which is beneficial to PCB (Printed Circuit Board) design.
[0078] In the embodiment of the present invention, the clock unit uses a beat method to adjust the phase. Figure 4 , showing a schematic diagram of a beat method principle provided in an embodiment of the present invention, a high-frequency clock signal HCLK is used to beat the input low-frequency clock signal CLK on the rising edge, referring to Figure 5 , shows a schematic diagram of a phase adjustment timing provided in an embodiment of the present invention, where the clock signal CLK is delayed by one HCLK signal cycle for each beat. The specific delay can be determined by setting the clock calibration value in the clock unit.
[0079] Through the clock unit provided in the embodiment of the present invention, the clock signal inside the microcontroller can be adjusted according to the clock calibration value to ensure that the output target clock signal has an accurate phase, so as to synchronize the operations of multiple controllers (SPI flash), simplify PCB design, reduce the complexity of layout and wiring, and also solve the problem of signal integrity caused by inconsistent routing lengths.
[0080] The enabling unit 203 is used to output a chip select signal inside the microcontroller to the processing unit and the plurality of controllers; the chip select signal is used to control the communication between the microcontroller and the controllers.
[0081] In an embodiment of the present invention, the total chip select (CS) signal is sent to the processing unit and the peripheral controller device through the enabling unit. When the chip select signal is at a low level, the peripheral controller device is enabled, that is, when the chip select signal is at a low level, the peripheral controller device will respond to the microcontroller, and when the chip select signal is at a high level, the peripheral controller device will not respond to the microcontroller.
[0082] Through the enabling unit in the embodiment of the present invention, the communication between different controllers and microcontrollers can be flexibly controlled. This flexibility enables the data storage interface device to adapt to different application scenarios and requirements, while also facilitating expansion and upgrading. It can also simplify the communication control logic in the design of the data storage interface device, eliminating the need to implement complex communication control mechanisms separately on each controller, thereby reducing the complexity of the design and the difficulty of implementation.
[0083] In an embodiment of the present invention, a plurality of data storage interfaces are integrated through a data storage interface device so that parallel processing is performed between the plurality of data storage interfaces. The processing unit in the data storage interface device is used to merge similar sub-buses into a bus with a higher bandwidth, so that communication with a plurality of controllers is achieved through a high-speed interface. The problems of long backup power time caused by low-speed interfaces and large space occupied by backup power modules caused by high-speed interfaces in the prior art are solved, and an optimal combination of power consumption, current, backup power time and backup power is achieved, thereby reducing the size of the backup power module. The clock unit in the data storage interface device solves the limitation that each signal line of the parallel bus must meet the timing requirements of the same clock together, and proposes a more flexible idea of multiple sub-buses, each meeting its own timing requirements. The enabling unit in the data storage interface device can control the communication between the microcontroller and the controller.
[0084] In one embodiment of the present invention, the clock unit 202 is connected to the controller via a clock channel, and the device further includes: a calibration unit;
[0085] The calibration unit is used to check whether the clock calibration value is stored in the clock unit;
[0086] The calibration unit is used for calibrating the clock channel when the clock unit does not have the clock calibration value, obtaining the clock calibration value, and outputting the value to the clock unit.
[0087] In an embodiment of the present invention, in addition to the processing unit, the clock unit and the enabling unit, the data storage interface device also includes a calibration unit. A clock calibration method is implemented by the calibration unit to automatically calculate the optimal configuration value (clock calibration value) in the clock unit corresponding to each clock signal for different PCB boards.
[0088] Reference Figure 6 , shows a step flow chart of a clock calibration method provided in an embodiment of the present invention, specifically: after the system is powered on, it is necessary to check whether there is calibrated data (clock calibration value) inside the clock unit. If so, clock calibration is not performed. If not, single-channel clock calibration is performed on all channels in turn. After all channels are calibrated, the calibration process is exited.
[0089] The calibration method in the embodiment of the present invention only needs to be calibrated when powered on for the first time, and the clock calibration value obtained by the initial calibration is directly used for subsequent startup. Calibration starts from the default configuration value, which saves time and improves efficiency for applications with large data volumes. The correctness of the calibration boundary can be detected in the first place, and problems can be found when the product leaves the factory, saving maintenance costs.
[0090] In one embodiment of the present invention, the bus signal includes a control signal, an address signal and a data signal, and the processing unit includes a control address module, a data processing module and a signal selector; the processing unit 201 is used to process the bus signal inside the microcontroller to obtain a target signal, and output the target signal to the controller corresponding to the target signal, including:
[0091] The connection relationship between the control address module and the signal selector depends on whether the microcontroller needs to transmit the control signal and the address signal, and the connection relationship between the data processing module and the signal selector depends on whether the microcontroller needs to transmit the data signal; the connection relationship includes a connection relationship and a disconnection relationship;
[0092] The control address module is used to perform format conversion and equal division on the control signal and the address signal, and output the obtained target control signal and the target address signal to the controller corresponding to the target control signal and the target address signal;
[0093] The data processing module is used to divide the data signal according to the target bit width, and output the obtained target data signal to the controller corresponding to the target data signal;
[0094] The signal selector is used to determine the controllers corresponding to the target control signal, the target address signal and the target data signal respectively;
[0095] The target control signal, the target address signal and the target data signal are used as the target signal.
[0096] like Figure 3 As shown, the processing unit includes three parts: a control address module, a data processing module and a signal selector.
[0097] The control address module receives the control and address signals of the internal bus and converts them into the control and command format of the QSPI protocol. The 16 control signals are divided into 4 identical parts in the manner of 0-3, 4-7, 8-11, 12-15, and sent to 4 controllers (SPI flash) through the signal selector. The control and command of each peripheral SPI flash interface are exactly the same. The 4 SPI flashes are controlled at the same time, and the control functions are also exactly the same. Here, the control and address signal allocation process is preset at the initial design, and the control and address signals are made into the same signal. Then, the signal line between the processing unit and the controller is connected, so that the 0-3, 4-7, 8-11, 12-15 method can be divided into 4 identical parts and sent to the 4 controllers (SPI flash) through the signal selector.
[0098] The data processing module divides the data signal from the bus into 16-bit bits and transmits them in parallel according to the 16-bit width (target bit width), that is, 0-3 bits are sent to the first flash, 4-7 bits are sent to the second flash, 8-11 bits are sent to the third flash, and 12-15 bits are sent to the fourth flash.
[0099] The signal selector selects the control address module when transmitting the control and address signals, and selects the data processing module when transmitting the data signal.
[0100] In the processing unit, no matter it is a control signal, address signal or data signal, the four ports transmitting outwards must refer to the clock signal of the port. Figure 1 As shown, the reference clock bit of signal lines D0-D3 is CLK0, the reference clock bit of signal lines D4-D7 is CLK1, and so on.
[0101] Through the processing unit provided in the embodiment of the present invention, the bus signal can be processed uniformly and the processed target signal can be split. This parallel processing and transmission method improves the efficiency and speed of the data storage interface in processing data. The control and command of each controller are completely consistent through the control address module, which simplifies the design and implementation of the data storage interface device and reduces the complexity. The control address module or the data processing module can be selected as needed through the signal selector. This flexible signal selection mechanism enables the data storage interface device to adapt to different application scenarios and requirements. In addition, each signal port for outward transmission refers to the clock signal of this port, ensuring the synchronization and accuracy of signal transmission, thereby improving the reliability and stability of the data storage interface device. Through parallel processing and transmission of data, the processing unit can more effectively utilize the resources of the data storage interface device, reduce resource waste, and improve overall performance.
[0102] In an embodiment of the present invention, the calibration unit includes an upper boundary calibration module, a lower boundary calibration module, a global calibration module and a determination module; the calibration unit is used to calibrate the multiple clock channels when the clock unit does not have the clock calibration value, obtain the clock calibration value, and output it to the clock unit, including:
[0103] The upper boundary calibration module is used to perform upper boundary calibration according to the upper boundary default value to obtain the upper boundary calibration value;
[0104] The lower boundary calibration module is used to perform lower boundary calibration according to the lower boundary default value to obtain a lower boundary calibration value;
[0105] The global calibration is used to perform global calibration according to a global default value to obtain a global calibration value when the upper boundary calibration value is the same as the lower boundary calibration value;
[0106] The determination module is used to determine the clock calibration value and output it to the clock unit when the upper boundary calibration value is different from the lower boundary calibration value or when the global calibration value meets the requirements.
[0107] In an embodiment of the present invention, the calibration unit includes an upper boundary calibration module, a lower boundary calibration module, a global calibration module and a determination module, and a single-channel clock calibration method is implemented by the upper boundary calibration module, the lower boundary calibration module, the global calibration module and the determination module.
[0108] Reference Figure 7, showing a flow chart of the steps of a single-channel clock calibration method provided in an embodiment of the present invention, specifically: enter the single-channel clock calibration, allow the channel signal to be output, configure the peripheral SPI flash (controller) of this channel to enter the QSPI mode; then perform the upper boundary calibration through the upper boundary calibration module, and perform the lower boundary calibration through the lower boundary calibration module. If the upper boundary calibration value is equal to the lower boundary calibration value, it means that the default value used will cause the QSPI interface to be unable to communicate normally. At this time, enter the global calibration through the global calibration module. After the global calibration is completed, if all the global calibration values do not meet the requirements, the system reports an error. If the upper boundary and the lower boundary are different, or the global calibration value obtained by the global calibration meets the requirements, the range of the system's available clock calibration values can be obtained through the determination module, and the midpoint of the range is taken as the delay value (clock calibration value) after the system calibration. After the clock calibration is completed, the calibration flag of this channel will be modified to calibrated, and the single-channel calibration will be exited.
[0109] Reference Figure 8 , shows a flow chart of the steps of an upper boundary clock calibration method provided in an embodiment of the present invention, specifically: enter the upper boundary calibration, the first step is to read the upper boundary default value delay1, and use the upper boundary default value configuration to write and read the three addresses of the flash once respectively, and the codeword written each time is different. Compare the written and read data, if all three times are correct, delay1+1 continues to check until the check fails, and the upper boundary calibration value is obtained. In the embodiment of the present invention, multiple addresses of the flash can be written and read once respectively, and the number of addresses can be set to 2, 3 or even more, which is not limited in the embodiment of the present invention.
[0110] Reference Fig. 9 , shows a flow chart of the steps of a lower boundary clock calibration method provided in an embodiment of the present invention, specifically: enter the lower boundary calibration, the first step is to read the lower boundary default value delay2, and use the lower boundary default value configuration to write and read the three addresses of the flash once respectively, and the codeword written each time is different. Compare the written and read data, if all three times are correct, delay2-1 continues to check until the check fails, and the lower boundary calibration value is obtained. In the embodiment of the present invention, multiple addresses of the flash can be written and read once respectively, and the number of addresses can be set to 2, 3 or even more, which is not limited in the embodiment of the present invention.
[0111] In an embodiment of the present invention, the upper boundary default value delay1 and the lower boundary default value delay2 can use the same default value for boundary calibration. For example, in the case of a clock cycle of 8, 4 is selected as the upper boundary default value delay1 and the lower boundary default value delay2. When the upper boundary default value is used for upper boundary calibration, delay1+1 is continuously checked until an error occurs when checking to 7, and 6 is used as the upper boundary calibration value. When the lower boundary default value is used for lower boundary calibration, delay2-1 is continuously checked until an error occurs when checking to 1, and 2 is used as the lower boundary calibration value. According to the upper boundary calibration value 6 and the lower boundary calibration value 2, the clock calibration range 2-6 can be obtained, and the middle value 4 is determined as the clock calibration value.
[0112] In another embodiment of the present invention, for example, when a clock cycle is 8, 4 is selected as the upper boundary default value delay1 and the lower boundary default value delay2. When the upper boundary default value is used for upper boundary calibration, an error occurs. In this case, 4 is used as the upper boundary calibration value. When the lower boundary default value is used for lower boundary calibration, an error occurs. In this case, 4 is also used as the lower boundary calibration value. In this case, the upper boundary calibration value 4 is the same as the lower boundary calibration value 4, and the clock calibration value cannot be determined. In this case, global clock calibration needs to be performed through the global module.
[0113] Reference Fig.10 , shows a flow chart of the steps of a global clock calibration method provided in an embodiment of the present invention, specifically: enter global calibration, set the global default value delay3 to 0, start calibration from 0, write and read the three addresses of the flash once each time, and the codeword written each time is different. Compare the written and read data, if all three times are correct, delay3+1 continues to check until the check fails, and the delay value boundary is obtained. In an embodiment of the present invention, multiple addresses of the flash can be written and read once respectively, and the number of addresses can be set to 2, 3 or even more, which is not limited in the embodiment of the present invention.
[0114] In the embodiment of the present invention, when a clock cycle is 8, 0 is selected as the global default value delay3, and calibration starts from 0, and delay3+1 is continuously checked until an error occurs when checking to 7, and 6 is used as the global calibration value. According to the global calibration value 6, the clock calibration range 0-6 can be obtained, and the middle value 3 is determined as the clock calibration value.
[0115] The calibration method in the embodiment of the present invention only needs to be calibrated when powered on for the first time, and the clock calibration value obtained by the initial calibration is directly used for subsequent startup. Calibration starts from the default configuration value, which saves time and improves efficiency for applications with large data volumes. The correctness of the calibration boundary can be detected in the first place, and problems can be found when the product leaves the factory, saving maintenance costs.
[0116] In one embodiment of the present invention, the clock unit 202 is used to adjust the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and output the target clock signal to the processing unit and the controller, including:
[0117] The clock unit 202 is used to determine the delay beat number according to the clock calibration value, adjust the phase of the clock signal according to the delay beat number and the high-frequency clock signal, obtain the target clock signal, and output the target clock signal to the processing unit and the controller; wherein the frequency of the clock signal is less than the frequency of the high-frequency clock signal.
[0118] In the embodiment of the present invention, the clock unit uses a beat method to adjust the phase. The specific principle and timing diagram are as follows: Figure 4 and Figure 5 As shown. A high-frequency clock signal HCLK is used to beat the rising edge of the input low-frequency clock signal CLK. Each time it is beaten, the clock signal CLK will be delayed by one HCLK signal cycle. The specific delay is determined by the clock calibration value setting in the clock unit.
[0119] The high-frequency clock signal HCLK in the embodiment of the present invention can directly select the main clock signal in the microcontroller, that is, the highest system clock signal. By directly using the main clock signal inside the microcontroller as the high-frequency clock signal required for the beat method, the demand for an external clock source and additional external circuits is reduced, the circuit design is simplified, and the size of the backup power module is reduced, and the cost and complexity can also be reduced.
[0120] Among them, the maximum number of delayed beats n = CLK cycle / HCLK cycle, the greater the frequency difference between the two signals, the finer the delay adjustment. Generally speaking, a difference of one cycle is within the error range, but in actual applications, there are only very few cases where the difference is more than one cycle. For example, in PCB design, a signal line needs to wrap around the PCB board several times before this happens, but in normal PCB design, this situation basically does not occur, that is, the number of delayed beats basically does not exceed n. Therefore, the maximum number of delayed beats n can be used as a preventive measure to prevent this situation from occurring in actual operation, and an error mechanism can be executed in time.
[0121] The beat delay method is limited by the frequency of the high-frequency clock. For low-cost applications, the delay time is generally in the ns level. If a finer delay of the ps level is required, it is necessary to use the DLL delay circuit commonly used in digital circuits to implement the clock unit.
[0122] Through the clock unit provided in the embodiment of the present invention, the clock signal inside the microcontroller can be adjusted according to the clock calibration value to ensure that the output target clock signal has an accurate phase, so as to synchronize the operations of multiple controllers (SPI flash), simplify PCB design, reduce the complexity of layout and wiring, and also solve the problem of signal integrity caused by inconsistent routing lengths.
[0123] In an embodiment of the present invention, the enabling unit 203 is connected to the plurality of controllers via an enabling switch, and the enabling switch is used to control the controllers to work.
[0124] In an embodiment of the present invention, the total chip select (CS) signal is sent to the processing unit and the peripheral controller device through the enabling unit. When the chip select signal is at a low level, the peripheral controller device is enabled, that is, when the chip select signal is at a low level, the peripheral controller device will respond to the microcontroller, and when the chip select signal is at a high level, the peripheral controller device will not respond to the microcontroller.
[0125] An enable switch can be added to the signal line from the enable unit to the controller device of each peripheral device. The enable switch can flexibly control whether each controller device is working, which is similar to the role of DDR (Double Data Rate) bus DM (Data Mask).
[0126] Through the enabling unit in the embodiment of the present invention, the communication between different controllers and microcontrollers can be flexibly controlled. This flexibility enables the data storage interface device to adapt to different application scenarios and requirements, while also facilitating expansion and upgrading. It can also simplify the communication control logic in the design of the data storage interface device, eliminating the need to implement complex communication control mechanisms separately on each controller, thereby reducing the complexity of the design and the difficulty of implementation.
[0127] In one embodiment of the present invention, the calibration unit further includes an error reporting module;
[0128] The error reporting module is used to output an error reporting signal to the microcontroller when the global calibration value does not meet the requirements; the error reporting signal is used to indicate that the microcontroller calibration fails.
[0129] In an embodiment of the present invention, the calibration unit includes, in addition to the upper boundary calibration module, the lower boundary calibration module, the global calibration module and the determination module, an error reporting module so that when the QSPI interface cannot communicate normally, an error signal is output to indicate that the interface in the microcontroller is unavailable at this time.
[0130] In the embodiment of the present invention, by detecting the correctness of the calibration boundary, errors can be detected immediately, and problems can be found when the product leaves the factory, thus saving maintenance costs.
[0131] In an embodiment of the present invention, a plurality of data storage interfaces are integrated through a data storage interface device so that parallel processing is performed between the plurality of data storage interfaces. The processing unit in the data storage interface device is used to merge similar sub-buses into a bus with a higher bandwidth, so that communication with a plurality of controllers is achieved through a high-speed interface. The problems of long backup power time caused by low-speed interfaces and large space occupied by backup power modules caused by high-speed interfaces in the prior art are solved, and an optimal combination of power consumption, current, backup power time and backup power is achieved, thereby reducing the size of the backup power module. The clock unit in the data storage interface device solves the limitation that each signal line of the parallel bus must meet the timing requirements of the same clock together, and proposes a more flexible idea of multiple sub-buses, each meeting its own timing requirements. The enabling unit in the data storage interface device can control the communication between the microcontroller and the controller.
[0132] Relying on the existing QSPI interface form, a high-speed data storage interface device is provided for low-cost MCUs, and a low-cost, low-power solution is provided for non-volatile storage application scenarios requiring an interface rate of 200Mbps to 1500Mbps. In the data storage interface device, the combinational logic of merging similar sub-buses into a bus with a higher bandwidth realizes the optimal combination of power consumption, current, backup power duration, and backup power, which is suitable for some application scenarios with moderate access speed requirements, such as scenarios where the use of ONFI (Open NAND Flash Interface, an open standard interface) interface is too wasteful and the use of a single QSPI interface is too slow. It can not only solve the problems of long backup time due to low speed and large backup power module due to high speed in the existing backup power solution, but also solve the limitation that each signal line of the parallel bus must meet the timing requirements of the same clock together, and divide the bus into multiple sub-buses, each of which meets its own timing requirements, reducing the difficulty of hardware design.
[0133] In addition, a data storage interface device provided in an embodiment of the present invention is a function expanded outside the QSPI interface module. If the data storage interface device is not used, it will not affect the normal use of the original SPI / QSPI interface. It has high practicality and extensibility, and enables low-cost MCU to quickly back up power and save data.
[0134] Reference Fig.11 , shows a flow chart of the steps of a data processing method provided in an embodiment of the present invention, which may specifically include the following steps:
[0135] Step 1101, processing the bus signal inside the microcontroller to obtain a target signal, and outputting the target signal to a controller corresponding to the target signal;
[0136] Step 1102: adjusting the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and outputting the target clock signal to the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same;
[0137] Step 1103, outputting a chip select signal inside the microcontroller to the plurality of controllers; the chip select signal is used to control the communication between the microcontroller and the controllers.
[0138] As for the method embodiment, since it is basically similar to the device embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the device embodiment.
[0139] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned data storage interface device embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0140] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned data storage interface device embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0141] An embodiment of the present invention also provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned data storage interface device embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0142] Fig.12 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0143] The electronic device 1200 includes but is not limited to: a radio frequency unit 1201, a network module 1202, an audio output unit 1203, an input unit 1204, a sensor 1205, a display unit 1206, a user input unit 1207, an interface unit 1208, a memory 1209, a processor 1210, and a power supply 1211. Those skilled in the art will appreciate that Fig.12 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0144] It should be understood that in the embodiment of the present invention, the radio frequency unit 1201 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 1210 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 1201 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 1201 can also communicate with the network and other devices through a wireless communication system.
[0145] The electronic device provides users with wireless broadband Internet access through the network module 1202, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0146] The audio output unit 1203 can convert the audio data received by the RF unit 1201 or the network module 1202 or stored in the memory 1209 into an audio signal and output it as sound. Moreover, the audio output unit 1203 can also provide audio output related to a specific function performed by the electronic device 1200 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 1203 includes a speaker, a buzzer, a receiver, etc.
[0147] The input unit 1204 is used to receive audio or video signals. The input unit 1204 may include a graphics processor (GPU) 12041 and a microphone 12042. The graphics processor 12041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 1206. The image frame processed by the graphics processor 12041 can be stored in the memory 1209 (or other storage medium) or sent via the radio frequency unit 1201 or the network module 1202. The microphone 12042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 1201 in the case of a telephone call mode.
[0148] The electronic device 1200 also includes at least one sensor 1205, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 12061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 12061 and / or the backlight when the electronic device 1200 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 1205 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0149] The display unit 1206 is used to display information input by the user or information provided to the user. The display unit 1206 may include a display panel 12061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0150] The user input unit 1207 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 1207 includes a touch panel 12071 and other input devices 12072. The touch panel 12071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch panel 12071). The touch panel 12071 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact point coordinates, and then sends it to the processor 1210, receives the command sent by the processor 1210 and executes it. In addition, the touch panel 12071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 12071, the user input unit 1207 may also include other input devices 12072. Specifically, other input devices 12072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
[0151] Furthermore, the touch panel 12071 may be overlaid on the display panel 12061. When the touch panel 12071 detects a touch operation on or near it, it is transmitted to the processor 1210 to determine the type of touch event. Then, the processor 1210 provides corresponding visual output on the display panel 12061 according to the type of touch event. Fig.12 In the figure, the touch panel 12071 and the display panel 12061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 12071 and the display panel 12061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0152] The interface unit 1208 is an interface for connecting an external device to the electronic device 1200. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 1208 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 1200 or may be used to transmit data between the electronic device 1200 and an external device.
[0153] The memory 1209 can be used to store software programs and various data. The memory 1209 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 1209 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0154] The processor 1210 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 1209 and calling data stored in the memory 1209, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 1210 may include one or more processing units; preferably, the processor 1210 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1210.
[0155] The electronic device 1200 may also include a power supply 1211 (such as a battery) for supplying power to each component. Preferably, the power supply 1211 may be logically connected to the processor 1210 via a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system.
[0156] In addition, the electronic device 1200 includes some functional modules not shown, which will not be described in detail here.
[0157] like Fig.13 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 1301 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the data storage interface device described in the above embodiment.
[0158] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0159] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0160] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0161] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0162] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0163] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0164] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0166] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0167] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data storage interface device, characterized in that: Applied to a microcontroller, the device comprises: a processing unit, a clock unit and an enabling unit; The microcontroller is connected to a plurality of controllers via the data storage interface device; The processing unit is used to process the bus signal inside the microcontroller to obtain a target signal, and output the target signal to a controller corresponding to the target signal; The clock unit is used to adjust the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and output the target clock signal to the processing unit and the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same; The enabling unit is used to output a chip select signal inside the microcontroller to the processing unit and the plurality of controllers; the chip select signal is used to control the communication between the microcontroller and the controllers.
2. The data storage interface device according to claim 1, characterized in that: The clock unit is connected to the controller via a clock channel, and the device further comprises: a calibration unit; The calibration unit is used to check whether the clock calibration value is stored in the clock unit; The calibration unit is used for calibrating the clock channel when the clock unit does not have the clock calibration value, obtaining the clock calibration value, and outputting the value to the clock unit.
3. The data storage interface device according to claim 1, characterized in that: The bus signal includes a control signal, an address signal and a data signal, and the processing unit includes a control address module, a data processing module and a signal selector; the processing unit is used to process the bus signal inside the microcontroller, obtain a target signal, and output the target signal to the controller corresponding to the target signal, including: The connection relationship between the control address module and the signal selector depends on whether the microcontroller needs to transmit the control signal and the address signal, and the connection relationship between the data processing module and the signal selector depends on whether the microcontroller needs to transmit the data signal; the connection relationship includes a connection relationship and a disconnection relationship; The control address module is used to perform format conversion and equal division on the control signal and the address signal, and output the obtained target control signal and the target address signal to the controller corresponding to the target control signal and the target address signal; The data processing module is used to divide the data signal according to the target bit width, and output the obtained target data signal to the controller corresponding to the target data signal; The signal selector is used to determine the controllers corresponding to the target control signal, the target address signal and the target data signal respectively; The target control signal, the target address signal and the target data signal are used as the target signal.
4. The data storage interface device according to claim 2, characterized in that: The calibration unit includes an upper boundary calibration module, a lower boundary calibration module, a global calibration module and a determination module; the calibration unit is used to calibrate the multiple clock channels when the clock unit does not have the clock calibration value, obtain the clock calibration value, and output it to the clock unit, including: The upper boundary calibration module is used to perform upper boundary calibration according to the upper boundary default value to obtain the upper boundary calibration value; The lower boundary calibration module is used to perform lower boundary calibration according to the lower boundary default value to obtain a lower boundary calibration value; The global calibration is used to perform global calibration according to a global default value to obtain a global calibration value when the upper boundary calibration value is the same as the lower boundary calibration value; The determination module is used to determine the clock calibration value and output it to the clock unit when the upper boundary calibration value is different from the lower boundary calibration value or when the global calibration value meets the requirements.
5. The data storage interface device according to claim 1, characterized in that: The clock unit is used to adjust the clock signal inside the microcontroller according to the clock calibration value to obtain a target clock signal, and output the target clock signal to the processing unit and the controller, including: The clock unit is used to determine the delay beat number according to the clock calibration value, adjust the phase of the clock signal according to the delay beat number and the high-frequency clock signal, obtain the target clock signal, and output the target clock signal to the processing unit and the controller; wherein the frequency of the clock signal is less than the frequency of the high-frequency clock signal.
6. The data storage interface device according to claim 1, characterized in that: The enabling unit is connected to the plurality of controllers via an enabling switch, and the enabling switch is used to control the controllers to work.
7. The data storage interface device according to claim 4, characterized in that: The calibration unit also includes an error reporting module; The error reporting module is used to output an error reporting signal to the microcontroller when the global calibration value does not meet the requirements; the error reporting signal is used to indicate that the microcontroller calibration fails.
8. A data processing method, characterized in that: Applied to a data storage interface device, the data storage interface device comprises: a plurality of data storage interfaces, a processing unit, a clock unit and an enabling unit, a microcontroller is connected to a controller via the data storage interface device, and the method comprises: Processing the bus signal inside the microcontroller to obtain a target signal, and outputting the target signal to a controller corresponding to the target signal; The clock signal inside the microcontroller is adjusted according to the clock calibration value to obtain a target clock signal, and the target clock signal is output to the controller; the clock calibration value is used to adjust the phase of the clock signal so that the timing of multiple target clock signals is the same; The chip select signal inside the microcontroller is output to the plurality of controllers; the chip select signal is used to control the communication between the microcontroller and the controllers.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the device according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to execute the apparatus according to any one of claims 1 to 7.
