EEPROM-like control method, EEPROM-like control device, and electronic device

By storing EEPROM-like data in mirrored memory and performing operations in mirrored memory, the problem of low data read/write efficiency due to the small bit width of EEPROM-like data is solved, and efficient data read/write control is achieved.

CN115687169BActive Publication Date: 2026-02-10BYD SEMICON CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110851752.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-27
Publication Date
2026-02-10
Estimated Expiration
2041-07-27

AI Technical Summary

Technical Problem

EEPROM-like devices cannot efficiently handle read and write operations on small-bit-width data, resulting in low data read and write efficiency.

Method used

By storing EEPROM-like data in mirrored memory and performing operations within the mirrored memory, the read/write restrictions on the small bit width data of EEPROM-like memory are removed, enabling automatic read/write/erase control.

Benefits of technology

It improves data read and write efficiency, avoids the time spent waiting for EEPROM to complete read and write operations, and enhances system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115687169B_ABST
    Figure CN115687169B_ABST
Patent Text Reader

Abstract

The application discloses an EEPROM-like control method, an EEPROM-like control device and an electronic device. The EEPROM-like control method comprises the following steps: receiving a read-write instruction of an EEPROM-like device; reading data of a first access segment in which a target address is located from the EEPROM-like device and storing the data into a corresponding address space in a mirror memory, wherein the first access segment contains the target address and a plurality of access addresses continuous to the target address, the first access segment=N*the minimum access address unit of the EEPROM-like device, and N is an integer greater than or equal to 1; and operating data in the address space in the mirror memory according to the read-write instruction. The EEPROM-like control method can realize automatic read-write-erase control processing of the EEPROM-like device and improve data read-write efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of memory technology, and in particular to an EEPROM-like control method, an EEPROM-like control device, and an electronic device. Background Technology

[0002] EEPROM (Electrically Erasable Programmable Read-Only Memory) is a type of data storage widely used in MCUs (Micro Control Units). Controlling EEPROM typically involves designing a control system that corresponds to the read, write, and erase timing requirements of the EEPROM to achieve control over it.

[0003] However, since EEPROM-like ROMs cannot perform byte-level reading, writing, and erasing like real EEPROMs, the data bit width for reading, writing, and erasing in EEPROM-like ROMs is much larger than that in real EEPROMs. Therefore, when reading and writing small-bit-width data in EEPROM-like ROMs, a read-modify-write program operation is required on the original data bit width of the EEPROM-like ROM, resulting in low efficiency during data reading and writing. Summary of the Invention

[0004] The present invention aims to at least solve one of the technical problems existing in the prior art. Therefore, one objective of the present invention is to propose an EEPROM-like control method, which enables automatic read, write, and erase control of the EEPROM-like device, thereby improving data read and write efficiency.

[0005] The second objective of this invention is to provide an EEPROM-like control device.

[0006] The third objective of this invention is to provide an electronic device.

[0007] To address the aforementioned problems, a first aspect of the present invention provides an EEPROM-like control method, comprising: receiving a read / write instruction from an EEPROM-like memory; reading data from a first access segment containing a target address in the EEPROM-like memory and storing it in a corresponding address space in a mirrored memory, wherein the first access segment includes the target address and a plurality of access addresses contiguous to the target address, the first access segment = N × the smallest access address unit of the EEPROM-like memory, where N is an integer greater than or equal to 1; and operating on the data in the address space of the mirrored memory according to the read / write instruction.

[0008] According to the EEPROM-like control method of the present invention, after receiving a read / write instruction, the data of the first access segment in the EEPROM-like memory is stored in the mirror memory according to the target address corresponding to the read / write instruction. The mirror memory supports reading and writing of small-bit-width data, so the data stored in the mirror memory can be read and written according to the read / write instruction. The read / write control of the EEPROM-like memory is automatically performed using the mirror control method, thereby eliminating the read / write restriction of the EEPROM-like memory on small-bit-width data, eliminating the need to wait for the EEPROM-like memory to actually complete the read / write operation, and improving the data read / write efficiency.

[0009] In some embodiments, before reading the data of the first access segment where the target address is located in the EEPROM and storing it in the corresponding address space in the mirror memory, the method further includes: determining the data bit width according to the read / write instruction; and determining that the data bit width is less than a preset bit width.

