Datasheet

833
32072H–AVR32–10/2012
AT32UC3A3
Figure 31-11. Write Functional Flow Diagram
Note: 1. It is assumed that this command has been correctly sent (see Figure 31-9 on page 829).
2. This field is also accessible in BLKR register.
Write using DMA
No Yes
Yes
Write a zero in the DMA.DMAEN bit
Write the BlockLenght in the MR.BLKLEN field
(2)
Write the block count in the BLKR.BCNT field (if
necessary)
Number of words to write = BlockLength/4
Number of words to write = 0 ?
No
No
Yes
Read the SR register
SR.TXRDY = 0 ?
Write Data to transmit in the TDR register
Number of words to write =
Number of words to write - 1
RETURN
RETURN
Yes
No
Read the SR register
SR.NOTBUSY = 0 ?
Enable the DMA channel X
Write a one in the DMA.DMAEN bit
Write the BlockLenght in the MR.BLKLEN field
(2)
Send SELECT/DESELECT_CARD
Command
(1)
to select the card
Send SET_BLOCKLEN command
(1)
Send WRITE_SINGLE_BLOCK
command
(1)
Send WRITE_SINGLE_BLOCK
command
(1)
Configure the DMA channel X
write the Data Adress in the DMA Controller
write the (MR.BLKLEN)/4 for Transfer Size in the
DMA Controller