Skip to main content
Rsu.1
Associate II
March 9, 2020
Solved

Problem with stm32l4 tim16

  • March 9, 2020
  • 5 replies
  • 2991 views

I have use stm32l412cbt6 PB9 to input function and i can get the input data,then i configure PB9 to alternate function GPIO_AF14_TIM16 and i can not get the input data.Under the same configuration,PA3 alternate function GPIO_AF1_TIM2 can get the input data.Please give me some advice.

This topic has been closed for replies.
Best answer by waclawek.jan

Maybe there's an error in the the 'L412 datasheet, the AF14 column for PB (and PC) compared to other 'L4 appears to be shifted down one position.

TIM16_CH1 appears to be at PB8 AF14. See also the pin definitions table.

@Imen DAHMEN​ , can you please check if this is the case?

Thanks,

JW

5 replies

waclawek.jan
waclawek.janBest answer
Super User
March 9, 2020

Maybe there's an error in the the 'L412 datasheet, the AF14 column for PB (and PC) compared to other 'L4 appears to be shifted down one position.

TIM16_CH1 appears to be at PB8 AF14. See also the pin definitions table.

@Imen DAHMEN​ , can you please check if this is the case?

Thanks,

JW

ST Technical Moderator
March 10, 2020

Hello,

You are right, TIM16_CH1 should be at PB8 alternate function AF14 instead of PB9.

We will correct this typo in the coming release of the Datasheet.

Best Regards,

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
waclawek.jan
Super User
March 10, 2020

Thanks, Imen.

Please note, that's not only PB8, but the whole PB and PC in column AF14 are shifted down by one cell.

Jan

@Imen DAHMEN​ 

Rsu.1
Rsu.1Author
Associate II
March 9, 2020

I reread the manual from ST official website,the table show that PB9 alternate function AF14 

waclawek.jan
Super User
March 9, 2020

> I reread the manual from ST official website,the table show that PB9 alternate function AF14 

I see that that's in the AF table; however, as I said above I believe this is an error, because

  • it's shifted when compared to other 'L4, and ST usually tries to keep things pin compatible
  • the pin definitions table in the same DS also indicates TIM16_CH1 to be on PB8:

0693W0000000FxHQAU.png

JW

Uwe Bonnes
Chief
March 9, 2020

This is what I get from the device database XML files:

ethernut/nut/include/arch/cm3/stm/generated> grep TIM16_ stm32l41x_pinmux.h

#define TIM16_BKIN_FUNC         58

#define TIM16_CH1_FUNC          59

#define TIM16_CH1N_FUNC         60

       ((gpio == PA06) && (func == TIM16_CH1_FUNC          )) ? 14 : \

       ((gpio == PB05) && (func == TIM16_BKIN_FUNC         )) ? 14 : \

       ((gpio == PB06) && (func == TIM16_CH1N_FUNC         )) ? 14 : \

       ((gpio == PB08) && (func == TIM16_CH1_FUNC          )) ? 14 : \

waclawek.jan
Super User
March 9, 2020

Hi Uwe, ,

If you have a 'L412 board on hand, can you please try, which one is the case?

JW

@Uwe Bonnes​ 

Rsu.1
Rsu.1Author
Associate II
March 10, 2020

i have try a 'l412board and confirm that PB8 alternate AF14