• 沒有找到結果。

4. SD Memory Card Functional Description

5.3 CSD Register

5.3.2 CSD Register (CSD Version 1.0)

Name Field Width Value Cell

Type CSD-slice

CSD structure CSD_STRUCTURE 2 00b R [127:126]

reserved - 6 00 0000b R [125:120]

data read access-time-1 TAAC 8 xxh R [119:112]

data read access-time-2 in CLK cycles (NSAC*100)

NSAC 8 xxh R [111:104]

max. data transfer rate TRAN_SPEED 8 32h or 5Ah R [103:96]

card command classes CCC 12 01x110110101b R [95:84]

max. read data block length READ_BL_LEN 4 xh R [83:80]

partial blocks for read allowed READ_BL_PARTIAL 1 1b R [79:79]

write block misalignment WRITE_BLK_MISALIGN 1 xb R [78:78]

read block misalignment READ_BLK_MISALIGN 1 xb R [77:77]

DSR implemented DSR_IMP 1 xb R [76:76]

reserved - 2 00b R [75:74]

device size C_SIZE 12 xxxh R [73:62]

max. read current @VDD min VDD_R_CURR_MIN 3 xxxb R [61:59]

max. read current @VDD max VDD_R_CURR_MAX 3 xxxb R [58:56]

max. write current @VDD min VDD_W_CURR_MIN 3 xxxb R [55:53]

max. write current @VDD max VDD_W_CURR_MAX 3 xxxb R [52:50]

device size multiplier C_SIZE_MULT 3 xxxb R [49:47]

erase single block enable ERASE_BLK_EN 1 xb R [46:46]

erase sector size SECTOR_SIZE 7 xxxxxxxb R [45:39]

write protect group size WP_GRP_SIZE 7 xxxxxxxb R [38:32]

write protect group enable WP_GRP_ENABLE 1 xb R [31:31]

reserved (Do not use) 2 00b R [30:29]

write speed factor R2W_FACTOR 3 xxxb R [28:26]

max. write data block length WRITE_BL_LEN 4 xxxxb R [25:22]

partial blocks for write allowed WRITE_BL_PARTIAL 1 xb R [21:21]

reserved - 5 00000b R [20:16]

File format group FILE_FORMAT_GRP 1 xb R/W(1) [15:15]

copy flag (OTP) COPY 1 xb R/W(1) [14:14]

permanent write protection PERM_WRITE_PROTECT 1 xb R/W(1) [13:13]

temporary write protection TMP_WRITE_PROTECT 1 xb R/W [12:12]

File format FILE_FORMAT 2 xxb R/W(1) [11:10]

reserved 2 00b R/W [9:8]

CRC CRC 7 xxxxxxxb R/W [7:1]

not used, always’1’ - 1 1b - [0:0]

Table 5-4: The CSD Register Fields (CSD Version 1.0)

The following sections describe the CSD fields and the relevant data types. If not explicitly defined otherwise, all bit strings are interpreted as binary coded numbers starting with the left bit first.

TAAC

Defines the asynchronous part of the data access time.

TAAC bit position code

2:0 time unit

0=1ns, 1=10ns, 2=100ns, 3=1µs, 4=10µs, 5=100µs, 6=1ms, 7=10ms

6:3 time value

0=reserved, 1=1.0, 2=1.2, 3=1.3, 4=1.5, 5=2.0,

6=2.5, 7=3.0, 8=3.5, 9=4.0, A=4.5, B=5.0, C=5.5, D=6.0, E=7.0, F=8.0

7 reserved Table 5-5: TAAC Access Time Definition

NSAC

Defines the worst case for the clock-dependant factor of the data access time. The unit for NSAC is 100 clock cycles. Therefore, the maximal value for the clock-dependent part of the data access time is 25.5 k clock cycles.

The total access time NAC is the sum of TAAC and NSAC. It should be computed by the host for the actual clock rate. The read access time should be interpreted as a typical delay for the first data bit of a data block or stream.

TRAN_SPEED

The following table defines the maximum data transfer rate per one data line - TRAN_SPEED:

TRAN_SPEED bit code

2:0 transfer rate unit

0=100kbit/s, 1=1Mbit/s, 2=10Mbit/s, 3=100Mbit/s, 4... 7=reserved

6:3 time value

0=reserved, 1=1.0, 2=1.2, 3=1.3, 4=1.5, 5=2.0, 6=2.5, 7=3.0, 8=3.5, 9=4.0, A=4.5, B=5.0, C=5.5, D=6.0, E=7.0, F=8.0 7 reserved

Table 5-6: Maximum Data Transfer Rate Definition

