Skip to main content
SDall
Associate III
August 30, 2019
Question

Timer with dma

  • August 30, 2019
  • 7 replies
  • 1064 views

Can i use timer configured encoder with dma?

This topic has been closed for replies.

7 replies

waclawek.jan
Super User
August 30, 2019

Describe in more detail what do you want to accomplish.

JW

SDall
SDallAuthor
Associate III
August 31, 2019

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
August 31, 2019

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
August 31, 2019

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
August 31, 2019

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

waclawek.jan
Super User
September 1, 2019

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
September 1, 2019

Ok thanks​