Skip to main content
Edwin kaus
Associate III
November 3, 2017
Question

Technical douts on STM32F7 MCU(Timers)

  • November 3, 2017
  • 5 replies
  • 914 views
Posted on November 03, 2017 at 13:57

Hai.,

I am using STM32F765BIT MCU in our application with custom board. Especially I am using this card in data acquisition system. Here the very big challenge is to measure frequency of 6 channels.(Every SEC I need to capture frequencies of all channels).

I have to capture 4 channel lower frequencies(range of 2Hz to 80Hz) & 2 channel higher frequencies (range of 70Hz to 10KHz). 

>> What is best way to met this requirement & how to use DMA in timer capture mode.

>> Also if I use multiple channels of same timer does It effect the accuracy of capture.

>> And I am worried about interrupts , I have USB,SPI & I2C interfaces and all are interrupt based(additionally this frequency capture interrupts) .Does MCU can able to manages all these interrupt effectively.

>> And I found 3 types of timers (basic timer ,advanced timer & general purpose timer), what is major difference b/w these timers, Can I use any of the timer for input capture mode .

I need to clarify these things before proceeding further , If one of your expert spare some time to clarify this It would be appreciated lot.

Best Regards

Edwin.

Thank you., 

#keil5 #input-capture-mode #stm32f765bit #timer-interrupts
This topic has been closed for replies.

5 replies

Tesla DeLorean
Guru
November 3, 2017
Posted on November 03, 2017 at 14:18

10 KHz isn't a particularly high frequency. Using TIM2 and TIM5 you could support 8 channels, certainly in a range 100 KHz .. 0.001 Hz

>> What is best way to met this requirement & how to use DMA in timer capture mode

DMA probably not helpful here, multiple registers addresses

>> Also if I use multiple channels of same timer does It effect the accuracy of capture.

No, it is latching on edges

Input Capture can also decimate using the prescaler, ie timestamp every 8th rising edge.

External Count mode would require more resources, probably take a bunch of work to fit, and use internal/external triggers at 1HZ using 1PPS to latch.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
Edwin kaus
Associate III
November 4, 2017
Posted on November 04, 2017 at 06:57

Hai .,

Thank you for the response, Unfortunately in our design we are not using both 32 bit timer, presently I am using 3 timer each has 2 channels (out of those only one is 32bit). Additionally I am using 2 basic timer of 1 sec & and 1ms time.

>> Frequency capture is simply measuring time count b/w two rising edges, that is not the issue.

>>But  For 1 channel I need to count number of pulses for every second , to achieve this is there any inbuilt counter or any mechanism. Please suggest. 

Thank you.,

Ben K
Senior III
November 3, 2017
Posted on November 03, 2017 at 15:47

>> What is best way to met this requirement & how to use DMA in timer capture mode.

You can use 2 TIM timers as Clive suggested. Look into the timers' Burst DMA mode, it facilitates transfer of several consecutive registers through DMA on a single event.

>> And I am worried about interrupts , I have USB,SPI & I2C interfaces and all are interrupt based(additionally this frequency capture interrupts) .Does MCU can able to manages all these interrupt effectively.

With the NVIC of the Cortex core you can configure the interrupts with different preemption priority, meaning each of them have the possibility to preempt any lower priority interrupt handler.

>> And I found 3 types of timers (basic timer ,advanced timer & general purpose timer), what is major difference b/w these timers, Can I use any of the timer for input capture mode .

Channels 1 to 4 of TIM timers are capable of input capture, independent of the other features. So just pick two timers that have 4 and 2 channels at least.