cancel
Showing results for 
Search instead for 
Did you mean: 

unable to read 32kHz oscillator signal on ETR pin

santulaz
Associate II

Hi all,

i'm working with a STM32F469i-discovery board trying to read the  external signal at 32kHz coming from an RTC module. The oscillating signal voltage is a CMOS type. I'm using TIM2_ETR input located on pin PA15 configured as follow. I'm not able to read any pulse on the pin and every time that I run the system the oscillator voltage fall to 0.3V instead of the 2.5V that I can measure when the system is not running.

I test the oscillator signal on Arduino board and I can read the right frequency just connectin the oscillator output to Arduino pin8.  Thanks for the support.

santulaz_0-1715841214088.png

santulaz_1-1715841237699.png

santulaz_2-1715841274580.png

 

 

11 REPLIES 11
AScha.3
Chief

Hi,

you need to choose PA5 (or other) -> = an  input , NOT any push-pull output ! (or whatever pin cube gives you with your case as ETR clk input)

AScha3_0-1715842656512.png

 

If you feel a post has answered your question, please click "Accept as Solution".
santulaz
Associate II

Hi, thankyou for your replay, I'm not able to select any other pin configuration, if I link PA15 to TIM2_ETR this is the only configuration possible from the menu. If I set PA15 as input i loose the connection to TIM2_ETR that is automatically changed to PA5.

 

santulaz_0-1715843968979.png

 

If you choose etr2 as clk , you see a pin as input in gpio -> this pin is your clk input now !

just look, what cube shows you...you might choose another pin by remap, if possible, then this is the input.

But you cannot choose any pin, you like !

If you feel a post has answered your question, please click "Accept as Solution".

Ok, i just tried on a H743 here, cube giving me PA0 as ETR input (or PA5, or PA15 ).

So you did everything ok, i think.

Select one of them , the this is your etr-clk input (try PA5) .

No put your 32k clk on this pin, and what happens ?

If you feel a post has answered your question, please click "Accept as Solution".

Don't set Channel 1 to Output Compare.

JW

santulaz
Associate II

it always count until 6 and it stop, I also change RTC module 3 times but the result is the same, oscillator stop working (voltage dorp to 0.3V), if i disconnect the oscillator from the board it restart wiht the sandard behavior.

 

Channel 1  "output compare no output" is the only possibility that is given for this configuration

santulaz_0-1715851579847.png

 

> Channel 1 "output compare no output" is the only possibility that is given for this configuration

That might be OK, but what I see in registers is definitively not "no output".

In particular CCER=1 means, that CH1 is enabled; and as in CCMR1 it is set to Output compare, given pin turns to output (TIM2_CH1 is shared with TIM2_ETR on PA15).

I don't use Cube/CubeMX so can't tell how can you avoid this using Cube/CubeMX. It may be a bug in Cube/CubeMX.

I generally recommend you to use register-based programming instead, but some here find that an extereme approach.

JW

>Channel 1  "output compare no output" is the only possibility that is given for this configuration

no.

set CC1 : disable :

AScha3_0-1715867173606.png

 

If you feel a post has answered your question, please click "Accept as Solution".
santulaz
Associate II

you are righ, i tested this configuration on both pins (PA5 and PA15), no changes, it reach a value of 7 and stops counting

santulaz_0-1715869081209.png