Note that for current SD Memory Cards, this field shall be always 0_0110_010b (032h) which is equal to 25 MHz - the mandatory maximum operating frequency of SD Memory Card.

In High-Speed mode, this field shall be always 0_1011_010b (05Ah) which is equal to 50 MHz, and when the timing mode returns to the default by CMD6 or CMD0 command, its value will be 032h.

CCC

The SD Memory Card command set is divided into subsets (command classes). The card command class register CCC defines which command classes are supported by this card. A value of 1 in a CCC bit means that the corresponding command class is supported. For command class definitions, refer to Table 4-17.

CCC bit Supported card command class

0 class 0

1 class 1

...

11 class 11

Table 5-7: Supported Card Command Classes

READ_BL_LEN

The maximum read data block length is computed as 2READ_BL_LEN

. The maximum block length might therefore be in the range 512...2048 bytes (see Chapter 4.11 for details). Note that in an SD Memory Card the WRITE_BL_LEN is always equal to READ_BL_LEN

READ_BL_LEN Block length

0-8 reserved

9 29 = 512 Bytes

10 210 = 1024 Bytes

11 211 = 2048 Bytes 12-15 reserved

Table 5-8: Data Block Length

READ_BL_PARTIAL (always = 1 in SD Memory Card)

Partial Block Read is always allowed in an SD Memory Card. It means that smaller blocks can be used as well. The minimum block size will be one byte.

WRITE_BLK_MISALIGN

Defines if the data block to be written by one command can be spread over more than one physical block of the memory device. The size of the memory block is defined in WRITE_BL_LEN.

WRITE_BLK_MISALIGN=0 signals that crossing physical block boundaries is invalid.

WRITE_BLK_MISALIGN=1 signals that crossing physical block boundaries is allowed.

READ_BLK_MISALIGN

Defines if the data block to be read by one command can be spread over more than one physical block of the memory device. The size of the memory block is defined in READ_BL_LEN.

READ_BLK_MISALIGN=0 signals that crossing physical block boundaries is invalid.

READ_BLK_MISALIGN=1 signals that crossing physical block boundaries is allowed.

DSR_IMP

Defines if the configurable driver stage is integrated on the card. If set, a driver stage register (DSR) shall be implemented (also see Chapter 5.5).

DSR_IMP DSR type

0 no DSR implemented

1 DSR implemented

Table 5-9: DSR Implementation Code Table

C_SIZE

This parameter is used to compute the user’s data card capacity (not include the security protected area). The memory capacity of the card is computed from the entries C_SIZE, C_SIZE_MULT and READ_BL_LEN as follows:

memory capacity = BLOCKNR * BLOCK_LEN Where

BLOCKNR = (C_SIZE+1) * MULT MULT = 2C_SIZE_MULT+2

(C_SIZE_MULT < 8)

BLOCK_LEN = 2READ_BL_LEN, (READ_BL_LEN < 12) To indicate 2 GByte card, BLOCK_LEN shall be 1024 bytes.

Therefore, the maximal capacity that can be coded is 4096*512*1024 = 2 G bytes.

Example: A 32 Mbyte card with BLOCK_LEN = 512 can be coded by C_SIZE_MULT = 3 and C_SIZE = 2000.

VDD_R_CURR_MIN, VDD_W_CURR_MIN

The maximum values for read and write currents at the minimal power supply VDD are coded as follows:

VDD_R_CURR_MIN

VDD_W_CURR_MIN Code for Current Consumption @ VDD

2:0 0=0.5mA; 1=1mA; 2=5mA; 3=10mA; 4=25mA;

5=35mA; 6=60mA; 7=100mA Table 5-10: VDD, min Current Consumption

VDD_R_CURR_MAX, VDD_W_CURR_MAX

The maximum values for read and write currents at the maximal power supply VDD are coded as follows:

VDD_R_CURR_MAX

VDD_W_CURR_MAX Code for Current Consumption @ VDD

2:0 0=1mA; 1=5mA; 2=10mA; 3=25mA; 4=35mA;

5=45mA; 6=80mA; 7=200mA Table 5-11: VDD, max Current Consumption

C_SIZE_MULT

This parameter is used for coding a factor MULT for computing the total device size (see ‘C_SIZE’). The factor MULT is defined as 2C_SIZE_MULT+2.

C_SIZE_MULT MULT

0 22 = 4

1 23 = 8

2 24 = 16

3 25 = 32

4 26 = 64

5 27 = 128

6 28 = 256

7 29 = 512

Table 5-12: Multiply Factor for the Device Size

ERASE_BLK_EN