[0010] In some embodiments, operating on the data corresponding to the target address in the mirror memory according to read / write instructions includes: in response to the read instruction of the EEPROM-like memory, determining that the data at the target address has been read into the mirror memory; and reading the data corresponding to the target address from the mirror memory to obtain the data at the target address corresponding to the EEPROM-like memory.

[0011] In some embodiments, operating on the data corresponding to the target address in the mirror memory according to the read / write instruction further includes: determining that more than a preset number of storage addresses in the mirror memory have been read out; reading out the data of the second access segment in the EEPROM that is contiguous with the tail address of the first access segment and storing it in the address space corresponding to the mirror memory.

[0012] In some embodiments, after determining that more than a preset number of storage addresses in the mirror memory have been read, the EEPROM-like control method further includes: determining that the address space in the mirror memory is full; clearing the data that has been read from the address space; and storing the data read from the EEPROM into empty address bits in sequence.

[0013] In some embodiments, operating on data in the address space of the mirror memory according to read / write instructions includes: responding to a write instruction of the EEPROM-like memory; obtaining a target address and data to be written according to the write instruction; writing the data to be written to the target address in the mirror memory; and sequentially storing the data in the mirror memory corresponding to the target address into the EEPROM-like memory.

[0014] In some embodiments, writing the data to be written to the target address in the mirror memory includes: reading all data in the mirror memory corresponding to the target address; comparing all data with the data to be written; determining that the data to be written is different from all data; and writing the data to be written to the corresponding data bit in the target address in the mirror memory.

[0015] In some embodiments, writing the data to be written to the target address in the mirrored memory further includes: determining that the data to be written is partially different from all the data; determining a first type of data bits and a second type of data bits in the target address, wherein the first type of data bits are the data bits that are different between the data to be written and all the data, and the second type of data bits are the data bits that are the same between the data to be written and all the data; and writing the data corresponding to the first type of data bits in the data to be written into the first type of data bits.

[0016] In some embodiments, the EEPROM-like control method further includes: determining that the data bit width is greater than or equal to the preset bit width; and directly performing read and write operations on the data in the EEPROM-like ROM in response to the read and write instructions of the EEPROM-like ROM.

[0017] A second aspect of the present invention provides an EEPROM-like control device, comprising: a receiving module for receiving read / write instructions from an EEPROM-like device; a data bit width determination module for determining a data bit width according to the read / write instructions; a data bit width judgment module for determining that the data bit width is less than a preset bit width; a reading module for reading data from a first access segment containing a target address in the EEPROM and storing it in the corresponding address space in a mirror memory, wherein the first access segment includes the target address and a plurality of access addresses contiguous to the target address, the first access segment = N × the smallest access address unit of the EEPROM-like device, where N is an integer greater than or equal to 1; and an operation module for operating on the data in the address space of the mirror memory according to the read / write instructions.

[0018] According to the EEPROM-like control device of the present invention, when it is determined that the data bit width is less than a preset bit width, it indicates that the bit width of the data corresponding to the read / write instruction is less than the data bit width supported by the EEPROM-like device. In this case, the read module stores the data of the first access segment in the EEPROM-like device into the mirror memory according to the target address corresponding to the read / write instruction. The mirror memory supports reading and writing of small-bit-width data. Thus, the operation module can perform read and write operations on the data stored in the mirror memory according to the read / write instruction, thereby realizing automatic read, write, and erase control processing of the EEPROM-like device using mirror control. This eliminates the read / write restriction of the EEPROM-like device on small-bit-width data, eliminates the need to wait for the EEPROM-like device to actually complete the read / write operation, and improves data read / write efficiency.

[0019] A third aspect of the present invention provides an electronic device, including: an EEPROM-like memory and a mirror memory; and a control unit, the control unit being configured to control the EEPROM-like memory according to the EEPROM-like memory control method described in the above embodiments.

[0020] According to the electronic device of the present invention, by using the EEPROM-like control method provided in the above embodiments through the control unit, automatic read, write, and erase control processing of the EEPROM-like device can be realized, thereby improving data read and write efficiency.

[0021] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0023] Figure 1 This is a flowchart of an EEPROM-like control method according to an embodiment of the present invention;

[0024] Figure 2 This is a structural block diagram of an electronic device according to an embodiment of the present invention;

[0025] Figure 3 This is a structural block diagram of an EEPROM-like control device according to an embodiment of the present invention.

[0026] Figure label:

[0027] EEPROM-like control device 10; electronic device 20;

