2018-01-02 01:04 AM
2018-01-02 02:03 AM
PD1 is SWIM. Are you sure about using the SWIM pin in your application?
Anyway, for using it as GPIO you should disable the SWIM functionality first.
2018-01-02 02:58 AM
Hello
Dragomir.Raimond
,Thanks for your reply. Now, we have been using this swim pin,as General I/O,without disabling the swim function for last 1year, in our many application, we haven't faced any problem yet. Another thing is that I cannot disable the sim functionality,as we often need to reprogram the MCU after final testing. But as you have suggested, I will try disabling the swim pin. But in the code swim has nothing to do with the IR decoding and UART1.RX reception. I am trying to solve this issue, still working on,but haven't got any success.
2018-01-02 05:08 AM
Hi,
unfortunately your code is hard to follow. I don't know how you pasted it in here...
Anyway, there are weird things like:
PD_ODR ^=(1<<6);
in you PortD EXTI interrupt. (PD6 is UART RX).
Also, in the uart init code you have some weird things also, like:
UART1_CR2=(1<<5);
UART1_CR2=(1<<2);The thing is, in such a mess you can easily slip a mistake even yourself. I can understand why you are doing what you are doing, but don't expect anyone else to follow your code in such a state.
2018-01-02 09:41 AM
Sorry for this messy code, next time I'll try to properly paste the code.
I have checked all those things you have mentioned. And also disabled the swim interface. I have red the datasheet, according to that code should work, but When ever I attach IR sensor, UART doesn't work.
I have checked at the hardware level..but everything is ok there. I don't know why it is not working. Thanks.