The ERASE_BLK_EN defines the granularity of the unit size of the data to be erased. The erase operation can erase either one or multiple units of 512 bytes or one or multiple units (or sectors) of SECTOR_SIZE (see definition below).

If ERASE_BLK_EN=0, the host can erase one or multiple units of SECTOR_SIZE. The erase will start from the beginning of the sector that contains the start address to the end of the sector that contains the end address. For example, if SECTOR_SIZE=31 and the host sets the Erase Start Address to 5 and the Erase End Address to 40, the physical blocks from 0 to 63 will be erased as shown in Figure 5-1.

0123456789 0123456789 0123456789 0123456789 0123456789 0123456789

0 1 2 3 4 5 6

0123456789 Host Erase

Address Range

Erase Area

Erase Unit Size Physical Block

(per CSD)

Figure 5-1: ERASE_BLK_EN = 0 Example

If ERASE_BLK_EN=1 the host can erase one or multiple units of 512 bytes. All blocks that contain data from start address to end address are erased. For example, if the host sets the Erase Start Address to 5 and the Erase End Address to 40, the physical blocks from 5 to 40 will be erased as shown in Figure 5-2.

H ost E rase Address R ange

Erase Area Physical Block

(per C SD ) 0123456789 0123456789 0123456789 0123456789 0123456789 0123456789

0 1 2 3 4 5 6

0123456789

Figure 5-2: ERASE_BLK_EN = 1 Example

SECTOR_SIZE

The size of an erasable sector. The content of this register is a 7-bit binary coded value, defining the number of write blocks (see WRITE_BL_LEN). The actual size is computed by increasing this number by one. A value of zero means one write block, 127 means 128 write blocks.

WP_GRP_SIZE

The size of a write protected group. The content of this register is a 7-bit binary coded value, defining the number of erase sectors (see SECTOR_SIZE). The actual size is computed by increasing this number by one. A value of zero means one erase sector, 127 means 128 erase sectors.

WP_GRP_ENABLE

A value of 0 means no group write protection possible.

R2W_FACTOR

Defines the typical block program time as a multiple of the read access time. The following table defines the field format.

R2W_FACTOR Multiples of read access time 0 1

1 2 (write half as fast as read) 2 4

3 8 4 16 5 32 6,7 reserved

Table 5-13: R2W_FACTOR

WRITE_BL_LEN

The maximum write data block length is computed as 2WRITE_BL_LEN

. The maximum block length might therefore be in the range from 512 to 2048 bytes. Write Block Length of 512 bytes is always supported.

Note that in the SD Memory Card, the WRITE_BL_LEN is always equal to READ_BL_LEN.

WRITE_BL_LEN Block Length

0-8 reserved

9 29 = 512 bytes

10 210 = 1024 Bytes

11 211 = 2048 Bytes

12-15 reserved Table 5-14: Data Block Length

WRITE_BL_PARTIAL

Defines whether partial block sizes can be used in block write commands.

WRITE_BL_PARTIAL=0 means that only the WRITE_BL_LEN block size and its partial derivatives, in resolution of units of 512 bytes, can be used for block oriented data write.

WRITE_BL_PARTIAL=1 means that smaller blocks can be used as well. The minimum block size is one byte.

FILE_FORMAT_GRP

Indicates the selected group of file formats. This field is read-only for ROM. The usage of this field is shown in Table 5-15 (see FILE_FORMAT).

COPY

Defines if the contents is original (=0) or has been copied (=1). The COPY bit for OTP and MTP devices, sold to end consumers, is set to 1, which identifies the card contents as a copy. The COPY bit is a one time programmable bit.

PERM_WRITE_PROTECT

Permanently protects the entire card content against overwriting or erasing (all write and erase commands for this card are permanently disabled). The default value is 0, i.e. not permanently write protected.

TMP_WRITE_PROTECT

Temporarily protects the entire card content from being overwritten or erased (all write and erase commands for this card are temporarily disabled). This bit can be set and reset. The default value is 0, i.e. not write protected.

FILE_FORMAT

Indicates the file format on the card. This field is read-only for ROM. The following formats are defined:

FILE_FORMAT_GRP FILE_FORMAT Type

0 0 Hard disk-like file system with partition table

0 1 DOS FAT (floppy-like) with boot sector only (no partition table)

0 2 Universal File Format

0 3 Others/Unknown

1 0, 1, 2, 3 Reserved

Table 5-15: File Formats

A more detailed description is given in the SD Memory Card File System specification.

CRC

The CRC field carries the check sum for the CSD contents. It is computed according to Chapter 4.5.

The checksum has to be recalculated by the host for any CSD modification. The default corresponds to the initial CSD contents.

相關文件