[0028] Receive module 1; Read module 4; Operation module 5;

[0029] EEPROM-like 6; Mirror memory 7; Control unit 8;

[0030] Mode selection module 11; mirror control module 12; direct control module 13; access control module 14; general purpose memory 15. Detailed Implementation

[0031] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. The embodiments of the present invention are described in detail below.

[0032] To address the aforementioned issues, the first aspect of this invention proposes an EEPROM-like control method. By employing this EEPROM-like control method, automatic read, write, and erase control processing of the EEPROM-like device can be achieved, thereby improving data read and write efficiency.

[0033] The basic idea of ​​the EEPROM-like control method proposed in this invention is as follows: Since an EEPROM-like memory is a type of storage medium that stores data, it does not support read, write, or erase operations on small-width data. Therefore, this invention utilizes the function of mirrored memory to support read and write operations on small-width data. When performing read, write, or erase operations on the data stored in the EEPROM-like memory, the data stored in the EEPROM-like memory is mirrored and stored in the mirrored memory. By operating on the data stored in the mirrored memory, read, write, and erase control processing of the EEPROM-like memory can be achieved. Thus, the restriction on read and write operations on small-width data by the EEPROM-like memory is eliminated by using mirrored control, and automatic read, write, and erase control processing of the EEPROM-like memory is achieved. There is no need to perform read / write operations on the original data width of the EEPROM-like memory, thereby improving data read and write efficiency.

[0034] The following is for reference. Figure 1 The EEPROM-like control method provided according to embodiments of the present invention is described, such as... Figure 1 As shown, this type of EEPROM control method includes at least steps S1-S3.

[0035] Step S1: Receive read / write instructions for EEPROM-like devices.

[0036] In this embodiment, the control of the EEPROM is implemented by a control unit designed according to the read, write, and erase timing requirements of the EEPROM-like memory. In other words, the control unit receives the read and write instructions of the EEPROM-like memory.

[0037] Step S2: Read the data of the first access segment where the target address is located in the EEPROM and store it in the corresponding address space in the mirror memory. The first access segment contains the target address and several access addresses that are contiguous with the target address. The first access segment = N × the smallest access address unit of the EEPROM, where N ≥ 1.

[0038] The target address refers to the storage address in the EEPROM where the data transmitted by the read / write instruction is located.

[0039] In this embodiment, mirrored memory refers to configuring a virtual mirrored memory space for the EEPROM-like memory space. This means setting the EEPROM-like and mirrored memory, two independent physical memory spaces, as mirrors, and allocating a corresponding memory address range to the mirrored memory space so that the control unit can access the mirrored memory space through a target address. Thus, as... Figure 2 As shown, the mirror control module in the control unit sends a read command to the access control module. The access control module reads the target address to be read and several consecutive addresses thereafter, i.e., the stored data at the first access segment, from the EEPROM and places them in the address space of the mirror memory.

[0040] It is understandable that the capacity of the EEPROM-like memory space can be the same as the capacity of the mirror memory space, or the capacity of the EEPROM-like memory space can be greater than the capacity of the mirror memory space; there are no restrictions on this.

[0041] Step S3: Perform operations on the data in the address space of the mirrored memory according to the read and write instructions.

[0042] In this embodiment, based on the data of the first access segment stored in the mirror memory in step S2, when the control unit writes data to the EEPROM-like memory, it operates on the data in the mirror memory space. The data after this operation is actually written to both the EEPROM-like memory and the mirror memory simultaneously, thus achieving the writing of data stored in the EEPROM-like memory. Specifically, when the control unit performs a write instruction operation on the EEPROM-like memory, the mirror control module in the control unit directly writes the data to be written and the corresponding data address to the mirror memory and issues a write instruction to the access control module. The access control module automatically stores the data corresponding to the address in the mirror memory to the EEPROM-like memory in sequence. In this way, the mirror control method eliminates the read / write restriction of the EEPROM-like memory on small-width data, eliminating the need to wait for the EEPROM-like memory to actually complete the write operation, and achieving automatic read / write / erase control processing of the EEPROM-like memory, thereby improving data read / write efficiency.

[0043] Furthermore, when the control unit reads data from the EEPROM, it can access the data in the mirror memory space through this read instruction, thereby enabling the reading of data stored in the EEPROM.

