09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>RM0090</strong> DMA controller (DMA)<br />

be forced by hardware to 0xFFFF as soon as the stream is enabled, to respect the following<br />

schemes:<br />

● Anticipated stream interruption: EN bit in DMA_SxCR register is reset to 0 by the<br />

software to stop the stream before the last data hardware signal (single or burst) is sent<br />

by the peripheral. In such a case, the stream is switched off and the FIFO flush is<br />

triggered in the case of a peripheral-to-memory DMA transfer. The TCIFx flag of the<br />

corresponding stream is set in the status register to indicate the DMA completion. To<br />

know the number of data items transferred during the DMA transfer, read the<br />

DMA_SxNDTR register and apply the following formula:<br />

– Number_of_data_transferred = 0xFFFF – DMA_SxNDTR<br />

● Normal stream interruption due to the reception of a last data hardware signal: the<br />

stream is automatically interrupted when the peripheral requests the last transfer<br />

(single or burst) and when this transfer is complete. the TCIFx flag of the corresponding<br />

stream is set in the status register to indicate the DMA transfer completion. To know the<br />

number of data items transferred, read the DMA_SxNDTR register and apply the same<br />

formula as above.<br />

● The DMA_SxNDTR register reaches 0: the TCIFx flag of the corresponding stream is<br />

set in the status register to indicate the forced DMA transfer completion. The stream is<br />

automatically switched off even though the last data hardware signal (single or burst)<br />

has not been yet asserted. The already transferred data will not be lost. This means<br />

that a maximum of 65535 data items can be managed by the DMA in a single<br />

transaction, even in peripheral flow control mode.<br />

Note: When configured in memory-to-memory mode, the DMA is always the flow controller and<br />

the PFCTRL bit is forced to 0 by hardware.<br />

The Circular mode is forbidden in the peripheral flow controller mode.<br />

9.3.16 Summary of the possible DMA configurations<br />

Table 40 summarizes the different possible DMA configurations.<br />

Table 40. Possible DMA configurations<br />

DMA transfer<br />

mode<br />

Peripheral-tomemory<br />

Memory-toperipheral<br />

Memory-tomemory<br />

Source Destination<br />

AHB<br />

peripheral port<br />

AHB<br />

memory port<br />

AHB<br />

peripheral port<br />

AHB<br />

memory port<br />

AHB<br />

peripheral port<br />

AHB<br />

memory port<br />

Flow<br />

controller<br />

Circular<br />

mode<br />

DMA possible<br />

Peripheral forbidden<br />

DMA possible<br />

Peripheral forbidden<br />

DMA only forbidden<br />

Transfer<br />

type<br />

Direct<br />

mode<br />

single possible<br />

burst forbidden<br />

single possible<br />

burst forbidden<br />

single possible<br />

burst forbidden<br />

single possible<br />

burst forbidden<br />

single<br />

burst<br />

Double<br />

buffer mode<br />

possible<br />

forbidden<br />

possible<br />

forbidden<br />

forbidden forbidden<br />

Doc ID 018909 Rev 3 230/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!