Page 1 of 1

STM32F1 DMA

Posted: Fri Feb 14, 2020 8:17 am
by serkanc
Hi,

I try to implement XY2-100 galvo mirror scanner control protocol. I want to use dma for setting gpio pins. I

rcc_clk_enable(RCC_DMA1);
DMA1_BASE->CPAR1 = (uint32_t)&GPIOA->regs->ODR;
DMA1_BASE->CMAR1 = (uint32_t)pingBuffer;
DMA1_BASE->CNDTR1 = 10;
DMA1_BASE->CCR1 = (DMA_CCR_PL_HIGH | DMA_CCR_DIR_FROM_MEM | DMA_CCR_MINC | DMA_CCR_PSIZE_32BITS | DMA_CCR_MSIZE_8BITS);

I can copy pingBuffer to GPIO ODR register when I enable Dma channel (DMA1_BASE->CCR1 |= DMA_CCR_EN;) if I add Mem2Mem to CCR register. How can I use Timer2 Channel 3 ( According to rm0008 datasheet, Peripharel request signal for DMA1 Channel 3 --> Timer2 Ch3, ADC1, Timer4 Ch1 ) as DMA trigger source without using Timer overflow, because signal is 2Mhz and will overhead cpu....
Thanks

Re: STM32F1 DMA

Posted: Fri Feb 14, 2020 12:27 pm
by serkanc
I found. After enabling Timer2 Channel 3, Timer Dier Register should be updated with this bit
Bit 11 CC3DE: Capture/Compare 3 DMA request enable