2023-06-21 05:40 AM
i am sending data on serial is 3 when is display is this 3 but i can conver in bninary then become 00110011 instead 00000011.and when i invert it then i got 01100110 instead of 11111100 ,why so ?
2023-07-21 11:58 PM
IR Remote with STM32
Today in this tutorial I am going to interface IR Remote with STM32 microcontroller. IR Remote Controllers and receivers follow some standard protocols for sending and receiving data. Some of these protocols are NEC , JVC , SIRC etc. Here we will be discussing only the NEC protocol. I will also use LCD16x2 to display the key pressed on the remote. But first let’s see what NEC protocol is.
2023-07-22 12:02 AM
Interfacing IR Sensor With STM32 Discovery Board:
https://www.mathaelectronics.com/interfacing-ir-sensor-with-stm32-discovery-board/
2023-07-22 12:40 AM
thank you but thet are using TSOP,we are not using TSOP,we are using Simple IR Recevier
2023-07-22 12:41 AM
thank you but they are just interface the IR module ,but we want to tranmit the signal
2023-07-22 03:25 AM - edited 2023-07-22 03:26 AM
Hello
If external logic inverter helps to get right data, probably setting Rx line inversion on does the same thing (or Tx line). It seems that data is totally interved when it goes thru IR transmitter and receiver.
If you are using STM32/HAL/Cube you should find this setting under advanced features of Uart/Usart:
Maybe this way you finally get your data inverted :D
Br J.T
2023-07-23 08:57 PM
right
2023-07-23 08:58 PM
but may i know what operation they have used ?:D
2023-07-23 10:13 PM - edited 2023-07-23 10:15 PM
@Ranjeet Singh wrote:but may i know what operation they have used ?:D
It's a polarity reversal, so if the transmitter sends in normal mode, and the receiver receives with reversed polarity, the bits are reversed. It should look similar to what the bitwise function does (var2 = ~(val1);).
Note: The TTL signal (0V to 5V or 3.3V) is already inverted in the RS232 protocol, so it's good not to confuse things.
2023-07-23 11:08 PM
when i use (var2 = ~(val1);). this operation the data not match it becoome another data and that is the confusion why it become another data
2023-07-23 11:12 PM
@Ranjeet Singh wrote:when i use (var2 = ~(val1);). this operation the data not match it becoome another data and that is the confusion why it become another data
Your problem is really a mystery, if maybe you could share your code for someone to test maybe someone can give some more assertive help.
Anyway, it might be interesting to watch these debug videos:
STM32CubeIDE Advanced Debug Features