Skip to main content
SDall
Associate III
Aug 30, 2019 10:32 AM UTC
Question

Timer with dma

Can i use timer configured encoder with dma?

This topic has been closed for replies.

7 replies

waclawek.jan
Super User
Aug 30, 2019 8:21 PM UTC

Describe in more detail what do you want to accomplish.

JW

SDall
SDallAuthor
Associate III
Aug 31, 2019 10:14 AM UTC

Can i transfer count=TIM1->CNT if tim1 is in encoder mode, tim1 channel1 and tim1 channel2 are in dma ,without cpu interraction?

​

​

waclawek.jan
Super User
Aug 31, 2019 7:17 PM UTC

You of course can, but upon what stimulus do you want to do that transfer, i.e. how do you want to trigger the DMA?

If you base it on CH1 or CH2, which are the encoder inputs, you'll get 1, 2, 3, 4... or 4, 3, 2, 1... when you turn/move the encoder, which I doubt is what you want.

Maybe you should tell us, what is your ultimate goal.

JW

SDall
SDallAuthor
Associate III
Aug 31, 2019 7:30 PM UTC

my ultimate goal is to overload the cpu as little as possible using the dma and dedicate the cpu to other processes!

Thanks ​

SDall
SDallAuthor
Associate III
Aug 31, 2019 7:31 PM UTC

tell me if I'm wrong to think!!!

waclawek.jan
Super User
Sep 1, 2019 6:35 AM UTC

The timer in encoder mode runs automatically, with no involvement from the processor. You don't need DMA, you read it out only when you want to know its current position.

JW

SDall
SDallAuthor
Associate III
Sep 1, 2019 2:15 PM UTC

Ok thanks​