cancel
Showing results for 
Search instead for 
Did you mean: 

Timer with dma

SDall
Associate II

Can i use timer configured encoder with dma?

7 REPLIES 7

Describe in more detail what do you want to accomplish.

JW

SDall
Associate II

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

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
Associate II

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

Thanks ​

SDall
Associate II

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

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
Associate II

Ok thanks​