cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse counter 80 MHZ.

bassetteporn11
Associate II
Posted on May 11, 2018 at 20:37

Pulse counter 80 mhz input, on 180 MHZ stm32 F479

Hello, I just need to keep count of an external clock input,  wich comes at about 80 mhz.

I dont need to be interrupted or anything, just that this count be accessible at any point in time, reset.

On what pin is this best implemented, pin TIMx_ETR or TIMx_CHx ???

Thank you.

7 REPLIES 7
Posted on May 11, 2018 at 21:26

[EDIT] the original post called for 'Pulse counter 150MHz'[/EDIT]

You can't. The timer samples its input by its clock, i.e. maximum input frequency (with 50% duty signal) is fTIM/2.

See the Timer characteristics  chapter in datasheet.

JW

bassetteporn11
Associate II
Posted on May 11, 2018 at 21:29

OK I will divide this by 2 then,

80 mhz will be the new clock

henry.dick
Senior II
Posted on May 11, 2018 at 22:18

'

On what pin is this best implemented, pin TIMx_ETR or TIMx_CHx ???'

look up the datasheet and see which pins can handle that type of speed. If it is too fast, use an external divider.

if this pulse is always present, one option is to use it as external clock for the chip.

bassetteporn11
Associate II
Posted on May 11, 2018 at 22:37

 I am already multi-tasking and designing another section of a pcb. I truely do not care.

I thought I could be helped by asking here, by somebody who knows by heart this yes or no answer.

bassetteporn11
Associate II
Posted on May 12, 2018 at 00:46

The requirement is for a quick test and quick pcb.

Thus it can be changed and tested rapidly.

I can have a pin that has ETR on TIM8, and CH1 ON TIM2. I guess I have the best possible here, since I will test if my need is required.

180mhz is more than 2 times as fast as 80mhz, so I guess there will be no difference between CH1 TIM2    and ETR TIM8.

Posted on May 11, 2018 at 23:26

I

truely do not care.

Then why would anybody care to answer?

If you want to count on external clock, you can use either TIMx_ETR or TIMx_CH1 or TIMx_CH2. However you have to chose a timer which can run at the system clock (at frequency higher than twice your external signal's). The APB buses (thus timers on them) are not made equal, but there are tweaks to the timers in the newer STM32s. I don't use the 'F479 so I can't tell you more on this.

Btw. changing the original post is not a great idea. Originally you asked for a 150MHz external signal frequency

JW

Posted on May 12, 2018 at 01:28

TIM2/TIM5 are 32-bit on APB1 45 MHz, TIM CLK 90 MHz.

80 MHz is faster than I'd be comfortable with.

D3 (PA1) TIM5_CH2 is exposed on the shield connector of the STM32F469I-DISCO

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