Skip to main content
Atilla Mete Turedi
Associate III
September 27, 2017
Solved

STM32L4 Demodulated Infrared Receiver Input

  • September 27, 2017
  • 1 reply
  • 1538 views
Posted on September 27, 2017 at 14:16

Greetings community,

I am developing an IR learning hardware that can transmit its learned IR codes as well. For the transmitter part, I will be using the IR_OUT pin (PA13).

For the receiver part, from AN4834, I understand that a General Purpose Timer needs to be configured in PWM input to capture incoming demodulated IR data. The STM32L4 has 3 x GP Timers, namely TIM15, TIM16 and TIM2, As TIM 15 and TIM 16 are used for the modulation of the transmitted Infrared signal, that leaves me only with TIM2 to be used for my specific purpose.

That brings it to my question; which pin should I connect the demodulated infrared signal at STM32L4 so I can use TIM2 as PWM input to capture the data stream.

Best Regards,

Mete

#general-purpose-timers #tim2 #tim #ir #pwm #ir_out #tim16 #stm32l4 #infrared
This topic has been closed for replies.
Best answer by Vangelis Fortounas
Posted on September 28, 2017 at 00:05

Hello Mete!

which pin should I connect the demodulated infrared signal at STM32L4 so I can use TIM2 as PWM input to capture the data stream.

You may use TIM2_CH1 or TIM2_CH2 as PWM inputs.

Inside of your device's DataSheet, you will find the exact pins which are connected internaly to theese TIM2 channels.

The next example is from RM0394

In same RM,   TI1 is the TIM2_CH1 pin and TI2 is TIM2_CH2 pin.

0690X00000608INQAY.png

 this example uses  TI1 as the PWM input .

0690X00000608PSQAY.png0690X00000608IDQAY.png

There are also working examples how to use PWM input at L4

https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubel4.html

Regards

vf

1 reply

Vangelis Fortounas
Associate II
September 27, 2017
Posted on September 28, 2017 at 00:05

Hello Mete!

which pin should I connect the demodulated infrared signal at STM32L4 so I can use TIM2 as PWM input to capture the data stream.

You may use TIM2_CH1 or TIM2_CH2 as PWM inputs.

Inside of your device's DataSheet, you will find the exact pins which are connected internaly to theese TIM2 channels.

The next example is from RM0394

In same RM,   TI1 is the TIM2_CH1 pin and TI2 is TIM2_CH2 pin.

0690X00000608INQAY.png

 this example uses  TI1 as the PWM input .

0690X00000608PSQAY.png0690X00000608IDQAY.png

There are also working examples how to use PWM input at L4

https://my.st.com/content/my_st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubel4.html

Regards

vf

Atilla Mete Turedi
Associate III
September 28, 2017
Posted on September 28, 2017 at 07:36

Dear Vangelis,

Thank you very much for your detailed response. I understand that the adjacent signal to the selected channel is also used for the PWM input because both edges need to be detected.

Does this mean that the pin the adjacent channel is connected cannot be used for other purposes?

Best Regards,

Mete

Vangelis Fortounas
Associate II
September 28, 2017
Posted on September 28, 2017 at 15:20

Hello again.

Does this mean that the pin the adjacent channel is connected cannot be used for other purposes?

It can used for other purposes yes. except TIM2_CHx because this functionality is connected internal to the other pin

x is the non used input.(1, or 2).

E.g. it can used as normal GPIO pin.

Regards

Vf