Simple Serial Port Tester
Intro
I recently was falling into some issues with a program, using serial lines. After some extended troubleshooting, I became suspicious of the actual mbed pins. So I wrote this program, which did in fact prove one of the serial outputs wasn't working properly.
You Will Need
- A USB connection to a computer with a Terminal Emulator, I used Tera Term on a PC.
- 2 Pieces of Jumper wire to hardwire loops between the tx and rx pins on a serial port.
- The code and an Mbed programmed with it.
Setup
You need to connect the tx and rx ports as shown in the picture below. If you establish that one port is working and another isn't, you can cross wire the ports (as shown below), that way, you can test whether the tx pin is faulty, or the rx. Just remember that for the message to appear in the terminal, both the rx pin and the tx pin have to work. So if "Port two is working" shows up, then that means the tx pin on port 2 is working and the rx pin on port one is working. See the picture below.
Configuring the code
You can comment out port lines if you only want to test one. Otherwise, test both!
The Code
Import programSerial_test
A simple program to test the functionality of Mbed serial pins.
1 comment on Simple Serial Port Tester:
Please log in to post comments.
is the code correct? Not working