463
/
838
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
PWDS_LEN-1
ERASE: Setting this bit to 1 will perform a forced erase, all other bits must be 0. In this case only the command
byte is sent, all other bytes of the command will be ignored by the card.
LOCK_UNLOCK: When this bit is 1, it means the card is locked, and when it is 0, it means it is unlocked. This
bit can be set at the same time as SET_PWD, but not at the same time as CLR_PWD.
CLR_PWD: Set this bit to 1 clear password data.
SET_PWD: This bit is 1 to save the password data to the memory.
PWDS_LEN: This parameter defines the length of the password, in bytes.
PWD: password data, according to different commands, the password data is different. For example, in the case
of setting a new password, it contains the new password, and when changing the password, it contains the old
password and the new password set.
The following sections list the command sequences to set/clear password, lock/unlock, and force wipe.
Set password
1.
If the card has not been selected before, use the CMD7 (SELECT/DESELECT_CARD) command to select a
card.
2.
Use CMD16 (SET_BLOCKLEN) to define the length of the data block, the 8-bit card lock/unlock mode, the 8-
bit PWDS_LEN (in bytes), and the number of bytes of the new password. When the password replacement is
completed, the size of the data block in which the command is sent must take into account the lengths of both
the old and new passwords.
3.
On the data line, send the CMD42 (LOCK/UNLOCK) command with a suitable data block length and include
a 16-bit CRC code. The data block contains the operation mode (SET_PWD=1), the password length
(PWDS_LEN) and the password data itself (PWD). When the password replacement is completed, the password
length value (PWDS_LEN) should be the sum of the lengths of the old and new passwords. The password data
field (PWD) is preceded by the old password (in use) and followed by the new password.
4.
When the old password sent is incorrect (size or content does not match the expected value),
LOCK_UNLOCK_FAILED in the status register will be set and the old password will not be changed. If the
old password matches, the new password data and length are stored in PWD and PWDS_LEN respectively.
The password length field (PWDS_LEN) can indicate whether a password is currently set. If the field is zero, it
means that the password is not used. Only when the field is not zero, the card will be automatically locked when
powered on. If a password is set, and you want to lock the card immediately without power failure, you can set the
LOCK_UNLOCK bit or send an additional lock command.
Clear password
1.
If the card has not been selected before, use the CMD7 (SELECT/DESELECT_CARD) command to select a
card.
2.
Use CMD16 (SET_BLOCKLEN) to define the data block length, 8-bit card lock/unlock mode, 8-bit
PWDS_LEN (in bytes), and the number of bytes of the currently used password.
3.
On the data line, send the CMD42 (LOCK/UNLOCK) command with a suitable data block length and include