A memory cell with a charge trapping structure is programmed using refill
cycles that include a program pulse followed by a charge balancing pulse
that causes ejection of electrons from the charge trapping structure. The
refill cycle causes a blue spectrum shift in the charge trap distribution
in the charge trapping structure. The algorithm includes program verify
operations after the program pulse, and completes when a successful
program verify operation occurs after a number of refill cycles. The
charge retention properties can be greatly improved by these refill
cycles.