Patent ID: 8649216

Claim:
A data writing method, wherein a data storage device comprises a flash memory, and the flash memory comprises a plurality of memory cells, comprising: adjusting a plurality of programming voltage values for programming most significant bits (MSB) of a plurality of stored data patterns of the memory cells of the flash memory to obtain a plurality of adjusted programming voltage values; receiving a target data from a host; and directing the flash memory to write the target data thereto according to the adjusted programming voltage values, wherein the programming voltage values respectively correspond to the stored data patterns of the memory cells and adjusting of the programming voltage values comprises: determining a plurality of neighboring data pairs comprising the stored data patterns corresponding to the programming voltage values neighboring to each other; determining a plurality of difference bits between the stored data patterns of the neighboring data pairs; determining a plurality of target neighboring data pairs with difference bits corresponding to the most significant bits from the neighboring data pairs; and adjusting the programming voltage values to increase the gaps between the adjusted programming voltage values corresponding to the stored data patterns of the target neighboring data pairs.