cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Timer OC register for DMA transfer.

BTrem.1
Senior II

Hi All,

I'm using a STM32F302R8 and want to transfer timer 2 capture/compare values to memory using DMA. What source address do I use for the TIM2 OC register? I'm calling HAL_DMA_Start() to do this and need the source address of TIM2->OR.

Thanks,

5 REPLIES 5

0693W000000X6JFQA0.png

?

JW

&TIM2->CCR3

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I saw the 'address offset' in the ref manual but didn't know what it meant or what it referred to. Now I realize there is a table of boundary addresses for the peripherals. -- Thanks

As Clive said below - albeit not exactly in these words - you don't need to be bothered about the particular addresses, as long as you use the CMSIS-mandated device headers, you just simply take the address of the register written in the headers' symbols.

JW

I tried this: HAL_DMA_Start(&hdma_tim2_ch1, (uint32_t) &TIM2->CCR1, (uint32_t) buffer1, 01);

and at least it compiled without error 😉 --thanks