A method and apparatus for minimizing errors that may occur when writing
information to a magnetic memory cell array with an operating write
current due to changes in the local magnetic fields and. A test write
current is sent to a reference memory cell and the effect of the test
current on the orientation of the magnetization in the reference cell is
monitored. The write current is then modified to compensate for any
changes in the optimum operating point that have occurred. Arrays of
reference magnetic memory cells having varying properties may be used to
more accurately characterize any changes that have occurred in the
operating environment. A phase difference between a time varying current
used to drive the reference cell and the corresponding variations in the
orientation of the magnetization in the reference cell may also be used
to further characterize changes in the operating environment.