[0044] For example, the data access address space range of an EEPROM is 0x1000_0000-0x1FFF_FFFF, and the smallest access unit is 8 bits. (Reference) Figure 2As shown, when data needs to be read from the space at address 0x1000_0000 in the EEPROM-like memory, the mirror control module sends the address information (target address) and read instruction to the access control module. The access control module retrieves all data corresponding to addresses 0x1000_0000-0x1000_000F in the first access segment of the EEPROM-like memory and places it in the space corresponding to addresses 0x1000_0000-0x1000_000F in the mirror memory. It then sends a completion instruction back to the mirror control module. Subsequently, the mirror control module in the control unit reads the data corresponding to address 0x1000_0000 from the mirror memory, completing the read operation.

[0045] According to the EEPROM-like control method of the present invention, after receiving a read / write instruction, the data of the first access segment in the EEPROM-like memory is stored in the mirror memory according to the target address corresponding to the read / write instruction. The mirror memory supports reading and writing of small-bit-width data, so the data stored in the mirror memory can be read and written according to the read / write instruction. The read / write control of the EEPROM-like memory is automatically performed using the mirror control method, thereby eliminating the read / write restriction of the EEPROM-like memory on small-bit-width data, eliminating the need to wait for the EEPROM-like memory to actually complete the read / write operation, and improving the data read / write efficiency.

[0046] In some embodiments, before reading the data of the first access segment where the target address is located in the EEPROM and storing it in the corresponding address space in the mirror memory, the method of the present invention further includes determining the data bit width according to the read / write instruction, wherein the data bit width refers to the amount of data that the read / write instruction can transmit at one time. If it is determined that the data bit width is less than the preset bit width, it means that the data bit width corresponding to the read / write instruction received by the control unit is less than the data bit width supported by the EEPROM. In this case, the present invention will use the mirror control method to perform access control on the EEPROM without having to perform read / write operations on the original data bit width of the EEPROM, thereby improving data read / write efficiency. The preset bit width refers to the data bit width that the EEPROM can support, that is, the data transmission capability that the EEPROM can provide.

[0047] In some embodiments, in response to a read instruction from the EEPROM-like memory, it is determined that the data at the target address has been read into the mirror memory, and the data at the corresponding target address is read from the mirror memory to obtain the data at the target address of the EEPROM-like memory. Thus, the control unit can directly obtain data from the mirror memory according to the read instruction without waiting for the EEPROM-like memory to complete the read operation, improving data reading efficiency.

[0048] Specifically, when a read instruction from an EEPROM-like memory is received, the control unit identifies whether the target address corresponding to the read instruction is in the first access segment. If so, it means that the data at the target address has been read into the mirror memory, and the control unit can directly read the data at the corresponding target address from the mirror memory. That is, after the access control module identifies that the read instruction is for data in a consecutive address stored in the mirror memory, the access control module sends a feedback instruction to the mirror control module to inform the mirror control module that it can directly obtain data from the mirror memory. If not, the control unit reads the data stored at the target address and several consecutive addresses after it from the EEPROM-like memory again according to the target address corresponding to the instruction, and places it in the address space of the mirror memory. This allows the control unit to access the data in the mirror memory space through the target address without waiting for the EEPROM-like memory to complete the read operation, thus improving data reading efficiency.

[0049] For example, the image memory stores data corresponding to addresses 0x1000_0000-0x1000_000F, see reference. Figure 2 As shown, when data needs to be read from the space at address 0x1000_0001 in the EEPROM, the mirror control module sends the address information and read command to the access control module. After receiving the read command, the access control module determines that the address space has been pre-read and placed in the mirror memory, and then immediately sends a read completion instruction to the mirror control module. Subsequently, the mirror control module reads the data corresponding to address 0x1000_0001 from the mirror memory, completing the read operation.

[0050] In some embodiments, if it is determined that more than a preset number of storage addresses in the mirror memory have been read, the control unit will read the data of the second access segment in the EEPROM that is contiguous with the tail address of the first access segment and store it in the address space corresponding to the mirror memory, so that the data in the mirror memory space can be accessed subsequently.

[0051] Specifically, when more than a preset number of storage addresses in the mirror memory have been read, in order to facilitate subsequent reading directly in the mirror memory, the access control module in the control unit will read the data of the second access segment in the EEPROM that is contiguous with the tail address of the first access segment, and store it in advance in the address space corresponding to the mirror memory, so as to facilitate subsequent reading operations.

