Do you mean to say you have a 2001.5?
I assume you performed the diagnostic procedure published in the service manual on page TF-28. TF-29 states that a flicker pattern of 21 flashes is caused by the following:
Transfer control device actuator circuit is faulty (Abnormalities are detected when motor relay circuit is open/shorted or relay monitor circuit is open/shorted.)
Check the following:
Actuator motor, actuator motor arm position sensing switch and their associated circuits, TF-114, TF-115 and
TF-94.
The transfer case section of the service manual for a 2001.5 QX4 can be downloaded here:
http://www.nicoclub.com/FSM/QX4/2001.5_QX4/tf.pdf
Or do you have a 1999?
I don't see a method for self-diagnosis without using Nissan's proprietary CONSULTII hardware in the 1999 shop manual. In any case, here is a link to the 1999 shop manual, transfer case:
http://www.nicoclub.com/FSM/QX4/1999/TF.pdf
The ATX transfer case is difficult enough that Haynes refuses to publish any help for it. That said, you at least have some info to arm yourself with when stepping foot in the shop. Good luck.