Can I connect the RX to TX within the same MCU

Thread Starter

bug13

Joined Feb 13, 2012
1,705
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.
 

Papabravo

Joined Feb 24, 2006
12,389
It should be possible regardless of how the receiver is implemented in firmware.
 

Thread Starter

bug13

Joined Feb 13, 2012
1,705
It should be possible regardless of how the receiver is implemented in firmware.
Hmm, I agree with you, as the datasheet says the usart (in asyn mode) is full duplex, but I can't get it to work. :mad:
 

Thread Starter

bug13

Joined Feb 13, 2012
1,705
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
12,389
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
4,239
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