Patent ID: 7397703

Claim:
A method for programming/erasing a non-volatile memory (NVM), comprising: performing a program/erase operation on a portion of the NVM using a first set of parameters; determining whether each cell in the portion of the NVM passes a first margin level; if the each cell in the portion of the NVM does not pass the first margin level, determining an amount of departure in an actual value of at least one parameter associated with the program/erase operation from a target value of the at least one parameter; modifying a subsequent program/erase operation for the portion of the NVM based on the amount of departure in the actual value of the at least one parameter; performing the subsequent program/erase operation on the portion of the NVM and determining whether each cell in the portion of the NVM passes the first margin level after performing the subsequent program/erase operation; and performing the program/erase operation on a next portion of the NVM, if each cell in the portion of the NVM passes the first margin level.