I am working on a project using Atmel SAMD20 microcontroller (anyway, my question is in a general aspect, so I think this should not affect the answer)
I use an USART to connect my board to the serial port for debugging purposes, TX and RX lines are directly connect to CP2102 RX and TX respectively and I send debug information through the serial port during the whole execution of the program.
When developing stage is over and the product is in use, these pins are no longer used and are left floating.
Everything was fine until I detected that putting noise (just touching BOTH lines with my hands) cause a hardware reset in the uC and the program stop working at all. I suspect that the uC is interpreting that noise as a signal and causing infinity USART interrupts.
What can I do to ignore signal on these pins when the CP2102 is not connected?
What I've tried:
- Setting a pull down in RX pin. Didnt work.
What I definitely CANT do:
- Have two different boards, one for developing and another without those pins when the product is finished.
What I could do:
- Have two different firmwares. One for developing and another for production removing all code related to that USART, avoid it's initialization and sending information through it. But is this the best solution??
Is there any hardware or software change I could do to avoid this problem using just one firmware?