[0052] The number of addresses contained in the first access segment and the number of addresses contained in the second access segment can be read according to the actual situation, and there is no limit to this.

[0053] For example, the mirrored memory stores data corresponding to addresses 0x1000_0000-0x1000_000F, that is, 16 address data entries; the default quantity is half the number of addresses to store, i.e., 8 address data entries. (Reference) Figure 2 As shown, when data needs to be read from the space at address 0x1000_0008 in the EEPROM-like memory, the mirror control module sends the address information and read command to the access control module. After receiving the command, the access control module determines that the address space has been pre-read and placed in the mirror memory, and immediately sends a read completion instruction to the mirror control module. Then, the mirror control module reads the data corresponding to address 0x1000_0008 from the mirror memory, completing the read operation. At the same time, the access control module determines that half of the previously pre-stored data in the mirror memory has been read. At this time, the access control module will retrieve all the data corresponding to addresses 0x1000_0010-0x1000_001F in the EEPROM-like memory and place it in the space corresponding to addresses 0x1000_0010 to 0x1000_001F in the mirror memory for continuous reading by the mirror control module.

[0054] In some embodiments, after determining that more than a preset number of storage addresses in the mirror memory have been read, if it is determined that the address space in the mirror memory is not full, that is, the memory space capacity is not full, the data that has been read in the mirror memory will not be cleared. Thus, when the control unit reads the data at the address that has been read again, it can still continue to read directly in the mirror memory.

[0055] For example, see reference. Figure 2 As shown, when it is necessary to reread data from the space at address 0x1000_0001 in the EEPROM, the mirror control module sends the address information and read command to the access control module. After receiving the command, the access control module determines that the address space has been pre-read and placed in the mirror memory, and then immediately sends a read completion instruction to the mirror control module. Since the data in the mirror memory is set to not be cleared after reading, the mirror control module can still read the data corresponding to address 0x1000_0001 from the mirror memory to complete the read operation.

[0056] In some embodiments, after determining that more than a preset number of storage addresses in the mirror memory have been read, if it is determined that the address space in the mirror memory is full, the data that has been read in the address space is cleared to avoid occupying memory space, so that the control unit can sequentially store the data of the second access segment read from the EEPROM into empty address bits.

[0057] In some embodiments, in response to a write instruction of the EEPROM-like memory, the target address and the data to be written are obtained according to the write instruction, the data to be written is written to the corresponding target address in the mirror memory, and the data at the corresponding target address in the mirror memory is sequentially stored in the EEPROM-like memory. Thus, the mirror control method is used to automatically perform write control processing on the EEPROM-like memory, thereby eliminating the need to wait for the EEPROM-like memory to actually complete the write operation and improving data read and write efficiency.

[0058] In some embodiments, by reading all the data in the mirror memory at the corresponding target address, comparing all the data with the data to be written, if it is determined that the data to be written is different from all the data, the data to be written is written to the corresponding data bit at the target address in the mirror memory. That is, when the write instruction is to overwrite all the data at the corresponding target address in the mirror memory, the control unit can directly overwrite the data at the corresponding target address with the new data, i.e., the data to be written, thereby completing the write operation.

[0059] For example, see reference. Figure 2 As shown, when it is necessary to write data 0x11, 0x22, ... 0xFF to the space at addresses 0x1000_3000-0x1000_300F in the EEPROM class, and completely overwrite the previously stored data, the mirror control module directly writes data 0x11, 0x22, ... 0xFF to the mirror memory corresponding to the addresses 0x1000_3000-0x1000_300F. At the same time, the mirror control module sends the address space and the corresponding write instruction to the access control module. After receiving the instruction, the access control module erases the data in the EEPROM address space 0x1000_3000-0x1000_300F in sequence and writes data 0x11, 0x22, ... 0xFF to complete the write operation.

[0060] In some embodiments, if it is determined that the data to be written is partially different from all the data, then a first type of data bit and a second type of data bit in the target address are determined. The first type of data bit is the data bit that is different from all the data, and the second type of data bit is the data bit that is the same as all the data. The data corresponding to the first type of data bit in the data to be written is written into the first type of data bit. That is, when the write instruction only modifies part of the data at the target address in the mirror memory, the control unit first reads the original data stored at the target address in the mirror memory, combines the data to be written with the original data to update it, and then writes the updated data back to the target address in the mirror memory to complete the write operation.

