CN104375783B - A kind of method of EEPROM data write-in - Google Patents

A kind of method of EEPROM data write-in Download PDF

Info

Publication number
CN104375783B
CN104375783B CN201410619209.6A CN201410619209A CN104375783B CN 104375783 B CN104375783 B CN 104375783B CN 201410619209 A CN201410619209 A CN 201410619209A CN 104375783 B CN104375783 B CN 104375783B
Authority
CN
China
Prior art keywords
eeprom
data
written
address
write
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410619209.6A
Other languages
Chinese (zh)
Other versions
CN104375783A (en
Inventor
陆丹宏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huzhou Yinglie Intellectual Property Operation Co ltd
Original Assignee
Shanghai Feixun Data Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201410619209.6A priority Critical patent/CN104375783B/en
Publication of CN104375783A publication Critical patent/CN104375783A/en
Application granted granted Critical
Publication of CN104375783B publication Critical patent/CN104375783B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Read Only Memory (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present invention provides a kind of methods of EEPROM data write-in, including:Step 1, the initial address of write-in is the effective address of EEPROM, and when total length of data to be written is no more than the effective length of highest address from the initial address to EEPROM, thens follow the steps 2, otherwise exits;Step 2, it is transmitted to EEPROM in batches after data prediction to be written;Step 3, EEPROM is written in the data to be written received by EEPROM.After the method for the present invention, it is transmitted to EEPROM in batches after data prediction to be written, successively EEPROM is written in the data to be written received by the EEPROM, avoid the automatic page turning phenomenon when write-in of EEPROM data, it is more transmitted in batches due to being written into data, has often transmitted a batch, EEPROM write-in a batch, efficiency is improved, avoids and every has transmitted the problem that the delay regular hour after a byte makes EEPROM write-in hardware efficiencies low.

Description

A kind of method of EEPROM data write-in
Technical field
The present invention relates to a kind of methods that the technical field of extensive aggression more particularly to EEPROM data are written.
Background technology
EEPROM (band electrically erasable programmable read-only memory) is the modifiable read-only memory of user, can pass through height It wipes and reprograms in the effect of common voltage, therefore EEPROM is widely used.
There are one feature, write-in data will appear a page flop phenomenon by EEPROM.A such as AT24C02BN EEPROM core Piece memory space is 2kbit, that is, 256byte, and AT24 points are page 32, and every page of length is 8byte, if from address 0x5 Start that [8]={ 0,1,2,3,4,5,6,7 } data is written, first page content is after completion:0x0~0x7:3、4、5、6、7、0、 1、2.EEPROM often transfers a byte after calling I2C write-in interfaces, and current page address can transfer current page from adding 1 Current page beginning of the page is returned in address after the last one byte.No matter how many a bytes are transmitted, as long as reaching current page when write-in The last one byte, address can all automatically return to current page beginning of the page, and other addresses then add 1 automatically.Here it is EEPROM automated pages Write automatic turning.Page based on EEPROM writes flop phenomenon, if be written by I2C bulk transfers data to EEPROM, by nothing Method is written page by page.In addition, after EEPROM receives the data that I2C is transmitted, hardware needs the regular hour to be written.So such as If fruit calls I2C only to transmit a byte every time, on the one hand repeat to call that I2C occupancies and time can be increased, on the other hand Delay regular hour after a byte of being often totally lost allows EEPROM write-in hardware to greatly reduce execution efficiency again.
Invention content
The technical issues of present invention need to solve is to overcome the shortcomings of above-mentioned, provides a kind of efficient EEPROM data write-in Method, which is characterized in that including:
Step 1, the initial address of write-in be EEPROM effective address, and total length of data to be written be no more than from The initial address to the highest address of EEPROM effective length when, execute step 2;
Step 2, it is transmitted to EEPROM in batches after data prediction to be written;
Step 3, successively EEPROM is written in the data to be written received by EEPROM.
Further, the step of data prediction to be written specifically includes:
Step A, if total length of data to be written is less than or equal to the initial address to EEPROM current page highests address Length is then written into data and is disposably transmitted to EEPROM, no to then follow the steps B;
Step B, if total length of data to be written be more than the initial address to EEPROM current page highests address length, The initial address then is transmitted to the data of the length of EEPROM current page highests address to EEPROM, updates the initial address With the total length of data to be written, step A is executed.
Further, the data to be written are transmitted to EEPROM transmission using I2C.
Further, the initial address is the beginning of the page address of EEPROM.
Further, the EEPROM is AT24C02BN.
After the method for the present invention, EEPROM is transmitted to after data prediction to be written in batches, the EEPROM successively will The data to be written write-in EEPROM received, avoids the automatic page turning phenomenon when write-in of EEPROM data, more due to that will wait for Write-in data transmit in batches, have often transmitted a batch, and EEPROM write-in a batch improves efficiency, avoid and every have transmitted one The problem that the delay regular hour makes EEPROM write-in hardware efficiencies low after byte.
Description of the drawings
Fig. 1 is the method flow diagram of EEPROM data write-in provided by the invention;
Fig. 2 is the flow chart of data prediction to be written provided by the invention.
Specific implementation mode
In order to make relevant technical staff in the field more fully understand technical scheme of the present invention, below in conjunction with of the invention real The technical solution in embodiment of the present invention is clearly and completely described in the attached drawing for applying mode, it is clear that described reality The mode of applying is only some embodiments of the invention, rather than whole embodiments.
The invention will be further described with embodiment below in conjunction with the accompanying drawings.
Refering to fig. 1, it is a kind of method of the EEPROM data write-in of embodiment provided by the invention, this method includes:
Step S100, the effective address for being EEPROM in the initial address of write-in, and total length of data to be written does not surpass Cross from initial address to the highest address of EEPROM effective length when, execute step S200;
In the present embodiment, initial address is beginning of the page address.
One AT24C02BN eeprom chip memory space is 2kbit, that is, 256byte, and AT24 points are page 32, 0x00~0xff is the effective address of EEPROM, and when the initial address of write-in is 0x00, writable data to be written are total Length is up to 256byte.
Step 200, it is transmitted to EEPROM in batches after data prediction to be written;
The data prediction to be written for being written into EEPROM transmits in batches, has often transmitted a batch and has waited for EEPROM write-ins.
Successively EEPROM is written in the data to be written received by step S300, EEPROM.
EEPROM often receives a batch data to be written, and a batch is just written.
In a preferred embodiment, the data prediction to be written includes:
Step S201, judge total length of data to be written whether be less than or equal to the initial address to EEPROM current pages most The length of high address;
Step S202, if total length of data to be written is less than or equal to the initial address to EEPROM current page highests address Length, then be written into data and be disposably transmitted to EEPROM, it is no to then follow the steps S203;
Step S203, to EEPROM transmit the initial address to the length of EEPROM current page highests address data, The initial address and the total length of data to be written are updated, step S201 is executed.
By step S201~S203, the initial address and the total length of data to be written are constantly updated, until It is just written into data write-in on EEPROM one pages, is then transferred to EEPROM, EEPROM is written.
In the present embodiment, initial address is beginning of the page address, so the data length transmitted every time to EEPROM is exactly the page Length.
In above-mentioned steps, it is written into data and passes a batch, write-in a batch.This incoming batch data can just be from write-in Initial address avoids the phenomenon that generating page overturning when writing batch of data, also avoids to the length of the last one address of current page It passes a byte and writes a low problem of byte efficiency.
Only several embodiments of the present invention are expressed above, the description thereof is more specific and detailed, but can not therefore and It is interpreted as the limitation to the scope of the claims of the present invention.It should be pointed out that for those of ordinary skill in the art, not taking off Under the premise of present inventive concept, various modifications and improvements can be made, these are all within the scope of protection of the present invention.Cause This, the protection domain of patent of the present invention should be determined by the appended claims.

Claims (4)

1. a kind of method of EEPROM data write-in, which is characterized in that including:
Step 1, in the effective address that the initial address of write-in is EEPROM, and total length of data to be written is no more than from described Initial address to the highest address of EEPROM effective length when, execute step 2;
Step 2, it is transmitted to EEPROM in batches after data prediction to be written;
Step 3, EEPROM is written in the data to be written received by EEPROM;
The step of data prediction to be written, specifically includes:
Step A, if total length of data to be written be less than or equal to the initial address to EEPROM current page highests address length, It is then written into data and is disposably transmitted to EEPROM, it is no to then follow the steps B;
Step B, if total length of data to be written be more than the initial address to EEPROM current page highests address length, to EEPROM transmits the initial address to the data of the length of EEPROM current page highests address, updates the initial address and institute Total length of data to be written is stated, step A is executed.
2. the method for EEPROM data according to claim 1 write-in, which is characterized in that the data to be written to EEPROM transmission is transmitted using I2C.
3. the method for EEPROM data write-in according to claim 1, which is characterized in that the initial address is EEPROM Beginning of the page address.
4. the method for EEPROM data according to claim 1 write-in, which is characterized in that the EEPROM is AT24C02BN。
CN201410619209.6A 2014-11-05 2014-11-05 A kind of method of EEPROM data write-in Active CN104375783B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410619209.6A CN104375783B (en) 2014-11-05 2014-11-05 A kind of method of EEPROM data write-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410619209.6A CN104375783B (en) 2014-11-05 2014-11-05 A kind of method of EEPROM data write-in

Publications (2)

Publication Number Publication Date
CN104375783A CN104375783A (en) 2015-02-25
CN104375783B true CN104375783B (en) 2018-07-31

Family

ID=52554740

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410619209.6A Active CN104375783B (en) 2014-11-05 2014-11-05 A kind of method of EEPROM data write-in

Country Status (1)

Country Link
CN (1) CN104375783B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107894900B (en) * 2017-12-06 2021-06-29 郑州云海信息技术有限公司 MCU upgrading method and system
CN109062843A (en) * 2018-07-11 2018-12-21 河南森源电气股份有限公司 A kind of date storage method and system based on iic bus
CN111179993A (en) * 2019-12-31 2020-05-19 苏州绿控传动科技股份有限公司 Data reading/writing method of EEPROM
CN114461552B (en) * 2022-01-26 2024-01-30 北京经纬恒润科技股份有限公司 Data storage method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058732B1 (en) * 2001-02-06 2006-06-06 Cypress Semiconductor Corporation Method and apparatus for automatic detection of a serial peripheral interface (SPI) device memory size
CN101246749A (en) * 2008-03-26 2008-08-20 北京中星微电子有限公司 Method for automatically recognizing EEPROM paging size and writing in EEPROM
CN102402485A (en) * 2010-09-16 2012-04-04 安凯(广州)微电子技术有限公司 Method for detecting parameters of NANDFLASH
CN102623053A (en) * 2011-01-26 2012-08-01 晨星软件研发(深圳)有限公司 Memory controller, memory control method and memory system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058732B1 (en) * 2001-02-06 2006-06-06 Cypress Semiconductor Corporation Method and apparatus for automatic detection of a serial peripheral interface (SPI) device memory size
CN101246749A (en) * 2008-03-26 2008-08-20 北京中星微电子有限公司 Method for automatically recognizing EEPROM paging size and writing in EEPROM
CN102402485A (en) * 2010-09-16 2012-04-04 安凯(广州)微电子技术有限公司 Method for detecting parameters of NANDFLASH
CN102623053A (en) * 2011-01-26 2012-08-01 晨星软件研发(深圳)有限公司 Memory controller, memory control method and memory system

Also Published As

Publication number Publication date
CN104375783A (en) 2015-02-25

Similar Documents

Publication Publication Date Title
CN104375783B (en) A kind of method of EEPROM data write-in
CN110462599A (en) The device and method of autonomic hardware management for cyclic buffer
CN204537117U (en) A kind of FPGA remote online upgrade-system based on microprocessor
CN103389669A (en) Remote dynamic loading system and method for processor program on basis of FPGA (Field Programmable Gate Array) or CPLD (complex programmable logic device) controller
CN110476156A (en) Universal serial bus networks interchanger
CN109558344A (en) A kind of DMA transfer method and dma controller suitable for network transmission
JP2018514867A (en) Central processing unit with DSP engine and improved context switch capability
CN103559910B (en) The realization intelligence that is applied to cd-rom recorder is switched the system and method for burning/recording chip sequential
CN103714160B (en) Filtering sensitive words method and system in a kind of online game
CN110941582B (en) USB bus structure of BMC chip and communication method thereof
CN106095923A (en) A kind of method and system adding data of being on the list in orderly list
CN110365811A (en) A kind of MAC address learning method for limiting, device and equipment
CN109617941A (en) Data push method, device, computer equipment and computer readable storage medium
CN109753470A (en) A kind of control method, micro-control unit and computer storage medium
CN104536816A (en) Method for improving migration efficiency of virtual machine
CN110175833A (en) A kind of computer installation, method, system and medium for binding bank card information
CN105278976B (en) A kind of FPGA reconstruct device, system and method
CN109426511A (en) Soft core update method and system
CN110990169B (en) Structure and method for inter-process byte stream communication by using shared memory
CN104102530B (en) Method and system for improving burning speed of electronic product
Friedman The world is fast
CN105657521A (en) Channel data storage method and device
CN101296448B (en) A kind of upgrade method of terminal software and device
CN107590088B (en) A kind of processing method, system and the relevant apparatus of DMA read operations
CN103024029A (en) Router software upgrading method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20201214

Address after: 313028 Industrial Park, balidian Town, Huzhou City, Zhejiang Province

Patentee after: HUZHOU FENGYUAN AGRICULTURAL EQUIPMENT MANUFACTURE Co.,Ltd.

Address before: 201616 No. 3666 Sixian Road, Songjiang District, Shanghai

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221228

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 313028 Industrial Park, balidian Town, Huzhou City, Zhejiang Province

Patentee before: HUZHOU FENGYUAN AGRICULTURAL EQUIPMENT MANUFACTURE Co.,Ltd.

TR01 Transfer of patent right