SanDisk SDSDH-1024 Product Manual - Page 96

Clock Control, Error Conditions

Page 96 highlights

Revision 2.2 Chapter 5 - SPI Protocol SD Card Product Manual 5.9 Clock Control The SPI bus clock signal can be used by the SPI host to set the cards to energy-saving mode or to control the data flow (to avoid under-run or over-run conditions) on the bus. The host is allowed to change the clock frequency or shut it down. There are a few restrictions the SPI host must follow: • The bus frequency can be changed at any time (under the restrictions of maximum data transfer frequency, defined by the SD cards). • It is an obvious requirement that the clock must be running for the SanDisk SD Card to output data or response tokens. After the last SPI bus transaction, the host is required to provide 8 (eight) clock cycles for the card to complete the operation before shutting down the clock. Throughout this 8-clock period, the state of the CS signal is irrelevant. It can be asserted or de-asserted. Following is a list of the various SPI bus transactions: • A command/response sequence. Eight clocks after the card response end bit. The CS signal can be asserted or de-asserted during these eight clocks. • A read data transaction; eight clocks after the end bit of the last data block. • A write data transaction; eight clocks after the CRC status token. The host is allowed to shut down the clock of a "busy" card. The SD Card will complete the programming operation regardless of the host clock. However, the host must provide a clock edge for the card to turn off its busy signal. Without a clock edge, the SD Card (unless previously disconnected by de-asserting the CS signal) will force the dataOut line down, permanently. 5.10 Error Conditions The following sections provide valuable information on error conditions. 5.10.1 CRC and Illegal Commands Unlike the SD Card protocol, in SPI mode the card will always respond to a command. The response indicates acceptance or rejection of the command. A command may be rejected in any one of the following cases: • It is sent while the card is in read operation (except CMD12 which is legal). • It is sent while the card is in Busy. • Card is locked and it is other than Class 0 or 7 commands. • It is not supported (illegal opcode). • CRC check failed. • It contains an illegal operand. • It was out of sequence during an erase sequence. If the host sends a command while the card sends data in read operation then the response with an illegal command indication may disturb the data transfer. 5.10.2 Read, Write and Erase Time-out Conditions The times after which a time-out condition for read operations occur are (card independent) either 100 times longer than the typical access times for these operations given below or 100ms. The times after which a time-out condition for Write/Erase operations occur are (card independent) either 100 times longer than the typical program times for these operations given below or 250ms. A card shall complete the command within this time period, or give up and return an error message. If the host does not get any response with the given time out it should assume the card is not going to respond anymore and try to © 2004 SanDisk Corporation 5-6 12/08/04

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123

Chapter 5 – SPI Protocol
Revision 2.2
SD Card Product Manual
© 2004 SanDisk Corporation
5-6
12/08/04
5.9
Clock Control
The SPI bus clock signal can be used by the SPI host to set the cards to energy-saving
mode or to control the data flow (to avoid under-run or over-run conditions) on the bus.
The host is allowed to change the clock frequency or shut it down.
There are a few restrictions the SPI host must follow:
The bus frequency can be changed at any time (under the restrictions of maximum data
transfer frequency, defined by the SD cards).
It is an obvious requirement that the clock must be running for the SanDisk SD Card to
output data or response tokens. After the last SPI bus transaction, the host is required
to provide 8 (eight) clock cycles for the card to complete the operation before shutting
down the clock. Throughout this 8-clock period, the state of the CS signal is irrelevant.
It can be asserted or de-asserted. Following is a list of the various SPI bus transactions:
A command/response sequence. Eight clocks after the card response end bit. The
CS signal can be asserted or de-asserted during these eight clocks.
A read data transaction; eight clocks after the end bit of the last data block.
A write data transaction; eight clocks after the CRC status token.
The host is allowed to shut down the clock of a “busy” card. The SD Card will complete
the programming operation regardless of the host clock. However, the host must provide a
clock edge for the card to turn off its busy signal. Without a clock edge, the SD Card
(unless previously disconnected by de-asserting the CS signal) will force the dataOut line
down, permanently.
5.10
Error Conditions
The following sections provide valuable information on error conditions.
5.10.1
CRC and Illegal Commands
Unlike the SD Card protocol, in SPI mode the card will always respond to a command. The
response indicates acceptance or rejection of the command. A command may be rejected in
any one of the following cases:
It is sent while the card is in read operation (except CMD12 which is legal).
It is sent while the card is in Busy.
Card is locked and it is other than Class 0 or 7 commands.
It is not supported (illegal opcode).
CRC check failed.
It contains an illegal operand.
It was out of sequence during an erase sequence.
If the host sends a command while the card sends data in read operation then the response
with an illegal command indication may disturb the data transfer.
5.10.2
Read, Write and Erase Time-out Conditions
The times after which a time-out condition for read operations occur are (card independent)
either 100 times longer than the typical access times for these operations given below or
100ms. The times after which a time-out condition for Write/Erase operations occur are
(card independent) either 100 times longer than the typical program times for these
operations given below or 250ms. A card shall complete the command within this time
period, or give up and return an error message. If the host does not get any response with
the given time out it should assume the card is not going to respond anymore and try to