[0061] For example, see reference. Figure 2As shown, when it is necessary to modify a bit at address 0x1000_300F in the EEPROM, such as changing 0xFF to 0xFE, the mirror control module will first automatically read the data 0xFF corresponding to address 0x1000_300F in the mirror memory, compare it with the data to be written 0xFE, modify the different data bits to the latest data to be written, and then write the latest data to the address space 0x1000_300F corresponding to the mirror memory. At the same time, the address space and the corresponding write instruction are sent to the access control module. After receiving the write instruction, the access control module erases the data in the EEPROM address space 0x1000_300F and writes the data to 0xFE, completing the write operation.

[0062] In some embodiments, if the data bit width is determined to be greater than or equal to a preset bit width, it indicates that the data bit width corresponding to the read instruction is the data bit width supported by the ERPROM-like ROM. Therefore, in response to read / write instructions from the EEPROM-like ROM, read / write operations can be directly performed on the data in the EEPROM-like ROM without the need for mirror control. This completes the read / write / erase control processing of the EEPROM-like ROM, achieving optimal read efficiency. Simultaneously, in this case, the mirrored memory will automatically supplement general-purpose memory space to free it up for general-purpose use, expanding MCU system resources and improving resource utilization.

[0063] For example, such as Figure 2 As shown, the control unit can consist of a mode selection module, a mirror control module, and a direct control module. The mode selection module selects the corresponding control mode based on the data bit width corresponding to the read / write command. Specifically, it uses direct control mode when the data bit width is greater than or equal to a preset bit width, and mirror control mode when the data bit width is less than the preset bit width. This identifies the actual needs of read / write control to achieve optimal read / write efficiency.

[0064] A second aspect of the present invention provides an EEPROM-like control device, such as... Figure 3 As shown, this type of EEPROM control device 10 includes a receiving module 1, a reading module 4, and an operation module 5.

[0065] The receiving module 1 is used to receive read and write instructions from the EEPROM-like memory; the reading module 4 is used to read the data in the first access segment where the target address is located in the EEPROM-like memory and store it in the corresponding address space in the mirror memory. The first access segment contains the target address and several access addresses that are contiguous to the target address. The first access segment = N × the smallest access address unit of the EEPROM-like memory, where N is an integer greater than or equal to 1; the operation module 5 is used to operate on the data in the address space of the mirror memory according to the read and write instructions.

[0066] It should be noted that the specific implementation of the EEPROM-like control device 10 in this embodiment of the invention is similar to the specific implementation of the EEPROM-like control method in any of the above embodiments of the invention. For details, please refer to the description of the method section. To reduce redundancy, it will not be repeated here.

[0067] According to the EEPROM-like control device 10 of the present invention, when it is determined that the data bit width is less than the preset bit width, it indicates that the bit width of the data corresponding to the read / write instruction is less than the data bit width supported by the EEPROM. In this case, the read module 4 stores the data of the first access segment in the EEPROM into the mirror memory according to the target address corresponding to the read / write instruction. The mirror memory supports the read and write of small bit width data. Thus, the operation module 5 can perform read and write operations on the data stored in the mirror memory according to the read / write instruction, so as to realize automatic read, write, and erase control processing of the EEPROM by means of mirror control, thereby canceling the read and write restriction of the EEPROM on small bit width data, without waiting for the EEPROM to actually complete the read and write operation, and improving the data read and write efficiency.

[0068] In some embodiments, the operation module 5 is configured to respond to a read instruction from the EEPROM-like memory, determine that the data at the target address has been read into the mirror memory, and read the data at the corresponding target address from the mirror memory to obtain the data at the target address of the EEPROM-like memory. Thus, the control unit can directly obtain data from the mirror memory according to the read instruction without waiting for the EEPROM-like memory to complete the read operation, improving data reading efficiency.

[0069] Specifically, when a read instruction from an EEPROM-like memory is received, the control unit identifies whether the target address corresponding to the read instruction is in the first access segment. If so, it means that the data at the target address has been read into the mirror memory, and the control unit can directly read the data at the corresponding target address from the mirror memory. If not, the control unit reads the data stored at the target address and several consecutive addresses thereafter from the EEPROM-like memory according to the target address corresponding to the instruction, and places it in the address space of the mirror memory. This allows the control unit to access the data in the mirror memory space through the target address without waiting for the EEPROM-like memory to complete the read operation, thus improving data reading efficiency.

