A computer program product for flash memory control, the computer program product comprising a computer-readable medium having stored therein in computer-executable non-transitory form instructions that, when executed on a processing system of a flash memory controller, cause the processing system to effect a method comprising:
- reading data from a portion of a flash memory a plurality of times using a plurality of different candidate reference voltages, each time reading data from the portion of the flash memory using a different candidate reference voltage from all other times, the plurality of different candidate reference voltages distributed over a voltage range, the voltage range centered on an estimated mid-point between a pair of adjacent target cell voltages;
- determining a plurality of decision patterns, each decision pattern corresponding to a voltage region bordering one of the candidate reference voltages;
- counting occurrences of each of the plurality of decision patterns in the data read from the portion of the flash memory;
- determining one or more decision patterns having a minimum of occurrences;
- determining a cross-point voltage corresponding to a mid-point of one or more voltage regions corresponding to the one or more decision patterns determined to have a minimum of occurrences;
- and
- providing an indication of the cross-point voltage to a read data detector.