CN103034588A - One time programmable (OTP) internal memory allocation and information writing and reading method for mobile phone camera - Google Patents

One time programmable (OTP) internal memory allocation and information writing and reading method for mobile phone camera Download PDF

Info

Publication number
CN103034588A
CN103034588A CN2013100155262A CN201310015526A CN103034588A CN 103034588 A CN103034588 A CN 103034588A CN 2013100155262 A CN2013100155262 A CN 2013100155262A CN 201310015526 A CN201310015526 A CN 201310015526A CN 103034588 A CN103034588 A CN 103034588A
Authority
CN
China
Prior art keywords
otp
internal memory
layer address
interval
memory
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.)
Granted
Application number
CN2013100155262A
Other languages
Chinese (zh)
Other versions
CN103034588B (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.)
TRULY SEMICONDUCTORS (SHANWEI) CO Ltd
Original Assignee
TRULY SEMICONDUCTORS (SHANWEI) 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 TRULY SEMICONDUCTORS (SHANWEI) CO Ltd filed Critical TRULY SEMICONDUCTORS (SHANWEI) CO Ltd
Priority to CN201310015526.2A priority Critical patent/CN103034588B/en
Publication of CN103034588A publication Critical patent/CN103034588A/en
Application granted granted Critical
Publication of CN103034588B publication Critical patent/CN103034588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephone Function (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention relates to a one time programmable (OTP) internal memory allocation and information writing and reading method for a mobile phone camera. The OTP internal memory allocation method comprises the following steps: acquiring the capacity of an OTP internal memory, wherein the capacity of the OTP internal memory is A bytes; acquiring byte number of parameters to be written into the OTP internal memory, wherein the total byte number of the parameters is S; and dividing the OTP internal memory into P groups according to the capacity of the OTP internal memory and the total byte number of the parameter. According to the internal memory allocation method, the space of the OTP internal memory is divided into multiple groups, so parameters can be written into the space of the OTP internal memory for many times. The space of the OTP internal memory is divided into multiple groups and can realize possibility of writing the parameters for a few times, so the parameters can be written into other groups of the space of the OTP internal memory continuously during failure in one-time writing of the information of the OTP internal memory, and the problem that a mobile phone camera module is rejected during failure in one-time writing of the OTP in the prior art is solved.

Description

A kind of mobile phone cam OTP Memory Allocation, information writes and read method
Technical field
The present invention relates to a kind of cell-phone camera module, relate in particular to a kind of mobile phone cam OTP Memory Allocation, information writes and read method.
Background technology
Along with the fast development of mobile phone cam, more and more higher to image effect and coherence request.Each camera module is because its individual difference, and its image effect also is not quite similar, and for the consistance of the image effect that reaches like product, need to carry out some effect to single module and proofread and correct.This just requires the mobile phone cam module when dispatching from the factory, preferably each parameter information all is written to OTPM(one time programmable memory) in, client is when using the camera module, be pre-written into the parameter information among this OTPM and apply it on this camera module as long as from OTPM, read, just can realize as much as possible the high consistency of mobile phone cam photographic effect.
OTP is a kind of type of memory, and namely more one-off programming adopts and melt a structure, and programming process is irreversible destructive activity.Be that OTP is the memory headroom that can only write once.
One section storage space on the used sensitive chip (CMOS sensor) of mobile phone cam is OTPM(one time programmable memory), each position can only be write a secondary data and enters on this storage space, has wrongly write just can't delete or cover new value and get on.OTP uses easily and fast and obtained increasing application in the high-pixel camera head with its cheap price.But owing to can only in OTP, write primary information, in case the information write error will cause whole mobile phone module to be scrapped, increased production cost.
Summary of the invention
In view of this, the invention provides a kind of mobile phone cam OTP Memory Allocation, information writes and read method, the OTP primary information writes failure, the problem of camera module with regard to scrapping in the prior art to solve.
In order to solve the problems of the technologies described above, technical scheme of the present invention is as follows:
A kind of mobile phone cam OTP memory allocation method comprises:
Obtain the capacity of OTP internal memory, the capacity of described OTP internal memory is the A byte;
Obtain the byte number of the parameter of described OTP internal memory to be written, the total bytes of all described parameters is S;
According to the capacity of described OTP internal memory and the total bytes of described all described parameters described OTP internal memory is divided into the P group,
Figure BDA00002739369600021
Wherein, described OTP internal memory has Q layer address, and
Figure BDA00002739369600022
At least contain a predetermined layer address in the described Q layer address, all described predetermined layer addresses are divided into M interval, at least one layer address in arbitrary described interval and the described OTP internal memory except described predetermined layer address consists of a group, and the arbitrary layer address except described predetermined layer address only belongs to a group;
A, S, Q, P, M, n are natural number, and M is not less than 2.
Preferably, the memory size of every group of OTP equates.
Preferably, the memory size of the layer address of each OTP equates.
Preferably, the quantity in the interval in the described predetermined layer equates with the quantity of the group of described OTP internal memory.
A kind of mobile phone cam OTP memory information wiring method comprises:
According to above-mentioned each described OTP memory allocation method the OTP internal memory is distributed;
The m that preset parameter is written to described predetermined layer address is interval;
Judge whether described preset parameter writes successfully, if so, in the OTP internal memory of p group except described predetermined layer address, write successively the parameter except described preset parameter; Described m interval belongs to described p group;
Wherein, the shared memory headroom of described preset parameter is the B byte, and the memory size in arbitrary described interval is not less than the B byte; M is natural number, 0<m<M, 0<p<P.
Preferably, describedly judge whether described preset parameter writes successfully, also comprise, if not, m interval in described predetermined layer address writes fail flag, and write described preset parameter in the m+1 interval of described predetermined layer address, determine to write in the m+1 interval of described predetermined layer address the operation success of described preset parameter, and in the OTP internal memory of p+1 group except described predetermined layer address, write successively the parameter information except described preset parameter; Described m+1 interval belongs to the p+1 group.
Preferably, each interval capacity of described predetermined layer address equates.
A kind of mobile phone cam OTP memory information read method comprises:
Read the flag register in the m interval of predetermined layer address, whether successful described flag register contain preset parameter and write information;
Judge whether the information in the described flag register is effective; If so, read all interior parameters of p group OTP internal memory;
Wherein, all described parameters write according to above-mentioned each described memory information wiring method information of carrying out.
Preferably, describedly judge whether the information in the described flag register is effective, also comprises, if not, reads the flag register in the m+1 interval of described predetermined layer address.
The present invention is by being divided at least 2 groups with mobile phone cam OTP internal memory, and every group memory headroom capacity is not less than the total bytes of all parameters.There are several layer address in this OTP, wherein at least one layer address is the predetermined layer address, this predetermined layer address is divided into several intervals, at least one layer address in arbitrary interval and the described OTP internal memory except described predetermined layer address consists of a group, and the arbitrary layer address except described predetermined layer address only belongs to a group.
In the OTP internal memory, during write parameters, at first write preset parameter in arbitrary interval of predetermined layer, if write successfully, write parameter except preset parameter at other layer address with this place, interval group; If preset parameter writes failure, write fail flag in this interval, and at the interval write parameters of the another one of predetermined layer, if write successfully, repeat aforesaid operations.
This OTP memory headroom distribution method can make the OTP memory headroom realize the repeatedly purpose of write parameters information because the OTP memory headroom is divided into a plurality of groups.This OTP memory headroom is divided into several groups, the OTP memory headroom can be realized the several times possibility of write parameters, thereby, when the failure of OTP memory information write-once, can continue other group write parameters at the OTP memory headroom, avoided OTP write-once failure in the prior art, the problem that the cell-phone camera module will be scrapped.
Description of drawings
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art, the below will do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the process flow diagram of embodiment one among the present invention;
Fig. 2 is the process flow diagram of embodiment two among the present invention;
Fig. 3 is the process flow diagram of embodiment three among the present invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, below in conjunction with accompanying drawing the specific embodiment of the present invention is described in detail.
A lot of details have been set forth in the following description so that fully understand the present invention, but the present invention can also adopt other to be different from alternate manner described here and implement, those skilled in the art can do similar popularization in the situation of intension of the present invention, so the present invention is not subjected to the restriction of following public specific embodiment.
Embodiment one
Embodiment one is a kind of mobile phone cam OTP memory allocation method provided by the invention.In conjunction with Fig. 1.Fig. 1 is the process flow diagram of the embodiment of the invention one.The mobile phone cam OTP memory allocation method that present embodiment provides may further comprise the steps:
S101, obtain the capacity of OTP internal memory:
The OTP of mobile phone cam module all can be provided with the OTP internal memory of certain capacity during fabrication, obtains the capacity of OTP internal memory, and the capacity of supposing the OTP internal memory is the A byte.
S102, obtain the total bytes of all parameters of described OTP internal memory to be written:
The mobile phone cam module has many kinds of parameters, corrects parameter etc. such as module basic parameter, white balance parameter, camera lens.Each parameter can be occupied certain memory headroom in being written to OTP the time, obtains the total bytes of all parameters that are written to the OTP internal memory in the mobile phone cam module, and the total bytes of these all parameters is S.
S103, according to the byte number of the capacity of OTP internal memory and all parameters the OTP internal memory is divided into the P group:
The OTP internal memory has Q layer address, and
Figure BDA00002739369600041
Be that Q gets
Figure BDA00002739369600042
Integral part, n is natural number, for easy, n generally gets 1 or 2, the capacity of every layer of OTP all is not very large like this, can not make mistakes easily when writing and reading.This layer address generally is predefined in the mobile phone cam module, not afterwards the people for dividing into.
At least containing a predetermined layer address in this Q layer address, only store a certain preset parameter in this predetermined layer address, for example is parameter x 1, and other Parameter storage except this parameter x 1 is in the layer address beyond the predetermined layer address.If the shared space of preset parameter x1 is larger, and want to be able to the possibility of more times writing information, the predetermined layer address can be multilayer, to have the storing predetermined parameter x 1 in enough spaces.These all predetermined layer addresses are divided into M interval, and at least one layer address in the arbitrary interval in this M interval and the OTP internal memory except the predetermined layer address consists of a group, and the arbitrary layer address except the predetermined layer address only belongs to a group.
Total bytes S according to the above-mentioned OTP memory size A that obtains and all parameters divides the OTP internal memory into into P group, and P is integer, and The internal memory that is OTP is divided into 2 groups at least, mostly is most (
Figure BDA00002739369600053
Integral part) group, and every group capacity is not less than the total bytes of all parameters, every group OTP internal memory all can hold all parameters like this, such one group of complete parameter information can store in one group of OTP memory headroom.The group of OTP is at least 2 groups, this memory allocation method in the internal memory of OTP repeatedly write parameters possibility is provided, can avoid in the prior art failure of OTP internal memory write-once, whole mobile phone cam module just faces the risk of scrapping.Consider from the angle that realizes repeatedly write parameters, minute group more, number of times that can write parameters is more, more can take full advantage of the memory headroom of OTP.
For follow-up in the OTP internal memory write parameters convenient, simple and direct, the capacity of preferred every group of OTP internal memory equates that the layer address memory size of each OTP equates.In order not waste the OTP memory headroom, make the OTP memory headroom fully obtain utilizing, the number of the demarcation interval of predetermined layer address preferably equates with the number of the group that the OTP internal memory divides into.From the angle of inventive concept, the number of the number of demarcation interval and the group of OTP is complementary, and what intervals are namely arranged on the predetermined layer address, preferably has the group of what OTP to be complementary with it.
The OTP memory allocation method that provides in order more clearly to understand present embodiment, the below gives one example.The capacity of OTP internal memory is 256 bytes, contain 8 layer address (bank0, bank1 ..., bank7), the capacity of these 8 layer address can be identical can be not identical yet, preferably identical, the capacity that is each layer address is 32 bytes, and wherein, selected layer address bank0 is the predetermined layer address, can only storing predetermined parameter, can not store other parameter.This predetermined layer bank0 is 3 intervals by the people for dividing into: between the first interval, Second Region and the 3rd interval.Each interval is used for storing a preset parameter.The first interval consists of first group with layer address bank1 and bank2, consists of second group with layer address bank3 and bank4 between Second Region, and the 3rd interval consists of the 3rd group with layer address bank5 and bank6, and bank7 can be used as for subsequent use for the OTP memory headroom of reservation.
Wherein, any one deck among layer address bank1 ~ bank6 can only belong to arbitrary one group of first to the 3rd group, and can not belong to simultaneously two groups.Can learn that predetermined layer belongs to a plurality of groups, but the arbitrary interval on the predetermined layer group can only be belonged to, and two groups can not be belonged to simultaneously.
It is pointed out that above-mentioned numerical range of giving an example only is in order more clearly to understand this technical scheme, the group number of the number of plies of the OTP in the present embodiment, the interval number of predetermined layer and OTP is not limited to above-mentioned concrete numerical range of giving an example.Wherein, the group number of OTP is at least 2, and the group number is more, and the number of times that can write when follow-up parameter read-in is more.
The mobile phone cam OTP memory allocation method that embodiment one provides is divided into some groups with the OTP internal memory, and every group memory size all can be held all parameters, and can realize repeatedly writing for the OTP internal memory provides possible.Based on the mobile phone cam OTP memory allocation method that embodiment one provides, embodiment two provides a kind of mobile phone cam OTP memory information wiring method.
Embodiment two
Embodiment two provides a kind of mobile phone cam OTP memory information wiring method.
In conjunction with Fig. 2.Fig. 2 is the process flow diagram of the mobile phone cam OTP memory information wiring method of present embodiment.This mobile phone cam OTP memory information wiring method may further comprise the steps:
S201, the OTP internal memory is distributed:
Any one mobile phone cam OTP memory allocation method that provides according to above-described embodiment one distributes the OTP internal memory.
In order to be expressly understood the solution of the present invention, present embodiment describes with the example of embodiment one.That is: the capacity of OTP internal memory is 256 bytes, contain 8 layer address (bank0, bank1 ..., bank7).The capacity of each layer address is 32 bytes, and wherein, selected layer address bank0 is the predetermined layer address, can only storing predetermined parameter, can not store other parameter.This predetermined layer bank0 is 3 intervals by the people for dividing into: between the first interval, Second Region and the 3rd interval.Each interval is used for storing a preset parameter.The first interval consists of first group with layer address bank1 and bank2, consists of second group with layer address bank3 and bank4 between Second Region, and the 3rd interval consists of the 3rd group with layer address bank5 and bank6, and bank7 can be used as for subsequent use for the OTP memory headroom of reservation.
S202, preset parameter x1 is written to the first interval of predetermined layer address bank0:
Contain a plurality of parameters in the cell-phone camera module, for example module basic parameter, white balance parameter, camera lens are corrected parameter etc., for for simplicity, represent various parameter with symbol x1, x2, x3 etc. here.When write parameters in the OTP internal memory, preliminary setting parameter x1 is preset parameter, and in fact, the arbitrary parameter in the cell-phone camera module all can be preset parameter.Present embodiment is described as preset parameter with parameter x 1.This preset parameter x1 can only write on or be stored on the interior predetermined layer address bank0 of OTP internal memory, and this preset parameter x1 can write on the arbitrary interval on the bank0 of predetermined layer address.In this step preset parameter x1 is written to the first interval among the bank0 of predetermined layer address.
According to step S201 predetermined layer address bank0 is divided into a plurality of intervals, any one interval memory size is not less than the shared memory headroom of preset parameter x1, and any one interval that namely divides into all can hold a preset parameter.Suppose that preset parameter x1 accounts for 10 byte numbers, each interval capacity is at least 10 bytes.If each the interval capacity on the bank0 of predetermined layer address is 10 bytes, because the capacity of predetermined layer address bank0 is 32 bytes, then stay 2 bytes regardless of on described interval, as headspace.
Described in embodiment one, each interval memory size can be identical, also can be different, be preferably identical.
In order to take full advantage of the memory headroom of OTP, and for so that parameter read-in to the OTP internal memory well arranged in order, preferably preset parameter x1 at first is written to the first interval of predetermined layer address bank0, if write failure in the first interval, with preset parameter x1 be written to successively between Second Region, the 3rd interval etc.Interval ordering is to divide according to the order of predetermined layer address bank0.
S203, judge that preset parameter is written to the first interval and whether writes successfully:
After preset parameter x1 is written to the first interval and finishes, read this first interval interior value, namely write successfully if the value that reads is the value that writes in advance, then this interval most significant digit is not carried out any operation, at this moment, this interval most significant digit be 0 and other the position be not 0 entirely; Namely do not write failure if the value that reads is not the value that writes in advance, write 1 in this interval most significant digit.Judge according to the information on the most significant digit in the first interval whether preset parameter x1 writes successfully.If write successfully, execution in step S204 is if write failure, execution in step S205.
S204, at the parameter information that writes successively on layer address bank1 and the bank2 except preset parameter x1:
According to step S201 the internal memory of OTP is distributed, the group of the OTP of division is made of interval on the predetermined layer address and at least one layer address except the predetermined layer address.Wherein, first group of the interval of first among the layer address bank0 and bank1 and bank2 formation OTP.After judging that the first interval that preset parameter x1 is written to predetermined layer address bank0 writes successfully, write parameters x2, x3 etc. other parameter except preset parameter x1 successively on the layer address bank1 in the 1st group of OTP and the bank2.Like this, one group of complete parameter is all in same group of OTP, and preset parameter x1 and other parameters such as x2, x3 etc. are on the same layer address, and the clear layer of such storage information is for client is provided convenience when reading the memory information of OTP.
If all parameters all are successfully writing on the internal memory of OTP, then the operation of the internal memory write parameters of OTP is finished.If when writing for the first time, just write successfully, on the OTP internal memory, only used so OTP first group.Other group of OTP comprises that second group and the 3rd group is not all used, and is empty as headspace.
S205, write fail flag in the first interval of predetermined layer address, and between the Second Region of described predetermined layer address, write preset parameter x1:
If preset parameter x1 is not successfully writing to the first interval among the bank0 of predetermined layer address, be that preset parameter x1 is written to the first interval operation failure, then be that the first interval writes fail flag in this interval, preferably the most significant digit since the first interval writes fail flag, the fail flag symbol most significant digit that writes is 1, and writes preset parameter x1 between the Second Region of predetermined layer address.
It is pointed out that if preset parameter x1 writes failure in the first interval, can write preset parameter x1 in other the arbitrary interval (between such as Second Region or the 3rd interval) except the first interval, do not limit preset parameter in the present embodiment and write between Second Region.
S206, judge that preset parameter x1 is written between Second Region and whether write successfully:
Whether judge according to the described determination methods of step S203 that preset parameter x1 is written between the Second Region of predetermined layer address bank0 writes successfully.If success, execution in step S207, if failure, execution in step S208.
S207, in the parameter that writes successively on layer address bank3 and the bank4 except preset parameter x1:
If preset parameter x1 is successfully writing between Second Region among the bank0, OTP memory allocation method according to step S201 is learnt, common second group of consisting of OTP between bank3 and bank4 and Second Region then writes other parameter x 2 except preset parameter x1, x3 etc. other parameter in layer address bank3 and bank4.
If this operates successfully, the then operation of write parameters success in the OTP.Can learn from above-mentioned steps, if for the first time write parameters failure in the OTP, owing in advance the internal memory of OTP would be divided into groups, and 2 groups have been divided at least, can be again to other group write parameters of OTP, thereby avoided the failure of OTP write-once, the risk that whole cell-phone camera module is just scrapped.
S208, between the Second Region of predetermined layer address bank0, write fail flag, and write preset parameter x1 in the 3rd interval of described predetermined layer address bank0:
If between Second Region, write the still failure of operation of preset parameter x1, then between this Second Region, write fail flag according to the described method of step S205, and write preset parameter x1 in the 3rd interval of this predetermined layer address bank0.
S209, judge that preset parameter x1 is written to the 3rd interval and whether writes successfully:
Judge according to the method for step S203 or S206 whether the 3rd interval that preset parameter x1 is written to predetermined layer address bank0 writes successfully.If success, execution in step S210, if failure, execution in step S211.
S210, in other parameter that writes successively on layer address bank5 and the bank6 except preset parameter x1:
If preset parameter x1 is successfully writing to the 3rd interval among the bank0, OTP memory allocation method according to step S201 is learnt, bank5 and bank6 and the 3rd interval common the 3rd group of consisting of OTP then write other parameter x 2 except preset parameter x1, x3 etc. other parameter in layer address bank5 and bank6.
If this operates successfully, the OTP memory information wiring method that present embodiment provides provides the chance of three writing informations in the OTP, thereby has reduced the failure of OTP memory information write-once, the risk that the cell-phone camera module is just scrapped.
S211, finish write parameters in the OTP:
Internal memory with OTP in the present embodiment has been divided into three groups, because three groups internal memories have all used, if write still failure of preset parameter x1 in the 3rd interval, then the operation failure of write parameters in the OTP shows that the internal memory of this OTP can not re-use.
The OTP memory information wiring method that present embodiment provides is not limited to the chance of three write parameters on the internal memory of OTP described above, also is not limited to step described above.Because each grouping of OTP all can be held all parameters, so when write parameters information on the internal memory of OTP, take the group of OTP as unit, one group of all parameter all writes in same group of OTP.When single job when failure, can continue to write in the group of next OTP the parameter of cell-phone camera module, until the success of the parameter read-in of cell-phone camera module, finish write parameters on the internal memory of OTP.If the grouping of all OTP is all finished using, and parameter write still failure, at this moment, show the operation failure of write parameters on the OTP internal memory of this cell-phone camera module, this OTP can not use, this cell-phone camera module faces to be scrapped.
The memory information wiring method that present embodiment provides does not limit the memory size of OTP, the number of plies of OTP, the number in interval and the number of group yet.Interval number on the predetermined layer address of OTP and the number of group should be not less than 2, can be for 3,4,10 etc. greater than 2 integer.Number is larger, and the number of times of write parameters is more in the OTP, and the cell-phone camera module is less owing to the OTP memory information writes the risk that failure scraps, thereby has saved cost.
In the prior art, because the not grouping of OTP internal memory, the OTP internal memory can only use once, when for the first time parameter read-in being arrived the OTP internal memory, if write failure, just can not again write, the mobile phone cam module faces the risk of scrapping, and has caused great waste.The OTP internal memory wiring method that present embodiment provides, owing to before write parameters information, in advance the OTP internal memory has been divided into some groups, because every group of OTP internal memory can hold all parameters.So writing fashionablely, can write whole parameters at one group first, if write failure in this group, can continue write parameters information in other group.Have what groupings in the OTP, just can write how many times, increased the number of times that OTP writes, thereby avoided OTP write-once failure in the prior art, the mobile phone cam module just faces the risk of scrapping, thereby has saved cost.
Embodiment three
Embodiment three provides a kind of mobile phone cam OTP memory information read method.See also Fig. 3.Fig. 3 is the process flow diagram of mobile phone cam OTP memory information read method.This read method may further comprise the steps:
S301, read the flag register in the first interval of predetermined layer address:
Start OTP, read the flag register in the first interval on the predetermined layer address.This flag register contains preset parameter x1 and whether writes successful information: if write successfully, the information most significant digit in the flag register is 0, and other position is not 0 entirely; If write failure, the information most significant digit in the flag register is 1.Information in the flag register is what to be stored in writing information in the OTP internal memory.When reading, the order that preferably writes with information is identical, can more fast and effeciently the information that is stored on the OTP internal memory be read out like this.
S302, judge whether the information in the flag register in the first interval is effective:
Whether effective according to the information in the rule judgment flag register of predetermined set.When write parameters information, if write successfully, the information most significant digit in the flag register is 0, and other position is not 0 entirely, and for example the information in the flag register is 0xffff or 0xff.If reading the most significant digit of the information of flag register is 0, and other position is not 0 entirely, shows that the information in the flag register is effective.If effectively, execution in step S303.If reading the most significant digit of the information in the flag register is 1, show that then the information in the flag register is invalid, execution in step S304.
S303, read all parameters in first group of OTP:
If the information in the flag register in first interval of reading is effective, show that first group of interior parameter information successfully writes.All parameter informations that are stored in first group of this first interval place are all read out, use in order to client.
Owing to writing or during parameter information, only have preset parameter x1 to write or a certain interval success of storing predetermined layer after, just the parameter information except preset parameter x1 can be written on other interior layer address of the group of OTP at this place, interval.Hence one can see that preset parameter x1 and other Parameter storages are in same group of OTP.Like this, if the information in the flag register of predetermined layer address is effective, show that all parameter informations all are successfully writing in the internal memory of OTP.When reading, information that just can a judge mark register, then different each parameter information that reads one by one the OTP internal memory judge whether this parameter information is effective.This method that reads parameter information, comparatively fast effectively.
S304, read the flag register between the Second Region of predetermined layer address:
If the information in the first flag register in interval is invalid, show that the parameter of camera module successfully is not written in first group of this OTP, need not to read the interior parameter information of this group.Because writing of the parameter information of present embodiment is that wiring method according to embodiment two is finished, so after first group of OTP writes unsuccessfully, can be at second group even the 3rd group of write parameters information.So, when reading parameter, if first group parameter information writes failure, need to read the information in the flag register between the Second Region on the predetermined layer address.Then execution in step S305.
S305, judge whether the information in the flag register between Second Region is effective:
Judge according to the described determination methods of step S302 whether the information in the flag register between Second Region is effective.If effectively, execution in step S306, if invalid, execution in step S307.
S306, read all parameters in second group of OTP:
If the information in the flag register between the Second Region that reads is effective, show that second group of interior parameter information successfully writes.All parameter informations that are stored in second group of place between this Second Region are all read out, use in order to client.
S307, read the flag register in the 3rd interval of predetermined layer:
If the information in the flag register between Second Region is invalid, show that the parameter of camera module successfully is not written in second group of this OTP, need not to read the interior parameter information of this group.Information in the flag register in reading the 3rd group.
S308, judge whether the information in the flag register in the 3rd interval is effective:
Judge according to step S302 or the described determination methods of S305 whether the information in the flag register in the 3rd interval is effective.If effectively, execution in step S309, if invalid, execution in step S310.
S309, read all parameters in the 3rd group of OTP:
If the information in the flag register in the 3rd interval of reading is effective, show that the 3rd group of interior parameter information successfully writes.All parameter informations that are stored in the 3rd group of the 3rd interval place are all read out, use in order to client.
S310, read OTP memory information failure:
If the information in the flag register in the 3rd interval of reading is invalid, show that the 3rd group of interior parameter information successfully do not write.Since the flag register of three all groups of OTP is all read complete, invalid if the information of flag register remains, show that then the memory information of this OTP reads failure.
The OTP memory information read method that present embodiment provides is not limited to the chance of the information on the flag register on the internal memory that reads OTP for three times described above, also is not limited to step described above.The memory information read method that present embodiment provides does not limit the memory size of OTP, the number of plies of OTP, the number in interval and the number of group yet.Interval number on the predetermined layer address of OTP and the number of group should be not less than 2, can be for 3,4,10 etc. greater than 2 integer.Number is larger, and the number of times that reads parameter in the OTP is more.
The OTP memory information read method that present embodiment provides, only need judge whether the information on the flag register on the predetermined layer is effective, can learn namely whether the parameter information in this OTP group is correct, need not to read one by one the parameters information of OTP internal memory, then judge that it is invalid, thereby improved the reading efficiency of OTP memory information.
The above only is preferred embodiment of the present invention, is not the present invention is done any pro forma restriction.Although the present invention discloses as above with preferred embodiment, yet is not to limit the present invention.Any those of ordinary skill in the art, do not breaking away from the technical solution of the present invention scope situation, all can utilize method and the technology contents of above-mentioned announcement that technical solution of the present invention is made many possible changes and modification, or be revised as the equivalent embodiment of equivalent variations.Therefore, every content that does not break away from technical solution of the present invention, according to any simple modification of on the technical spirit of the present invention above embodiment being done, equivalent variations and modification all still belong in the scope of technical solution of the present invention.

Claims (9)

1. a mobile phone cam OTP memory allocation method is characterized in that, comprising:
Obtain the capacity of OTP internal memory, the capacity of described OTP internal memory is the A byte;
Obtain the byte number of the parameter of described OTP internal memory to be written, the total bytes of all described parameters is S;
According to the capacity of described OTP internal memory and the total bytes of described all described parameters described OTP internal memory is divided into the P group,
Figure FDA00002739369500011
Wherein, described OTP internal memory has Q layer address, and
Figure FDA00002739369500012
At least contain a predetermined layer address in the described Q layer address, all described predetermined layer addresses are divided into M interval, at least one layer address in arbitrary described interval and the described OTP internal memory except described predetermined layer address consists of a group, and the arbitrary layer address except described predetermined layer address only belongs to a group;
A, S, Q, P, M, n are natural number, and M is not less than 2.
2. OTP memory allocation method according to claim 1 is characterized in that, the memory size of every group of OTP equates.
3. OTP memory allocation method according to claim 1 is characterized in that, the memory size of the layer address of each OTP equates.
4. OTP memory allocation method according to claim 1 is characterized in that, the quantity in the interval in the described predetermined layer equates with the quantity of the group of described OTP internal memory.
5. a mobile phone cam OTP memory information wiring method is characterized in that, comprising:
According to claim 1, each described OTP memory allocation method distributes the OTP internal memory-4;
The m that preset parameter is written to described predetermined layer address is interval;
Judge whether described preset parameter writes successfully, if so, in the OTP internal memory of p group except described predetermined layer address, write successively the parameter except described preset parameter; Described m interval belongs to described p group;
Wherein, the shared memory headroom of described preset parameter is the B byte, and the memory size in arbitrary described interval is not less than the B byte; M is natural number, 0<m<M, 0<p<P.
6. OTP memory information wiring method according to claim 5, it is characterized in that, describedly judge whether described preset parameter writes successfully, also comprise, if not, m interval in described predetermined layer address writes fail flag, and write described preset parameter in the m+1 interval of described predetermined layer address, determine to write in the m+1 interval of described predetermined layer address the operation success of described preset parameter, and in the OTP internal memory of p+1 group except described predetermined layer address, write successively the parameter information except described preset parameter; Described m+1 interval belongs to the p+1 group.
7. according to claim 5 or 6 described OTP memory information wiring methods, it is characterized in that each interval capacity of described predetermined layer address equates.
8. a mobile phone cam OTP memory information read method is characterized in that, comprising:
Read the flag register in the m interval of predetermined layer address, whether successful described flag register contain preset parameter and write information;
Judge whether the information in the described flag register is effective; If so, read all interior parameters of p group OTP internal memory;
Wherein, all described parameters are according to writing such as each described memory information wiring method information of carrying out of claim 5-7.
9. OTP memory information read method according to claim 8 is characterized in that, describedly judges whether the information in the described flag register is effective, also comprises, if not, reads the flag register in the m+1 interval of described predetermined layer address.
CN201310015526.2A 2013-01-15 2013-01-15 A kind of mobile phone camera OTP Memory Allocation, information write and read method Active CN103034588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310015526.2A CN103034588B (en) 2013-01-15 2013-01-15 A kind of mobile phone camera OTP Memory Allocation, information write and read method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310015526.2A CN103034588B (en) 2013-01-15 2013-01-15 A kind of mobile phone camera OTP Memory Allocation, information write and read method

Publications (2)

Publication Number Publication Date
CN103034588A true CN103034588A (en) 2013-04-10
CN103034588B CN103034588B (en) 2015-08-19

Family

ID=48021501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310015526.2A Active CN103034588B (en) 2013-01-15 2013-01-15 A kind of mobile phone camera OTP Memory Allocation, information write and read method

Country Status (1)

Country Link
CN (1) CN103034588B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104266822A (en) * 2014-09-30 2015-01-07 信利光电股份有限公司 Test method, test system and test device of micro camera module
WO2017076045A1 (en) * 2015-11-08 2017-05-11 乐视控股(北京)有限公司 Camera module fault detection method and device
CN108769667A (en) * 2018-05-30 2018-11-06 华勤通讯技术有限公司 Camera module, electronic equipment and burning information call method
CN111782288A (en) * 2020-06-30 2020-10-16 联想(北京)有限公司 Electronic device and control method thereof
CN117573155A (en) * 2024-01-16 2024-02-20 成都电科星拓科技有限公司 Product information processing method and chip

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080294838A1 (en) * 2007-05-25 2008-11-27 Agere Systems Inc. Universal boot loader using programmable on-chip non-volatile memory
CN101662534A (en) * 2008-08-28 2010-03-03 深圳富泰宏精密工业有限公司 Mobile telephone and internal memory sharing method thereof
CN102158589A (en) * 2011-01-19 2011-08-17 宁波舜宇光电信息有限公司 High-pixel photographic module and burning method for chip
CN102203726A (en) * 2008-09-10 2011-09-28 茵芬尼特麦默里有限公司 Method for using an otp storage device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080294838A1 (en) * 2007-05-25 2008-11-27 Agere Systems Inc. Universal boot loader using programmable on-chip non-volatile memory
CN101662534A (en) * 2008-08-28 2010-03-03 深圳富泰宏精密工业有限公司 Mobile telephone and internal memory sharing method thereof
CN102203726A (en) * 2008-09-10 2011-09-28 茵芬尼特麦默里有限公司 Method for using an otp storage device
CN102158589A (en) * 2011-01-19 2011-08-17 宁波舜宇光电信息有限公司 High-pixel photographic module and burning method for chip

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104266822A (en) * 2014-09-30 2015-01-07 信利光电股份有限公司 Test method, test system and test device of micro camera module
WO2017076045A1 (en) * 2015-11-08 2017-05-11 乐视控股(北京)有限公司 Camera module fault detection method and device
CN108769667A (en) * 2018-05-30 2018-11-06 华勤通讯技术有限公司 Camera module, electronic equipment and burning information call method
CN111782288A (en) * 2020-06-30 2020-10-16 联想(北京)有限公司 Electronic device and control method thereof
CN111782288B (en) * 2020-06-30 2021-11-16 联想(北京)有限公司 Electronic device and control method thereof
CN117573155A (en) * 2024-01-16 2024-02-20 成都电科星拓科技有限公司 Product information processing method and chip
CN117573155B (en) * 2024-01-16 2024-04-09 成都电科星拓科技有限公司 Product information processing method and chip

Also Published As

Publication number Publication date
CN103034588B (en) 2015-08-19

Similar Documents

Publication Publication Date Title
CN103034588B (en) A kind of mobile phone camera OTP Memory Allocation, information write and read method
US20100177547A1 (en) Memory device and memory access method
US20220179566A1 (en) Recycled version number values in flash memory
CN104008061A (en) Internal memory recovery method and device
CN104951402B (en) Storage device and its operating method and computing system
CN108874301A (en) data storage device and operation method thereof
CN102023843B (en) Function calling method and device as well as smart card
JP2006318366A (en) Memory controller, nonvolatile storage device, nonvolatile storage system, data writing method
CN109086086B (en) Starting method and device of non-space-sharing multi-core CPU
CN103513937A (en) Storage device capable of increasing its life cycle and operating method thereof
US9971682B2 (en) Wear-leveling system and method for reducing stress on memory device using erase counters
CN103377135A (en) Addressing method, device and system
US9396769B1 (en) Memory device and operating method of same
JP2013161222A (en) Ic card and program
CN106155572B (en) Data storage device and data access method
CN114582402A (en) Nonvolatile memory, programming method thereof and computer system
CN101770427A (en) Method and device for utilizing flash memory space
CN109710409B (en) Memory management method, system, device and readable storage medium
CN106802811A (en) program writing method and device
CN203535643U (en) Control device with system use function
US20120005414A1 (en) Semiconductor memory device and method of reading data from and writing data into a plurality of storage units
US10248455B2 (en) Storage device and task execution method thereof, and host corresponding to the storage device and task execution method thereof
CN104182181A (en) Data processing method, device and terminal of memory card
CN201828906U (en) Memory protection device
CN102591738A (en) Data management method, memory controller and embedded memory storage device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 516600 Guangdong Industrial Zone, Shanwei City Road, Lee Lee Industrial City, a district of the building fifteenth

Applicant after: Truly Opto-Electronics Ltd.

Address before: 516600, Fifteenth Industrial Zone, Xinli Industrial Road, downtown industrial district, Guangdong, Shanwei

Applicant before: Truly Semiconductors (Shanwei) Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: TRULY OPTO-ELECTRONICS LIMITED TO: TRULY OPTO-ELECTRONICS LTD.

C14 Grant of patent or utility model
GR01 Patent grant