[0070] In some embodiments, the operation module 5 is used to determine that more than a preset number of storage addresses in the mirror memory have been read out, and to read out the data of the second access segment in the EEPROM that is contiguous with the tail address of the first access segment and store it in the address space corresponding to the mirror memory, so that the control unit can continue to access the data in the mirror memory space.

[0071] Specifically, when more than a preset number of storage addresses in the mirror memory have been read, in order to facilitate subsequent reading directly in the mirror memory, the control unit will read the data of the second access segment in the EEPROM that is contiguous with the tail address of the first access segment, and store it in advance in the address space corresponding to the mirror memory, so as to facilitate subsequent reading operations.

[0072] In some embodiments, the operation module 5 is used to determine that the address space in the mirror memory is not full, i.e. the memory space capacity is not full, after determining that the data at the storage addresses in the mirror memory has been read out. In this way, when the control unit reads the data at the address that has been read again, it can still continue to read directly in the mirror memory.

[0073] In some embodiments, the operation module 5 is used to respond to the write instruction of the EEPROM-like memory, obtain the target address and the data to be written according to the write instruction, write the data to be written to the corresponding target address in the mirror memory, and sequentially store the data corresponding to the target address in the mirror memory into the EEPROM-like memory. Thus, the mirror control method is used to realize automatic write control processing of the EEPROM-like memory, so as not to wait for the EEPROM-like memory to actually complete the write operation, thereby improving the data read and write efficiency.

[0074] In some embodiments, the operation module 5 is used to read all the data in the mirror memory at the corresponding target address, compare all the data with the data to be written, and if it is determined that the data to be written is different from all the data, then the data to be written is written to the corresponding data bit of the target address in the mirror memory. That is, when the write instruction is to overwrite all the data in the mirror memory at the corresponding target address, the control unit can directly overwrite the data at the corresponding target address with the new data, i.e., the data to be written, thereby completing the write operation.

[0075] In some embodiments, the operation module 5 is used to determine that the data to be written is partially different from all the data, and then determines the first type of data bits and the second type of data bits in the target address. The first type of data bits are the data bits that are different from all the data, and the second type of data bits are the data bits that are the same as all the data. The data corresponding to the first type of data bits in the data to be written is written into the first type of data bits. That is, when the write instruction only modifies part of the data at the target address in the mirror memory, the control unit first reads the original data stored at the target address in the mirror memory, combines the data to be written with the original data to update it, and then writes the updated data back to the target address in the mirror memory to complete the write operation.

[0076] In some embodiments, the operation module 5 determines that the data bit width is greater than or equal to a preset bit width. This indicates that the data bit width corresponding to the read instruction is the data bit width supported by the ERPROM-like ROM. Therefore, in response to read / write instructions from the EEPROM-like ROM, read / write operations can be directly performed on the data in the EEPROM-like ROM without using mirror control. This completes the read / write / erase control processing of the EEPROM-like ROM, achieving optimal read efficiency. Simultaneously, in this case, the mirror memory will automatically supplement general-purpose memory space to free it up for general-purpose use, expanding MCU system resources and improving resource utilization.

[0077] A third aspect of the present invention provides an electronic device, such as... Figure 2 As shown, the electronic device 20 includes an EEPROM-like 6, a mirror memory 7, and a control unit 8.

[0078] The control unit 8 is used to control the EEPROM 6 according to the EEPROM control method provided in the above embodiments.

[0079] Specifically, for example Figure 2 As shown, the control unit 8 may include a mode selection module 11, a mirror control module 12, a direct control module 13, and an access control module 14. The mode selection module 11 selects the corresponding control mode based on the data bit width corresponding to the read / write instruction. Specifically, when the data bit width is greater than or equal to a preset bit width, the direct control module 13 is used for read / write / erase control; or, when the data bit width is less than the preset bit width, the mirror control module 12 is used to identify the actual needs of read / write / erase control to achieve optimal read / write efficiency. When the direct control module 13 controls the access control module 14 to perform read / write / erase operations, the mirror memory 7 automatically supplements the general-purpose memory space to be used as general-purpose memory 15, expanding MCU system resources and improving resource utilization.

[0080] It should be noted that the specific implementation of the control unit 8 in this embodiment of the invention is similar to the specific implementation of the EEPROM-like control method in any of the above embodiments of the invention. For details, please refer to the description of the method section. To reduce redundancy, it will not be repeated here.

