cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1 PWM wit DMA?

astrid
Associate II
Posted on November 26, 2015 at 00:46

Můžete zadat text �?i webovou adresu nebo

https://translate.google.cz/?tr=f&hl=cs

.

https://translate.google.cz/?tr=t&hl=cs

</div>

Zobrazuje se překlad pro text

Přeložit raději text

If

I understand

correctly, the function

HAL_TIM_PWM_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length)

Start PWM and over DMA transfer data from  pData to CCR1 register of Timer.

If I''m true and CCR1 is 16bit register why is pData pointer on

uint32_t

?

How use it with for example uint16_t Buffer[1000];?

2 REPLIES 2
Posted on November 26, 2015 at 18:10

Himark.aster,

If you have a look to the definition of the register CC1 under stm32f1*.h, you will find that it is declared of type uint32_t

__IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */

The fact that CCR1 is a 16 bit register is not contradictory with declaring it as uint32_t . The goal is to keep the code homogeneous. By consequence, if you want to use an uint16_t buffer, you must change all related variables and parameters in the HAL library, which is not obvious. -Shahrzad-
astrid
Associate II
Posted on November 26, 2015 at 21:50

Thank you for answer

.