Say ur code was for example 2468.
Using the radio preset buttons numbered 1 - 6, though u will just only need 1 to 4.
Using the above example code, you have to press the preset button 1 - (2 times), then button numbered 2 - (4 times), button 3 - (6 times) and lastly button 4 - (8 times).
This is how it says to do it in my owners manual for a post '98 micra. Reckon it should be the same procedure on the '97 models aswell.
However it also says that you shouldn't have to enter the code if the word 'SECURITY' comes up cos the head unit will automatically search for the matching code from its interface to one in the cars immobiliser, therefore only working with that one and only car.
If the word 'CODE' comes up then it says in me owners manual to enter the code in the way I have said above.