- Is the UART working?
- Is the transmit pin is transmitting data?
- Is the receive pin receive data?
You want to check whether the UART device is working!!! The simplest method is to do loopback test.
Serial loopback test is a test carry out to verify the communication of a device, particularly in UART. By performing loopback test, the target device sends and receives data using the same port. This technique can be used to troubleshoot serial device. We can just connect the device’s transmitter and receiver pin together to perform this test.
- HyperTerminal (or any relevant terminal software will do)
Loopback test on UC00B
To do the loopback test on UC00B, simply connect the RXD and TXD pins together, using a female to female jumper wire as shown in diagram below.
Connect the UC00B to your computer’s USB port. If this is your 1st time using UC00B, please do go through the User’s Manual to install USB driver. Open HyperTerminal, just key in any name u like and click OK.
Choose the port of UC00B, normally is highest number, in my case it is port 157. Click OK.
Now type any character. Any button pressed will be shown twice. The 1st character is the character computer send out via transmit pin on UC00B (it appears on HyperTerminal because we set the “echo locally”), and 2nd character is the character received by the receive pin, and send to computer. With this, the UART communication is successful, and the UC00B is working properly. If your project is not working, stop troubleshooting UC00B, troubleshoot other parts.
Loopback test for URS232A
To do the loopback test on URS232A, you need to do exactly the same settings as you did for UC00B, connecting the TX and RX of it. Below are the pinout of RS232.
What you need to do is, by any method, connect/short the TXD and RXD pin together. For me, I am soldering it temporary as shown in figure below.
As we know, most of computer and especially laptop does not come with COM port or RS232 port anymore. So to perform loopback test on URS232A, we can utilize the UC00B or UC00A that we verify earlier.
First, make sure the mini jumper (tiny black plastic) on UC00B is at 5V as shown in figure below.
Connect URS232A and UC00B together as shown in figure below.
Note that the VCC, RXD, TXD and GND pins of UC00B go to +5V, DOUT, DIN and GND of URS232A respectively. (Assuming you had connect/short the TXD and RXD pin on URS232A)
Now, connect the UC00A/B to your computer. Repeat the same steps as shown previously.
- Open HyperTerminal.
- Enter the name and OK.
- Choose the port and OK.
- Flow control to “None”.
- Click “Properties” go to “Settings” tab and click the “ASCII setup”.
- Tick the check box “Send line ends with line feeds” and “Echo typed characters locally” and click OK.
- Type in any words to see the result.
If the character you typed appears twince on screen (one transmit and one receive), this means that the communication of the URS232A is working properly.
With loopback test, we can verify the working condition of UC00A/UC00B, and with the help of UC00A/Uc00B, we can further verify the condition of URS232A. In other words, if your project uses any of this devices, and it is not working properly, check other parts, such as baudrate, wiring polarity, etc. Hope this tutorial helps you!
If you have further inquiry, please do discuss in our technical forum as we seldom check the comments in tutorial site.