2.38k likes | 2.61k Views
12/13 DSD Project Presentation. 第四組 SD IO Interface World Real Time Clock / Alarm with C-LCM. SD / SDIO Card. SD Card Introduction. SD Card ,全名 Security Digital Card ,是小型記憶卡的一種,它被廣泛地於攜帶型裝置上使用,是由日本松下( Panasonic )公司、東芝( TOSHIBA )公司與美國 San Disk 公司共同開發研製的。
E N D
12/13 DSD Project Presentation 第四組 SD IO Interface World Real Time Clock / Alarm with C-LCM
SDCard Introduction SDCard,全名Security Digital Card,是小型記憶卡的一種,它被廣泛地於攜帶型裝置上使用,是由日本松下(Panasonic)公司、東芝(TOSHIBA)公司與美國San Disk公司共同開發研製的。 SD卡可以看作是由MMC卡衍生出來的。SD卡投影面積與MMC卡相同,只是略微厚一點,但是SD卡的容量大得多,且讀寫速度也比MMC卡快4倍。同時,SD卡的介面與MMC卡是相容的,支援SD卡的介面大多支援MMC卡。在2006年,SD卡容量有 8、16、32、64、128、256、512 MB,或 1、2 、4、6、8 GB。
用戶可以使用一個USB的讀卡器,在個人電腦上使用SD卡。某些新型電腦上已經內置了讀卡裝置。用戶可以使用一個USB的讀卡器,在個人電腦上使用SD卡。某些新型電腦上已經內置了讀卡裝置。 最新的發展是SD內建了USB插口,省略了讀卡器。San Disk的設計是使用一個可摺疊的護套來保護USB插口。 SDCard Introduction
SDCard Application SD卡多應用於 MP3隨身聽 數位相機:儲存相片及短片 數位攝影機:儲存相片及短片 個人數位助理(PDA):儲存各類資料 手機:儲存相片、鈴聲、音樂、短片等資料
SDIOCard Introduction SDIO,意即Secure Digital Input/Output,所謂「支援SDIO」的機種,其SD擴充槽除了能使用SD記憶卡外,也可支援SD介面的輸出入設備,例如無線網路卡、藍芽卡、GPS接收器、數位相機卡、FM廣播卡、電視接收器、數據機、指紋辨識器等。
比起使用USB插槽,使用SDIO卡耗電量低,並且適用於各種行動式的平台。比起使用USB插槽,使用SDIO卡耗電量低,並且適用於各種行動式的平台。 同樣是數位裝置,支援SDIO的機種只要插入SDIO擴充卡,就能增加各種不同的功能,例如NB搭配無線網卡以及PDA搭配GPS接收器,就是目前極受使用者青睞的實用方案。 SDIOCard Introduction
Technology Explanation 所有SD和SDIO卡都必須支援較老的SPI/MMC模式。這個模式支援慢速的四線序列介面(時鐘、序列輸入,序列輸出,晶片選擇),相容於序列終端介面(SPI)和許多微控制器。 SD卡共支援三種傳輸模式:- SPI模式(獨立序列輸入和序列輸出),- 1位元SD模式 (獨立指令和資料通道,獨有的傳輸格式)- 4位元SD模式 (使用額外的針腳以及某些重新設置的針腳。 支持四位寬的平行傳輸)。
大部分數位相機,數位音頻播放器和其他便攜設備僅能使用MMC模式。有關這一模式的詳細文檔可以從MMCA購買,價格是500美元。但是部分有關SDIO的文檔是免費的。有些還可以從存儲卡廠商處獲得。大部分數位相機,數位音頻播放器和其他便攜設備僅能使用MMC模式。有關這一模式的詳細文檔可以從MMCA購買,價格是500美元。但是部分有關SDIO的文檔是免費的。有些還可以從存儲卡廠商處獲得。 MMC模式不支持SD卡的加密特性。從免費的文檔裏也找不到這些細節。但對於大多數消費者來講,這無關痛癢,用戶制式用來儲存不受保護的數據。 Technology Explanation
Other MMC / SD Card SD Card 不是Secure Digital Card Association(安全數字卡聯盟)批准的唯一一種記憶卡。其他批准的格式包括miniSD、 microSD(在聯盟未通過標準前稱為TransFlash)和SDHC。 這些更小的卡加上一個適配器也能用在全尺寸的 MMC/SD/SDIO 插槽上。要知道開發出SD尺寸的輸入輸出設備標準已經很難了,再想開發更小尺寸的簡直就不太現實了。
SD插槽支持MMC卡,更小尺寸的MMC卡變種也能相容於支援SD卡的設備。與miniSD 和 microSD不同的是, RS-MMC 插槽可以相容全尺寸的MMC卡。因為 RS-MMC卡只是縮短了的MMC卡。 因應SD卡的標準容量上限只有4GB,不足以應付日益上升的容量需求,聯盟制定了新的SDHC標準。SDHC卡的外型跟普通的SD卡完全相同,而容量的下限為4GB,預料年內可推出高達32GB的SDHC卡。 Other MMC / SD Card
與其它存儲卡格式一樣,SD卡也有眾多的專利和註冊商標保護,授權只能由安全數字卡聯盟進行。安全數字卡聯盟現在的授權協議並不允許開放原始碼的SD驅動程序,這種狀況產生了很多關於開放原始碼和免費軟件的爭論。通行的做法是開發一個開放原始碼的外殼,但核心是針對特定平臺的封閉原始碼SD驅動程序,這種做法與期望的開放標準差異太大。另一種通行的做法是採用較老的MMC模式,因為根據SD卡標準,所有的SD卡都必須支持MMC模式。 這說明SD卡的開放度比CF卡或閃存低,上述兩種格式幾乎免費,僅需要使用聯盟標誌和註冊商標的授權費。但比xD卡或記憶棒的開放度高得多,這兩種格式根本不提供公開文件支援。 Standard
Comparison With Other Memory Card *DRM:數位著作權管理
Command Types Four kinds of commands defined to control the SD Memory Card: Broadcast commands (bc), no response- The broadcast feature is only if all the CMD lines are connected together in the host. If they are separated, then each card will accept it separately in its turn. Broadcast commands with response (bcr) response from all cards simultaneously- Since there is no Open Drain mode in SD Memory Card, this type of command shall be used only if all the CMD lines are separated - the command will be accepted and responded by every card separately. Addressed (point-to-point) commands (ac) no data transfer on DAT Addressed (point-to-point) data transfer commands(adtc) data transfer on DAT
Command Types • All commands have a fixed code length of 48 bits
Command Format A command always starts with a start bit (always 0), followed by the bit indicating the direction of transmission (host = 1). The next 6 bits indicate the index of the command, this value being interpreted as a binary coded number (between 0 and 63). Some commands need an argument (e.g. an address), which is coded by 32 bits.
Command Format A value denoted by ‘x’ in the table above indicates this variable is dependent on the command. All commands are protected by a CRC Every command codeword is terminated by the end bit (always 1). All commands and their arguments are listed in Table 4-18-Table 4-27.(Reference: SD Spec. p.49)
SD Memory Card Functional Description Cyclic Redundancy Code (CRC)
CRC7 The CRC7 check is used for all commands, for all responses except type R3, and for the CSD and CID registers. The CRC7 is a 7-bit value and is computed as follows: Generator polynomial: G(x) = x7 + x3 + 1. M(x) = (first bit) * xn + (second bit) * xn-1 +...+ (last bit) * x0 CRC[6...0] = Remainder [(M(x) * x7)/G(x)] The first bit is the most left bit of the corresponding bit string (of the command, response, CID or CSD). The degree n of the polynomial is the number of CRC protected bits decreased by one. The number of bits to be protected is 40 for commands and responses (n = 39), and 120 for the CSD and CID (n = 119).
CRC7 • CRC7 Examples The CRC section of the command/response is bolded.
SPI Mode SPI Mode Transaction Packets -Command Tokens
Command Format • All the SD Memory Card commands are 6 bytes long. The command transmission always starts with the left most bit of the bit string corresponding to the command codeword.
All commands are protected by a CRC The commands and arguments are listed in Table 7-3. (Reference: SD Spec. p.102) Command Format
Reset for SDIO(CMD0) • In order to reset all functions within an SDIO card or the SDIO portion of a combo card, a method different than that used for SD memory is defined. • The reset command (CMD0) is only used for memory or the memory portion of Combo cards. In order to reset an I/O only card or the I/O portion of a combo card, use CMD52 to write a 1 to the RES bit in the CCCR (bit 3 of register 6). • Note that in the SD mode, CMD0 is only used to indicate entry into SPI mode and shall be supported. An I/O only card or the I/O portion of a combo card is not reset by CMD0
SPI Mode SPI Mode Transaction Packets
Command and Argument(SPI bus commands) (SD Memory Card) Example: the content of the command index field is (binary) ‘000000’ for CMD0
Format of Response R1 This response token is sent by the card after every command with the exception of SEND_STATUS commands. It is one byte long, and the MSB is always set to zero. The other bits are error indications, an error being signaled by a 1.
Format of Response R1 • The structure of the R1 format is given in Figure 7-9. The meaning of the flags is defined as following:
Format of Response R1 In idle state: The card is in idle state and running the initializing process. Erase reset: An erase sequence was cleared before executing because an out of erase sequence command was received.
Format of Response R1 Illegal command: An illegal command code was detected. Communication CRC error: The CRC check of the last command failed. Erase sequence error: An error in the sequence of erase commands occurred.
Format of Response R1 Address error: A misaligned address that did not match the block length was used in the command. Parameter error: The command’s argument (e.g. address, block length) was outside the allowed range for this card.
SPI Mode Status Bits 1) Type: E: Error bit. S: State bit. R: Detected and set for the actual command response. X: Detected and set during command execution. The host can get the status by issuing a command with R1 response. 2) Clear Condition: A: According to the current state of the card. C: Clear by read
Format of CMD5 • The IO_SEND_OP_COND Command contains the following fields: • S (start bit)Start bit. Always 0 • D (direction)Direction. Always1 indicates transfer from host to card. • Command IndexIdentifies the CMD5 command with a value of 000101b
Format of CMD5 • The IO_SEND_OP_COND Command contains the following fields: • Stuff BitsNot used, shall be set to 0. • I/O OCROperation Conditions Register. The supported minimum and maximum values for VDD.
Format of CMD5 • The IO_SEND_OP_COND Command contains the following fields: • CRC77 bits of CRC data • E (end bit)End bit, always 1