871
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Figure 36-9. Write Functional Flow Diagram
Note:
1. It is assumed that this command has been correctly sent (see
Send SELECT/DESELECT_CARD
command
(1)
to select the card
Send SET_BLOCKLEN command
(1)
Write using PDC
Reset the PDCMODE bit
HSMCI_MR &= ~PDCMODE
Set the block length
HSMCI_MR |= (BlockLenght <<16)
Send WRITE_SINGLE_BLOCK
command
(1)
Set the PDCMODE bit
HSMCI_MR |= PDCMODE
Set the block length
HSMCI_MR |= (BlockLength << 16)
Configure the PDC channel
HSMCI_TPR = Data Buffer Address
HSMCI_TCR = BlockLength/4
Send WRITE_SINGLE_BLOCK
command
(1)
Read status register HSMCI_SR
Poll the bit
NOTBUSY= 0?
Yes
RETURN
No
Yes
No
Read status register HSMCI_SR
Number of words to write = 0 ?
Poll the bit
TXRDY = 0?
HSMCI_TDR = Data to write
Number of words to write =
Number of words to write -1
Yes
RETURN
No
Yes
No
Number of words to write = BlockLength/4
HSMCI_PTCR = TXTEN
Содержание SAM4S Series
Страница 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Страница 1142: ...1142 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 3 100 ball VFBGA Package Drawing ...
Страница 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Страница 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...