cancel
Showing results for 
Search instead for 
Did you mean: 

PA0 and NUCLEO-H743ZI

jakob.brunhart
Associate III

Hello,

I want to use TIM3 as 32-Bit counter. Clock source is set to ETR2. The corresponding Pin is PA0. For test purpose I use TIM3 to generate a clock signal (Pin PC6) to feed the TIM3 counter.

Connecting these to pins together (PA0 and PC6) results in an clock signal with an offset. The reason is, that PA0 is driving 3.3V.

Any idea why PA0 is driving 3.3V?

I'm using NUCLEO-H743ZI.

Regards

Jakob

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for coming back with the solution.

Please mark your post as "Best" so that the thread is tagged as solved.

JW

View solution in original post

4 REPLIES 4

> The reason is, that PA0 is driving 3.3V.

Check TIM1_MODER and TIM1_AFRL if PA0 is set properly for TIM1 AF; and check if TIM1_SMCR.ECE is set for External clock mode 2.

JW

jakob.brunhart
Associate III

Thank you for your response.

PA0:

GPIOA_MODER: MODE0 = 0x02 // Alternate function mode

GPIOA_AFRL0: AFSEL0 = 0x01 // Alternate function AF1

AF1 for PA0 => TIM2_CH1/TIM2_ETR // I'm using TIM2 as counter

TIM2:

SMCR: ECE = set // External clock mode 2 enabled.

AF1: ETRSEL = 0x00 // ETR input is connected to I/O

In my opinion, the registers listed above are set correctly.

Besides PA0 I also tried PA5 and PA15 as ETR. Same behaviour.

Using TIM5 as counter everthing works fine. I compared the register entries in debug mode of the two timers (TIM2 and TIM5). They are the same. Also for the associated GPIOs.

The only difference is that the alternate function of the associated GPIOs of TIM2 is: TIM2_CH1 / TIM2_ETR and of TIM5: TIM5_ETR.

I was thinking if TIM2 uses TIM2_CH1 instead of TIM2_ETR.

Any advice is welcome.

Regards

Jakob

jakob.brunhart
Associate III

Hi,

I could solve my Problem.

I have used TIM2 as counter with compare mode. I connected the counter signal to Pin PA0 which was mapped to TIM2_ETR (Alternate Function AF1). Further I used Channel 1 for compare output. The compare output is also mapped to PA0!!!

AF1 is defined as: TIM2_CH1 / TIM2_ETR

Now I'm using Channel 2 for the compare output and the result is, that PA0 is not affected.

Regards

Jakob

Thanks for coming back with the solution.

Please mark your post as "Best" so that the thread is tagged as solved.

JW