[0081] According to the electronic device 20 of the present invention, by using the EEPROM-like control method provided in the above embodiment through the control unit 8, the read, write and erase control processing of the EEPROM-like ROM 6 can be automatically realized, thereby improving the data read and write efficiency.

[0082] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0083] In the description of this specification, any process or method described in the flowcharts or otherwise herein may be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order according to the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.

[0084] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0085] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0086] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0087] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0088] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

[0089] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.

[0090] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims

1. A method for controlling an EEPROM-like system, characterized in that, include: Received read / write instructions for EEPROM-like memory; The data bit width is determined according to the read / write instructions; After determining that the data bit width is less than the preset bit width, the data of the first access segment where the target address is located in the EEPROM is read out and stored in the corresponding address space in the mirror memory. The first access segment includes the target address and several access addresses that are continuous with the target address. The first access segment = N × the smallest access address unit of the EEPROM, where N is an integer greater than or equal to 1. The mirror memory refers to configuring a virtual mirror memory space for the EEPROM memory space. The data in the address space of the mirrored memory is manipulated according to read and write instructions.

2. The EEPROM-like control method according to claim 1, characterized in that, Operations are performed on the data corresponding to the target address in the mirrored memory according to read / write instructions, including: In response to the read instruction of the EEPROM-like memory, it is determined that the data at the target address has been read into the mirror memory; Data corresponding to the target address is read from the mirrored memory to obtain the data corresponding to the target address of the EEPROM-like memory.

3. The EEPROM-like control method according to claim 2, characterized in that, The operation on the data corresponding to the target address in the mirrored memory according to the read / write instructions also includes: It has been determined that more than a preset number of storage addresses in the mirrored memory have been read out; The data of the second access segment in the EEPROM, which is contiguous with the tail address of the first access segment, is read out and stored in the address space corresponding to the mirror memory.

4. The EEPROM-like control method according to claim 3, characterized in that, After determining that data at more than a preset number of storage addresses in the mirrored memory has been read out, the EEPROM-like control method further includes: It has been determined that the address space in the mirrored memory is full; Clear the data that has already been read from the address space; The data read from the EEPROM will be stored sequentially into empty address bits.

5. The EEPROM-like control method according to claim 1, characterized in that, Operations are performed on the data in the address space of the mirrored memory according to read and write instructions, including: Responding to the write command of the EEPROM-like device; The target address and the data to be written are obtained according to the write instruction; Write the data to be written to the target address corresponding to the mirror memory; The data corresponding to the target address in the mirror memory are sequentially stored in the EEPROM-like memory.

6. The EEPROM-like control method according to claim 5, characterized in that, Writing the data to be written to the target address in the mirror memory includes: Read all data in the image memory that corresponds to the target address; Compare all the data with the data to be written; It is determined that the data to be written is different from all the data; The data to be written is written to the corresponding data bit at the target address in the mirror memory.

7. The EEPROM-like control method according to claim 6, characterized in that, Writing the data to be written to the target address in the mirror memory further includes: Determine that a portion of the data to be written differs from a portion of the total data; The first type of data bits and the second type of data bits in the target address are determined, wherein the first type of data bits are the data bits that are different between the data to be written and all the data, and the second type of data bits are the data bits that are the same between the data to be written and all the data; Write the data corresponding to the first type of data bit in the data to be written into the first type of data bit.

8. The EEPROM-like control method according to claim 1, characterized in that, The EEPROM-like control method further includes: The data bit width is determined to be greater than or equal to the preset bit width; In response to the read / write instructions of the EEPROM-like device, read / write operations are performed directly on the data in the EEPROM-like device.

9. An EEPROM-like control device, characterized in that, include: The receiving module is used to receive read and write instructions for EEPROM-like memory. The read module is used to read the data of the first access segment where the target address is located in the EEPROM and store it in the corresponding address space in the mirror memory. The first access segment includes the target address and several access addresses that are continuous with the target address. The first access segment = N × the smallest access address unit of the EEPROM, where N is an integer greater than or equal to 1. The operation module is used to operate on the data in the address space of the mirrored memory according to read and write instructions.

10. An electronic device, characterized in that, include: EEPROM-like and mirrored memory; A control unit, wherein the control unit is used to control the EEPROM-like ROM according to any one of claims 1-8.

Citation Information

Patent Citations

  • Data processing method and system and storage medium

    CN113126883A