0
0
Embedded Cprogramming~10 mins

Memory-to-peripheral transfer in Embedded C - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start the memory-to-peripheral DMA transfer.

Embedded C
DMA_StartTransfer([1]);
Drag options to blanks, or click blank then click option'
ADMA_Channel1
BtransferSize
CperipheralAddress
DbufferAddress
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the buffer address instead of the DMA channel.
Using the peripheral address as the argument.
Passing the transfer size instead of the channel.
2fill in blank
medium

Complete the code to configure the DMA source address for memory-to-peripheral transfer.

Embedded C
DMA_SetSourceAddress([1], buffer);
Drag options to blanks, or click blank then click option'
ADMA_Channel3
BDMA_Channel1
CDMA_Channel2
DDMA_Channel0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different DMA channel than the one started.
Confusing source and destination addresses.
3fill in blank
hard

Fix the error in setting the peripheral destination address for DMA transfer.

Embedded C
DMA_SetDestinationAddress([1], &PERIPHERAL_REG);
Drag options to blanks, or click blank then click option'
ADMA_Channel1
BDMA_Channel3
CDMA_Channel2
DDMA_Channel0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different DMA channel than the one configured for source.
Forgetting to use the address-of operator for the peripheral register.
4fill in blank
hard

Fill both blanks to configure the DMA transfer size and enable the transfer complete interrupt.

Embedded C
DMA_SetTransferSize([1], 256);
DMA_EnableInterrupt([2], TRANSFER_COMPLETE);
Drag options to blanks, or click blank then click option'
ADMA_Channel1
BDMA_Channel2
CDMA_Channel3
DDMA_Channel0
Attempts:
3 left
💡 Hint
Common Mistakes
Using different DMA channels for size and interrupt configuration.
Confusing the interrupt type parameter.
5fill in blank
hard

Fill all three blanks to complete the DMA memory-to-peripheral transfer setup.

Embedded C
DMA_Init([1], buffer, &PERIPHERAL_REG, [2]);
DMA_SetMode([3], MEMORY_TO_PERIPHERAL);
Drag options to blanks, or click blank then click option'
ADMA_Channel1
B256
CDMA_Channel2
D128
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing DMA channels in different function calls.
Using incorrect transfer size values.