Can I connect the RX to TX within the same MCU

Thread Starter

bug13

Joined Feb 13, 2012
2,002
Hi guys

It may sound like a silly question, can I connect the TX and RX (of usart) within the same pic (or other MCUs), and if I send one byte out, I can received the same byte?

I have tried it, but it doesn't seem to work in my pic18f24j10. my RX is handle in interrupt.

I have only 0 out, but if I connect my RX to some random signal, I can get some data out.
 

Thread Starter

bug13

Joined Feb 13, 2012
2,002
One thing I need to point out is that I am not using standard baud rate, does it make any different?
 

Papabravo

Joined Feb 24, 2006
21,159
No that should not make a difference. Of course you should make sure you are actually transmitting before you do the loopback.
 

joeyd999

Joined Jun 6, 2011
5,236
Yes. I do this to 'self-check' the comms on some of my products.

In one case, I have an optical interface. I use a mirror to bounce back a test code...confirming both transmission and reception.
 
Top