cancel
Showing results for 
Search instead for 
Did you mean: 

Can we use encoder mode of a Timer for driving pump and also use same Timer to drive the speaker both connected at different channels.

A3
Associate III

Hi,

My requirement is to use encoder mode of a Timer for driving pump. And using same Timer to drive the speaker. 

Timer 1 channel 1 would be used for Pump and Timer 1 channel 2 would be used for speaker. Timer 1 DMA is used to output sequence of pulse train for generating tones on speaker

Is this possible to use the different channels of the same Timer for two different functionalities?. Both functionalities should work simultaneously also.

3 REPLIES 3

Each TIM has a singular counting registers, so I'm thinking the answer in NO

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for quick reply @Community member​ .

OK but then if Timing or Count register is single for each timer, then what is the purpose of 6 independent channels of each Timer?

@Community member​ Can you please elaborate on below

As mentioned in Ref manual of STM32F779NI, has upto 6 independent channels for:

  1. Input Capture
  2. Output Compare.
  3. PWM Generation.
  4. One Pulse Mode Output.

You have 4/6 latches and comparators, against one counting element.

For then encoder the counting element go up/down based on CH1 and CH2

For PWM Input CH1/CH2 can measure edges, so can quantify period and duty.

I could drive upto 6 servos. They share the SAME frequency, via the counting element, and I can control the pulse width of each channel independently.

I could toggle 6 pins at different phases of the counter.

I could latch a time stamp of 6 different inputs with respect to the counter.

There's perhaps an App Note on the Timers these days?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..