Skip to main content
WojtekP1
Associate II
March 5, 2023
Question

Timer triggered DMA doesn't work

  • March 5, 2023
  • 5 replies
  • 1384 views

I want to sample GPIO state twice per millisecond with DMA.

I used TIM16 as basic counter - setting TIM16 CR1 register to 1, ARR to 32000 (half milisecond) and TIM16 DIER register to enable DMA on update (bit 8).

Timer is checked to work fine. DMA doesn't work. No matter how i set up DMA (circular or not) for peripheral to memory transfer with GPIO_IDR as source - it doesn't work.

Actually - i found that it gets automatically turned off - CCR registers enable bit gets cleared.

What's wrong?

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
March 5, 2023
WojtekP1
WojtekP1Author
Associate II
March 6, 2023

G030

WojtekP1
WojtekP1Author
Associate II
March 6, 2023

G030 has only DMA1 and 5 channels. Does it means it cannot do DMA from GPIO at all?

Not really a problem in my use - it's slow enough (20000 times per second) that i can use interrupt, but may be disabling nonfeature in some use cases.

waclawek.jan
Super User
March 6, 2023

In 'G0, GPIOs are not connected to the bus matrix. See second link above.

JW

WojtekP1
WojtekP1Author
Associate II
March 7, 2023

Fortunately GPIO DMA wasn't required for that project. But good to know in future. GPIO/DMA is excellent feature, sad it's missing there.