General-purpose timer (TIM2)
As an example, the timer DMA burst feature is used to update the contents of the CCRx
registers (x = 2, 3, 4) upon an update event, with the DMA transferring half words into the
CCRx registers.
This is done in the following steps:
1.
Configure the corresponding DMA channel as follows:
–
–
–
–
2.
Configure the DCR register by configuring the DBA and DBL bit fields as follows:
DBL = 3 transfers, DBA = 0xE.
3.
Enable the TIMx update DMA request (set the UDE bit in the DIER register).
4.
Enable TIMx
5.
Enable the DMA channel
This example is for the case where every CCRx register has to be updated once. If every
CCRx register is to be updated twice for example, the number of data to transfer should be
6. Let's take the example of a buffer in the RAM containing data1, data2, data3, data4, data5
and data6. The data is transferred to the CCRx registers as follows: on the first update DMA
request, data1 is transferred to CCR2, data2 is transferred to CCR3, data3 is transferred to
CCR4 and on the second update DMA request, data4 is transferred to CCR2, data5 is
transferred to CCR3 and data6 is transferred to CCR4.
Note:
A null value can be written to the reserved registers.
26.3.21
Debug mode
When the system enters debug mode (processor core halted), the TIMx counter either
continues to work normally or stops, depending on DBG_TIM2_STOP configuration bit in
DBGMCU module. For more details, refer to
peripheral freeze register 1
866/1454
DMA channel peripheral address is the DMAR register address
DMA channel memory address is the address of the buffer in the RAM containing
the data to be transferred by DMA into CCRx registers.
Number of data to transfer = 3 (See note below).
Circular mode disabled.
(DBGMCU_APB1FZR1).
Section 38.12.3: DBGMCU CPU1 APB1
RM0453 Rev 2
RM0453
Need help?
Do you have a question about the STM32WL55JC and is the answer not in the manual?
Questions and answers