A method for programming/erasing a non-volatile memory (NVM) (14) includes performing a program/erase operation (80) on a portion of the NVM (14) using a first set of parameters. The method further includes determining (82) whether each cell in the portion of the NVM (14) passes a first margin level, if not determining which one of a set of lower margin levels than the first margin level each cell in the portion of the NVM (14) passes. The method further includes modifying (92) at least one of the set of parameters associated with a subsequent program/erase operation for the portion of the NVM (14) based on the determined one of the set of lower margin levels.