Datasheet
Figure 40-8. Read Functional Flow Diagram
Read status register HSMCI_SR
Send SELECT/DESELECT_CARD
command
(1)
to select the card
Send SET_BLOCKLEN command
(1)
Read with DMAC
Number of words to read = 0 ?
Poll the bit
RXRDY
= 0?
Read data = HSMCI_RDR
Number of words to read =
Number of words to read -1
Send READ_SINGLE_BLOCK
command
(1)
Yes
Set the DMAEN bit
HSMCI_DMA |= DMAEN
Set the block length (in bytes)
HSMCI_BLKR |= (BlockLength << 16)
Configure the DMA channel X
DMAC_CSAx.SA = Data Address
DMAC_CUBCx.UBLEN = BlockLength/4
DMAC_GE.EN[x] = TRUE
Send READ_SINGLE_BLOCK
command
(1)
Read status register HSMCI_SR
Poll the bit
XFRDONE = 0?
Y
es
RETURN
RETURN
YesNo
No
No
Yes
No
Number of words to read = BlockLength/4
Reset the DMAEN bit
HSMCI_DMA &= ~DMAEN
Set the block length (in bytes)
HSMCI_BLKR l= (BlockLength<<16)
Set the block count (if neccessary)
HSMCI_BLKR l= (BlockCount<<0)
Note 1: It is assumed that this command has been correctly sent (see the Command/Response Functional Flow
Diagram).
40.8.4 Write Operation
In write operation, the HSMCI Mode Register (HSMCI_MR) is used to define the padding value when writing non-
multiple block size. If the bit P
ADV is 0, then 0x00 value is used when padding data, otherwise 0xFF is used.
If set, the bit DMAEN in the HSMCI DMA Condiguration Register (HSMCI_DMA) enables DMA transfer.
SAM E70/S70/V70/V71 Family
High-Speed Multimedia Card Interface (HSMCI)
© 2019 Microchip T
echnology Inc.
Datasheet
DS60001527D-page 935










