English
Language : 

MC12H064NBCA-2SA00 Datasheet, PDF (51/102 Pages) Samsung semiconductor – SAMSUNG MultiMediaCard
Revision 0.3
MultiMediaCardTM
6.2.11 Card Lock/Unlock Operation
The password protection feature enables the host to lock the card by providing a password, which later will be used for
unlocking the card. The password and its size is kept in an 128 bit PWD and 8 bit PWD_LEN registers, respectively. These
registers are non-volatile so that a power cycle will not erase them.
A locked card responds to (and executes) all commands in the “basic” command class (class 0) and “lock card” command
class. Thus the host is allowed to reset, initialize, select, query for status, etc., but not to access data on the card. If the
password was previously set (the value of PWD_LEN is not ‘0’) the card will be locked automatically after power on.
Similar to the existing CSD and CID register write commands the lock/unlock command is available in “transfer state” only.
This means that it does not include an address argument and the card has to be selected before using it.
The card lock/unlock command has the structure and bus transaction type of a regular single block write command. The
transferred data block includes all the required information of the command (password setting mode, PWD itself, card lock/
unlock etc.). The following table describes the structure of the command data block.
Byte #
0
1
2
...
PWD_LEN + 1
Bit 7 Bit 6 Bit 5
Reserved
PWD_LEN
Password data
Bit 4
Bit 3
ERASE
Bit 2
LOCK_UNLOCK
Bit 1
CLR_PWD
Bit 0
SET_PWD
Table 6-6 : Lock Card Data Structure
• ERASE: ‘1’ Defines Forced Erase Operation (all other bits shall be ‘0’) and only the cmd byte is sent.
• LOCK/UNLOCK: ‘1’ = Locks the card. ‘0’ = Unlock the card (note that it is valid to set this bit together with SET_PWD
but it is not allowed to set it together with CLR_PWD).
• CLR_PWD: ‘1’ = Clears PWD.
• SET_PWD: ‘1’ = Set new password to PWD
• PWD_LEN: Defines the following password length (in bytes). Valid password length are 1 to 16 bytes.
• PWD: The password (new or currently used depending on the command).
The data block size shall be defined by the host before it sends the card lock/unlock command. This will allow different
password sizes.
The following paragraphs define the various lock/unlock command sequences:
• Setting the Password
• Select the card (CMD7), if not previously selected already
• Define the block length (CMD16), given by the 8bit card lock/unlock mode, the 8 bits password size (in bytes),
and the number of bytes of the new password. In case that a password replacement is done, then the block
size shall consider that both passwords, the old and the new one, are sent with the command.
• Send Card Lock/Unlock command with the appropriate data block size on the data line including 16 bit CRC.
The data block shall indicate the mode (SET_PWD), the length (PWD_LEN) and the password itself. In case
that a password replacement is done, then the length value (PWD_LEN) shall include both passwords, the old
and the new one, and the PWD field shall include the old password (currently used) followed by the new pass
word.
• In case that a password replacement is attempted with PWD_LEN set to the length of the old pass-word only,
the LOCK_UNLOCK_FAILED error bit is set in the status register and the old password is not changed.
• In case that the sent old password is not correct (not equal in size and content) then LOCK_UNLOCK_FAILED
error bit will be set in the status register and the old password does not change. In case that PWD matches the
sent old password then the given new password and its size will be saved in the PWD and PWD_LEN fields,
respectively.
51
Sep.22.2005