Atmel ARM-Based Evaluation Kit for SAM4S16C, 32-Bit ARM® Cortex® Microcontroller ATSAM4S-WPIR-RD ATSAM4S-WPIR-RD Data Sheet

Product codes
ATSAM4S-WPIR-RD
Page of 1231
895
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
The following flowchart (
) shows how to manage a multiple write block transfer with the PDC. Polling 
or interrupt method can be used to wait for the end of write according to the contents of the Interrupt Mask Register 
(HSMCI_IMR).
Figure 38-10. Multiple 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)
 
Set the PDCMODE bit
HSMCI_MR |= PDCMODE
Set the block length
HSMCI_BLKR |= (BlockLength << 16)
Configure the PDC channel
HSMCI_TPR = Data Buffer Address
HSMCI_TCR = BlockLength/4
Send WRITE_MULTIPLE_BLOCK
command
(1)
Read status register HSMCI_SR
Poll the bit
BLKE = 0?
Yes
No
HSMCI_PTCR = TXTEN
Poll the bit
NOTBUSY = 0?
Yes
RETURN
No
Send STOP_TRANSMISSION
command
(1)