Windows Command Terminal Read Usb Tx Rx
Contributors: Joel_E_B, jimblom, maettu_this
Serial Terminal Overview
COM ports. Baud rate. Menses command. Tx. Rx. These are all words that get thrown effectually a lot when working with electronics, peculiarly microcontrollers. For someone who isn't familiar with these terms and the context in which they are used, they can be confusing at times. This tutorial is here to aid you empathise what these terms mean and how they form the larger picture that is serial advice over a terminal.
In brusk, series terminal programs make working with microcontrollers that much simpler. They allow you to see data sent to and from your microcontroller, and that information tin be used for a number of reasons including troubleshooting/debugging, advice testing, calibrating sensors, configuring modules, and information monitoring. Once yous have learned the ins and outs of a terminal application, it tin can exist a very powerful tool in your electronics and programming arsenal.
Covered in this Tutorial
There are lots of different concluding programs out at that place, and they all have their pros and cons. In this tutorial we volition discuss what a terminal is, which final programs are best suited for certain situations and operating systems, and how to configure and use each plan.
Suggested Reading
You should be familiar with these topics before diving into this tutorial. If you need a refresher, experience free to pop on over to these links. We'll be correct here waiting.
- Serial Communication
- Analog vs Digital
- Binary
- Hexadecimal
- ASCII
- Installing FTDI Drivers
- RS-232 vs TTL Series Communication
- Logic Levels
- Connector Basics particularly the USB section
What is a Terminal?
Terminal emulators go past many names, and, due to the varied employ of the word final, there can often exist some defoliation virtually what someone means when they say terminal. Let's clear that up.
Cursory History
To understand the utilize of the word terminal, we must visit the not so distant past. Back when computers where big, bulky, and took upwards unabridged rooms, at that place were just a handful of means to interface with them. Punch cards and paper tape reels where one such interface, but there was too what was known as a last that was used for entering and retrieving information. These terminals came in many form factors, but they before long began to resemble what would become their personal computer descendants. Many consisted of a keyboard and a screen. Terminals that could display text only were referred to as text terminals, and later came graphical terminals. When discussing terminal emulators, it'south these terminal of days past that are being referenced.
An OG terminal
Modernistic Terminals
Today, terminal programs are "emulating" the experience that was working on one of these terminals. They are known equally emulators, applications, programs, terms, TTYs, and then on. For the purposes of this tutorial, just the word concluding will be used. Many terminals apply to emulate specific types of computer terminals, but today, near terminals are more generic in their interface.
When working on a mod operating system, the word last window will often be used to depict working inside 1 of these applications. And, often, when reading other tutorials and hookup guides, you lot will exist requested to open a final window. But know that means to open up whichever ane of these terminals programs strikes your fancy.
It is besides worth noting that many terminal programs are capable of much more than just series advice. Many have network advice capabilities such as telnet and SSH. However, this tutorial volition not encompass these features.
Terminal vs Control Line
A terminal is not a command prompt, though the ii are somewhat similar. In Mac Os, the command prompt is fifty-fifty called Last. Hence the confusion when using that word. Regardless, you tin can perform some of the same tasks in a command prompt that you could likewise perform within a terminal window, but it doesn't work the other way around; y'all cannot issue command line statements within a terminal window. We will become over how to create a series terminal connection within a command line interface after in this tutorial. For now, just know how to distinguish between the two.
Bones Terminology
Here are some terms you should exist familiar with when working within a serial terminal window. Many of these terms are covered in a lot more item in our Serial Communication tutorial. It highly recommended that you read that page as well to get the total picture show.
ASCII - Short for the American Standard Code for Data Interchange's grapheme encoding scheme, ASCII encodes special characters from our keyboards and converts them to 7-bit binary integers that can be recognized by a number of programs and devices. ASCII charts are very helpful when working with serial terminals.
Baud Rate - In short, baud rate is how fast your data is being transmitted and received. 9600 is the standard rate, but other speeds are typical amongst certain devices. Simply remember that all the links in your concatenation of communication have to be "speaking" at the same speed, otherwise data will be misinterpreted on i end or the other.
Transmit (TX) - Besides known as Information Out or TXO. The TX line on any device is at that place to transmit information. This should be hooked up to the RX line of the device with which yous would like to communicate.
Receive (RX) - Also known as Data In or RXI. The RX line on whatsoever device is in that location to receive data. This should be hooked up to the TX line of the device with which you would similar to communicate.
COM Port (Serial Port) - Each device you connect to your computer will be assigned a specific port number. This helps to place each device connected. Once a device has a port assigned to it, that port will be used every time that device is plugged into the computer.
Your device will testify up on your computer as either COM# (if you lot're on a Windows auto) or /dev/tty.usbserial-######## (if y'all're on a Mac/Linux computer), where the #'s are unique numbers or alphabetic characters.
TTY - TTY stands for teletypewriter or teletype. Much like terminal is synonymous with the terminals of old, so too is teletype. These were the electromechanical typewriters used to enter information to the terminal and, thus, to the mainframe. When working with terminals on Mac and Linux, you will frequently see tty used to represent a communication port rather than 'COM port'.
Data, Cease, and Parity Bits - Each package of data sent to and from the concluding has a specific format. These formats tin vary, and the settings of your terminal tin be adjusted appropriately to work with different packet configurations. One of the almost common configurations you'll see is viii-Due north-1, which translates to 8 data bits, no parity fleck, and one stop fleck.
Flow Command - Catamenia control is decision-making the rate at which data is sent between devices to ensure that the sender is non sending data faster than the receiver tin can receive the information. In most applications used throughout these tutorials, yous volition non need to use period control. The menstruation control may also be present in the shorthand note: 8-Northward-1-None, which stands for no flow command.
Carriage Render & Line Feed - Carriage render and line feed are the ASCII characters sent when you lot press the enter key on your keyboard. These terms have roots from the days of typewriters. Carriage render meant the carriage holding the newspaper would return to the starting point of that item line. Line feed (aka new line) meant the carriage should motility to the next line to prevent typing over the previous line.
When typing on a modern keyboard, these terms still utilize. Every time you lot press enter (or render) you are telling your cursor to movement downward to the next line and motion to the beginning of that new line.
Consulting our handy-groovy ASCII table, we tin can see that the character for line feed is 10 (0x0A in hex) and carriage return is 13 (0x0D in hex). The importance of these 2 characters cannot be stressed enough. When working in a terminal window you'll oftentimes need to exist aware of which of these two characters, if not both, are being used to emulate the enter key. Some devices only demand ane character or the other to know that a control has been sent. More than chiefly, when working with microcontrollers, be enlightened of how you are sending data. If a string of 5 characters needs to be sent to the micro, y'all may need a cord that tin can really hold 7 characters on account of the 10 and thirteen sent subsequently every command.
Local Echo - Local echo is a setting that tin be inverse in either the serial terminal or the device to which you are talking, and sometimes both. This setting simply tells the final to impress everything you blazon. The benefit from this is beingness able to come across if you are in fact typing the right commands should you encounter errors. Exist aware, though, that sometimes local echo can come dorsum to seize with teeth you. Some devices will interpret local echo as double type. For example, if you type hello
with local echo on, the receiving device might meet hheelllloo
, which is likely not the correct command. Nearly devices can handle commands with or without local repeat. Just be aware that this can exist an issue.
Serial Port Contour (SPP) - The Series Port Profile is a Bluetooth profile that allows for series communication between a Bluetooth device and a host/slave device. With this profile enabled, yous can connect to a Bluetooth module through a serial terminal. This tin be used for configuration purposes or for communication purposes. While not exactly pertinent to this tutorial, it'due south nonetheless good to know about this profile if you want to apply Bluetooth in a project.
Connecting to Your Device
At present that you know what a terminal is and the lingo that comes with the territory, it'south time to hook up a device and communicate with it. This page volition show yous how to connect a device, how to discover which port it has been assigned, and how to communicate over that port.
What You'll Need
For this example y'all'll need
- An FTDI Bones - 5V or three.3V volition work fine. You can likewise apply an FTDI Cable if that's all y'all have.
- A USB Mini-B Cable - (Non necessary if you take an FTDI Cablevision.)
- A jumper wire - Almost FTDI products have female headers, so a male-to-male person jumper cable should suffice. Or, you could just use a piece of wire that is stripped on both ends.
Discovering Your Device
One time you lot have all your supplies fix, adhere the FTDI Basic to the USB cable, and adhere the cable to your estimator. If this is the first time you've plugged in a device of this nature into your computer, you may need to install the drivers. If this is the case, visit our FTDI Driver Installation Guide. If the drivers are all up to date, carry on.
Depending on which operating system you're using, in that location are a few different ways to discover which port your device has been assigned.
Device Manger (Windows)
No matter which version of Windows yous have, you have a programme called Device Director. To open up device manger, open up the start card, and type
devmgmt.msc
into the search bar. Press enter, and it'll open right upwardly. Or, yous can right-click on MyComputer, select Backdrop, and open the Device Manger from there (Windows 7). If you lot intend on using your figurer to communicate with several series devices, it may be worth creating a desktop shortcut to Device Manger.
One time you've got Device Manger open, expand the Ports tab. Here is where the information we demand lives.
In this paradigm, we have just a few COM Ports showing upwards. The start thing to know is that COM1 is ALWAYS reserved for the true Series Port, non USB. Yous know those grey, beefy cables, which have a DB9 connection on each stop. Yes, that series port. Many computers (specially laptops) no longer have serial ports, and they are becoming obsolete in commutation for more USB ports. Nevertheless, the OS yet reserves COM1 for that port for people who still take an true serial port on their computer.
Another port that is probable to bear witness up on most computers is LPT1. This is reserved for the parallel port. Parallel ports and cables are becoming even more obsolete than serial cables, but, again, many computers still accept these ports (they're oft used to connect to printers) and accept to adapt for that in the Os.
With those out of the mode, we can focus on the ports that we do need to use. Now with your FTDI plugged in, you should see a new COM port go added to the list.
Typically, your computer volition enumerate your devices. For example, if this is the first serial communication device y'all've plugged into your figurer, information technology should enumerate every bit COM2. On my reckoner this is the non the first device I've plugged in, but rather the eighth, so it has enumerated as COM9 (don't forget almost COM1).
What'due south of import to know is that in one case a device has been associated with your reckoner and has had a port assigned to information technology, the computer will recall that device every time it's attached. Then, if you have an Arduino board that has been assigned COM4 for example, it is not necessary to open Device Manger and bank check which COM port it is on every fourth dimension, considering that device will now always be on COM4. This can be skillful and bad. Most people volition never plug more than a couple dozen series devices into their computers. Nonetheless, some people will plug in lots of devices, and your computer tin can only assign so many ports (256 if I think correctly). Thus, it may be necessary to delete some COM ports. Nosotros will hash out that in the tips and tricks section.
If you exercise have multiple devices and are not sure which device is the ane yous just plugged in, unplug it, picket for whichever COM port disappears, then plug it back in. The COM port should reappear letting you know that's the device y'all're looking for.
One last thing to mention is that all serial devices, fifty-fifty if they require unlike drivers, will show up as COM ports in Windows. For instance, an Arduino Uno and the FTDI Bones both have different drivers and are technically two unlike types of devices. Windows doesn't discriminate. Information technology will treat both devices the same, and all you lot have to worry most is with which COM port it'due south associated. Mac Os and Linux care for this slightly differently. Read on to find out.
Command Line (Mac, Linux)
Similar to Windows, Mac OS and Linux assign a specific port to every device attached to the computer. Nevertheless, dissimilar Windows, there is no specific program you lot tin can open up to view all the devices currently attached. Have no fear. There is all the same a simple solution to find you device.
The default command line interface for Mac Os X is Terminal. To open it, go to your Utilities folder. There you should meet the icon for Terminal. I'grand going to presume that if you're using Linux, y'all already know how to open a command line window.
Once open, you should see the typical terminal screen.
To come across a list of all the available Serial ports on both Mac and Linux, type this command:
ls /dev/tty.*
You lot should now run across a list of all serial ports on your figurer.
You'll notice a few Bluetooth ports on there. I have several Bluetooth devices paired with my computer, so yous may accept more or less devices that testify upwardly depending on what devices take been paired with your figurer. (Observe the SPP portion of these names. That indicates that Bluetooth device can talk to the serial terminal as well.)
The of import devices to note are the tty.usbserial
and the tty.usbmodem
. For this case I have both an FTDI Basic and an Arduino Uno plugged into my figurer. This is just to show you lot the key difference between the ii. Equally mentioned before, some devices are treated differently depending on how they communicate with the figurer. The FT232 IC on the FDTI basic is a true serial device, and, thus, it shows up as usbserial
. The Uno on the other paw, is an HID device and shows upwardly as a usbmodem
device. The HID (Man Interface Device) profile is used for keyboards, mice, joysticks, etc., and, as an HID device, the reckoner treats it slightly different despite the fact that is can even so send serial information. In either case, these tty.usb______
ports are what we're later on when connecting to a serial final.
Repeat Test
With that out of the way, information technology's time to actually communicate with the FTDI. The specifics of each terminal program will be discussed in the following sections. This example will exist shown in CoolTerm, merely exist aware that this can exist done with whatsoever terminal.
Open up up a last with the correct settings: 9600, eight-Due north-1-None.
Make sure local repeat is turned off for this exam.
Take your jumper wire and connect it to the TX and RX lines of the FTDI Basic.
Now blazon!
Everything you type should exist displayed in the terminal window. It's nothing fancy, simply you are now communicating with the final. Data is being sent from your keyboard, to the estimator, through the USB cable to the FTDI, out the FTDI's TX pivot, into the RX pivot, back through the USB cablevision, into the computer, and is finally displayed in the last window. Don't believe me? Unplug the jumper and type some more than. Pending yous did turn local repeat off, you should not encounter anything existence typed. This is the echo examination.
Extra Credit
If you have two FTDI boards or other similar series devices, try hooking up both of them. Connect the TX line of one to the RX line of the other and vise versa. And so, open ii serial concluding windows (yes, you lot can take multiple concluding windows open up at once), each connected to a different device. Make sure they are both fix to the aforementioned baud rate and settings. So connect, and start typing. What you type in one final should testify up in the reverse final and vise versa. You've just created a very simplistic chat customer!
Now let's explore the different final programs.
Arduino Serial Monitor (Windows, Mac, Linux)
The Arduino Integrated Development Environment (IDE) is the software side of the Arduino platform. And, because using a terminal is such a big part of working with Arduinos and other microcontrollers, they decided to included a serial terminal with the software. Inside the Arduino environs, this is called the Serial Monitor.
Making a Connection
Serial monitor comes with any and all version of the Arduino IDE. To open up it, only click the Serial Monitor icon.
The icon is located to the right of the other icons in Arduino 0023 and below.
The icon is located to the far right in Arduino ane.0 and beyond.
Selecting which port to open in the Serial Monitor is the same equally selecting a port for uploading Arduino lawmaking. Go to Tools -> Serial Port, and select the correct port.
In one case open, you should see something similar this:
Settings
The Serial Monitor has express settings, but enough to handle most of your serial communication needs. The first setting you can alter is the baud rate. Click on the baud charge per unit driblet-downwards menu to select the the correct baud charge per unit.
You tin also change the enter key emulation to carriage return, line feed, both, or neither.
Last, yous can the the last to autoscroll or non by checking the box in the bottom left corner.
Pros
- The Serial Monitor is a neat quick and easy way to found a serial connection with your Arduino. If you lot're already working in the Arduino IDE, there's really no need to open a divide concluding to display data.
Cons
- The lack of settings leaves much to be desired in the Series Monitor, and, for advanced serial communications, it may non exercise the trick.
Hyperterminal (Windows)
HyperTerminal is the defacto final plan for any Windows Bone up to XP -- Windows Vista, 7, and 8 don't include it. If you're on Windows Vista, seven, or eight, and really just accept to have HyperTerminal, a little scouring of the Internet should turn up some workarounds. Meliorate alternatives are more easily bachelor however- we'll get to those shortly.
If you're on a pre-Vista machine, and only have HyperTerminal to work with, here are some tips and tricks for using it:
Initiating a Connection
When initially opening upward HyperTerminal, information technology volition present you with a "Connection Description" dialog. Enter any name you please, and, if you lot really want to get fancy, select your favorite icon. Then hit "OK". (If this window didn't popular up go to File > New Connection to open information technology.)
None of the settings in this beginning window take whatsoever effect on the series advice.
On the next window, ignore the first three text boxes -- we're not working with a dial-upward modem here. Exercise select your COM port side by side to the "Connect using" box. So hit "OK".
The settings on the side by side box should look pretty familiar. Make sure the "$.25 per 2nd" dropdown is prepare to the correct baud rate. And verify that all of the other settings are correct. Hit "OK" once everything looks right in that location.
It doesn't look similar much, only you now have an open terminal! Type in the blank white surface area to send information, and anything that is received by the final will evidence up there as well.
Adjusting Settings
At that place are some express adjustments nosotros can brand to the HyperTerminal UI. To observe them, go to File > Backdrop. Under the "Settings" tab you'll see most of the options.
If y'all desire to see what yous're typing in the final, you lot tin can turn on local repeat. To flip this switch, hit the "ASCII Setup" button, then check "Echo typed characters locally".
The other settings are very specific to formatting how characters are sent or received. For most cases they should exist permit be.
Those who have used HyperTerminal have either come to accept it for what it is, or sought out some other -- any other(!) -- concluding program. It'due south not bang-up for serial advice, but it does piece of work. Let'south explore some of the improve alternatives!
Tera Term (Windows)
Tera Term is one of the more popular Windows terminal programs. It'south been around for years, it'southward open source, and it'due south simple to use. For Windows users, it's one of the all-time options out there.
You tin can download a copy from hither. One time you have Tera Term installed, open up it up, and let'southward poke effectually.
Making a Connexion
You should initially exist presented with a "TeraTerm: New connectedness" pop-upward within the program. Here, you can select which serial port yous'd like to open up up. Select the "Serial" radio button. Then select your port from the drib-down menu. (If this window doesn't open when you outset TeraTerm, you lot can get here by going to ****File > New connection..."**.)
That'll open up the port. TeraTerm defaults to setting the baud rate at 9600 bps (8-N-1). If you demand to adjust the serial settings, get up to Setup > Series Port. You'll see a window popular up with a lot of familiar looking serial port settings. Accommodate what you need to and hitting "OK".
The championship of your TeraTerm window should change to something like "COM##:9600baud" -- adept sign.
That's about all at that place is to it. The blank window with the blinking cursor is where information is both sent (by typing information technology in) and received.
TeraTerm Tips and Tricks
Local Echo
It can be weird to type stuff in the window and not see it prove up in the terminal. Information technology's undoubtedly still flowing through the serial terminal to your device, but it tin be difficult to type when y'all don't have any visual feedback for exactly what yous're typing. You tin can turn on local echo by going to the Setup menu and selecting Terminal.
Check the Local echo box if you'd like to turn the feature on.
At that place are other settings to be made in this window as well. You lot can conform the size of the terminal (the values are in terms of characters per row/column), or adjust how new-lines are displayed (either a carriage return, line feed, or both).
Articulate Buffer and Clear Screen
If yous want to clear your terminal screen you can use either the "Clear buffer" or "Articulate screen" commands. Both are located nether the Edit menu.
Clear screen will exercise just that, bare out the final screen, but any data received will nonetheless be preserved in the buffer. Scroll upwardly in the window to have some other look at it. Articulate buffer deletes the entire buffer of received data -- no more than data to roll up to.
Shortcut Keys
Menus are a pain! If y'all want to go really fast with TeraTerm, think some of these shortcuts:
- ALT+N: Connects to a new series port.
- ALT+I: Disconnects from the current port.
- ALT+V: Pastes text from clipboard to the series port (non CTRL+5).
- ALT+C: Re-create selected text into clipboard (not CTRL+C).
- CTRL+TAB: Switch between ii TeraTerm windows.
Real-Term (Windows)
TeraTerm is awesome for simple ASCII-only serial terminal stuff, but what if yous need to send a string of binary values ranging from 0-255? For that, we like to utilize RealTerm. RealTerm is designed specifically for sending binary and other hard-to-type streams of data.
RealTerm is available to download on their SourceForge page.
Setting Up the Series Port
When you lot open upward RealTerm, you'll be presented with a blank window like below. The top half is where you'll blazon data to send, and it'll too display data received. The lesser one-half is split into a number of tabs where we adjust all of the settings.
Let'southward go connected! To begin, navigate to the "Port" tab. On the "Port" dropdown here, select the number of your COM port. Then, make sure the baud rate and other settings are right. You can select the baud charge per unit from the dropdown, or type it in manually.
With all of those settings adapted, you'll have to click "Open" twice to close and re-open the port (clicking "Change" doesn't piece of work until subsequently y'all've established a connection on a COM port).
That's all there is to that! Type stuff in the black ether higher up to send data, and anything received past the terminal will pop up in that location as well.
Sending Sequences of Values
The power to send long sequences of binary, hexadecimal, or decimal values is what really sets RealTerm apart from the other terminal programs we've discussed.
To admission this function, head over to the "Send" tab. Then click into either of the two text boxes next to "Send Numbers". This is where you enter your number sequence, each value separated past a space. The numbers can be a decimal value from 0 to 255, or a hexadecimal value, which are prefixed with either a "0x" or a '$'. One time yous have your string typed out, striking "Send Numbers" and away they go!
Why would you demand this you ask? Well, let's say you had a Series Seven Segment Display hooked upward to an FTDI Basic, which is connected to your computer. This is a pretty cool setup -- you can control a 7-segment brandish by merely typing in your terminal. Just what if you wanted to dim the brandish? You'd need to ship two sequential bytes of value 123 and 0. How would yous exercise that with the handful of keys on a keyboard? Consulting an ASCII table to friction match binary values to characters, yous'd have to press DEL for 127 and CTRL+SHIFT+2 (^@) for 0...or simply use the "Send" tab in RealTerm!
Adjusting the Display
Only every bit y'all can apply RealTerm to send literal binary values, you lot can likewise utilise it to display them. On the "Display" tab, nether the "Display Every bit" section are a wide assortment of terminal brandish choices. You can take data coming in displayed equally standard ASCII characters, or y'all tin can accept them testify up as hex values, or any number of other display types.
Incoming bytes are displayed equally hexadecimal values. Can you decode the cloak-and-dagger message?!
RealTerm is preferred for more advanced last usage. We'll employ it when we demand to send specific bytes, merely for more than bones terminal applications, TeraTerm is our go-to emulator.
YAT - Nonetheless Another Terminal (Windows)
YAT is a convenient and characteristic-rich serial terminal. It features text also as binary communication, predefined commands, a multiple-certificate user interface and lots of extras.
YAT is bachelor to download at SourceForge.
Appearance
YAT features a multiple-certificate user interface (MDI) that consists of a single workspace with one or more terminals.
Workspace
Each terminal can be configured according to the device it shall be communicating with. These actress features make a final especially easy to use:
- Text command console
- File command list
- Unlimited number of predefined commands
- Drop-down of contempo commands
Each terminal has its ain monitor to display outgoing and incoming data. The view can be configured as desired:
- Time stamp
- Line number
- End-of-line sequence
- Line length
- Line and bytes manual charge per unit
- Chronometer
Well-nigh of these features can be enabled and configured, or hidden for a cleaner and simpler user interface.
Detailed Monitor
Monitor Status
Terminal Settings
- Text or binary communication
- Advice port type:
- Serial Port (COM)
- TCP/IP Client, Server or AutoSocket
- UDP/IP Socket
- USB series HID
- Specifc settings depending on port type
Serial COM Port Settings
TCP and UDP Settings
USB Series HID Settings
Text Terminal Settings
- Full support of any known ASCII and Unicode encoding
- Terminate-of-line configuration
- Predefined and free-text sequences
- Possibility to define divide EOL for Tx and Rx
- Send and receive timing options
- Grapheme substituion
- Comment exclusion
Text Final Settings
Binary Terminal Settings
- Configuration of protocol and line representation
- Possibility to define separate settings for Tx and Rx
Binary Final Settings
Avant-garde Settings
- Various display options
- Various advanced communication options
- Specialized communication options for serial ports (COM)
Advanced Settings
Extras
- Escapes for bin/oct/december/hex like
\h(4F 4B)
- Escapes for ASCII controls like
<CR><LF>
every bit well as C-style\r\n
- Special commands such every bit
\!(Delay)
,\!(LineDelay)
and\!(LineRepeat)
- Versatile monitoring and logging of sent and received data
- Formatting options for first-class readability
- Powerful keyboard operation including shortcuts for the most important features
- Versatile shell/PowerShell command line
- x86 (32-flake) and x64 (64-bit) distribution
Predefined Commands
Log Settings
Monitor Format
Alter Management and Back up
YAT is fully hosted on SourceForge. Characteristic Requests and Bug Reports can be entered into the co-ordinate tracker. Both trackers can be filtered and sorted, either using the predefined searches or the list view. Support is provided by a few simple helps integrated into the application, some screenshots on the SourceForge page, and the project's electronic mail if none of the above can help.
Development
YAT is implemented in C#.Internet using Windows.Forms. The source lawmaking is implemented in a very modular way. Utilities and I/O sub-systems tin also be used independent on YAT, e.thou. for any other .NET based application that needs serial communication, command line treatment or just a couple of convenient utilities. Testing is done using an NUnit based test suite. Project documentation is washed in OpenOffice. For more details and contributions to YAT, refer to Help > Well-nigh.
CoolTerm (Windows, Mac, Linux)
CoolTerm is useful no matter which operating system you're using. Nonetheless, information technology is especially useful in Mac OS where there aren't as many last options as there are in Windows.
You can download the latest version of CoolTerm here.
Making a Connectedness
Download and open up a CoolTerm window.
To change the settings, click the Options icon with the picayune gear and wrench. Yous'll be presented with this menu:
Here, you can select your port, baud rate, bit options, and flow command.
Now click on the Terminal tab on the left.
Hither, y'all can change the enter fundamental emulation (railroad vehicle return/line feed), turn local echo off or on, and you tin switch between line mode and raw mode. Line mode doesn't ship data until enter has been pressed. Raw style sends characters directly to the screen.
One time all your setting are correct, the Connect and Disconnect buttons will open and shut the connectedness. The settings and status of your connectedness will be displayed in the lesser left corner.
If you need to clear the data in the terminal screen, click the Clear Data icon with the large red X on it.
If you're getting annoyed with not existence able to use the backspace, plow on 'Handle Backspace Character' under the Terminal tab under Options.
Extended Features
One awesome characteristic of CoolTerm is Hex View. If you lot want to see the bodily hex values of the data you are sending rather than the ASCII values, Hex View is a tremendous help. Click the View Hex icon. The concluding's appearance will change slightly. At present whatever you type will evidence up equally hex and ASCII. The first cavalcade is only keeping rail of line numbers. The second column is the hex values, and the last column is the actual ASCII characters you blazon.
Here I've typed howdy and \
To go back to ACSII mode, click the View ASCII icon.
You can also use the Send Cord option to transport entire strings of text. In the connectedness menu, select Send String.
You should now accept a dialog box with which to transport your string in hex or ASCII style.
ZTerm (Mac)
You can download the latest version of ZTerm here
ZTerm is another concluding choice for Mac users. Compared to CoolTerm, it seems a lot less user friendly, however, one time y'all observe your fashion effectually, it'due south simply as useful.
Making a Connection
When yous commencement open ZTerm, you exist greeted with this prompt:
Cull the right port, and click OK.
Y'all should now take a blank terminal window.
*Note: One time you've made a connexion, ZTerm will open the near contempo connection every time you run it. This can be annoying if you have multiple connections available. To get effectually this motorcar connect, hold down the SHIFT central as y'all start ZTerm. This will bypass the auto connect and enquire you to which port you'd like to connect.
Once you're connected, you tin can change the terminal settings past going to Settings -> Connection.
Hither you tin modify the baud rate (data rate); parity, data, and end bits; menses control; and turn local repeat on or off.
If y'all need to alter your port after establishing a connection, go to Settings -> Modem Preferences.
Choose the correct port nether the Serial Port dropdown card.
Other Features
ZTerm has lots of other uses for network communication, but that is beyond the scope of this tutorial.
1 overnice feature that tin exist used is the macros. Become to Macros -> Edit Macros.
Hither you can create macros that send any strings/commands you lot'd like. Accept a command that yous're typing constantly? Make a macro for it!
Command Line (Windows, Mac, Linux)
Every bit mentioned before, yous can apply command line interfaces to create serial connections. The major limiting factor is the lack of connectedness options. Most of the programs nosotros've discussed then far have a slew of options that y'all can tweak for your specific connection, whereas the control line method is more than of a quick and dingy style of connecting to your device in a compression. Here's how to accomplish this on the three major operating systems.
Terminal and Screen (Mac, Linux)
Mac
Open up Terminal. See the Connecting to Your Device section for directions.
Now type ls /dev/tty.*
to see all bachelor ports.
You can now use the screen
command to to establish a simple serial connection.
Type screen <port_name> <baud_rate>
to create a connection.
The terminal will get blank with but a cursor. Yous are at present connected to that port!
To disconnect, type control-a
followed by command-\
. The screen will then ask if you are sure yous want to disconnect.
In that location are other options you lot tin can control from screen, however information technology is recommended that you only use this method if you are comfortable with the command line. Type man screen
for a total list of options and commands.
Linux
The screen
command tin can also be used in Linux. There are only a few variations from the Mac instructions.
If y'all do non have screen installed, get it with sudo apt-get install screen
.
Making a connection is the aforementioned as Mac.
To disconnect, type command-a
so shift-thou
.
That's all there is to it.
MS-DOS Prompt (Windows)
The fastest way to get to the control line in Windows is to click on the start menu, type cmd
into the search field, and press Enter.
This will open up a blank MS-DOS command line prompt.
To be able to issue Serial commands, you must commencement enter PowerShell. Blazon powershell
to get into PowerShell command mode.
To run across a list of all the available COM ports, type
[System.IO.Ports.SerialPort]::getportnames()
You should now come across something like this..
Now create an instance of the port you lot desire with this command
$port= new-Object System.IO.Ports.SerialPort COM#,Baudrate,None,viii,one
With that, you can at present connect to and send data to or from that COM port.
$port.open up() $port.WriteLine("some string") $port.ReadLine() $port.Close()
Over again, this method of serial advice is simply recommended for avant-garde command line users.
Tips and Tricks
Changing/Deleting COM Ports (Windows)
At that place may come a time when you need a device to exist on a specific COM port. An instance of this is, in older versions of TeraTerm, you could only connect to COM ports 16 and below. Thus, if your device was on COM 17, you'd have to change information technology to connect to it. This problem has been addressed in newer versions of TeraTerm, but there are many other programs out there that only allow a sure number of COM ports.
To become effectually this, we'll accept to swoop into Device Manger.
Open Device Manger, and expand the ports tab.
Now right-click on the port yous want to alter. Select Properties.
In Properties, go to Port Settings, and select Advanced.
Here, you'll see a drop downwards menu with all the available COM ports in it. Some of them will have (in use) side by side to them. These are the ports that take been assigned to a serial device.
Notice that COM 9 doesn't have an (in use) adjacent to it because that is the port we are currently working with.
If we wanted to change COM 9 to COM three, we only select COM 3 in this carte, and click OK. The (in use) next to COM 3 should become away. Whatever was connected to COM 9 is now associated with COM three, and whatsoever was associated with COM 3 has at present been overwritten.
If you demand to clear out some old COM ports, y'all tin follow the steps to a higher place but for numerous COM ports.
WARNING: Do not select COM 1 when cleaning upwardly sometime ports. This trick is merely for if you actually demand it and shouldn't be performed very often, for sanity's sake.
TTY vs CU (Mac, Linux)
In Unix and Linux environments, each serial advice port has two parts to it, a tty.*
and a cu.*
. When you look at your ports in say the Arduino IDE, yous'll run across both for one port.
The difference between the 2 is that a TTY device is used to phone call into a device/organization, and the CU device (call-up) is used to call out of a device/system. Thus, this allows for two-manner advice at the aforementioned time (total-duplex). This is more important to know if you are doing network communications through a last or other plan, but information technology is yet a question that comes up often. Just know that, for the purposes of this tutorial, ever use the tty option for series communication.
Cannot Connect to That Port!
You tin only take ane connection to a particular port open at any given time (just you tin can have multiple terminal windows connected to dissimilar ports open up at the same time). Thus, if yous accept an Arduino Series Monitor window open up and try to connect to that same port on a different terminal programme, it will yell at you and say it could not constitute a connection with that port or some such jazz. If you are ever having problem connecting to a port, make sure it'southward not open somewhere else.
If you lot don't take another connection open and withal tin can't connect, brand sure all your settings (baud rate, etc.) are correct.
Connected, Merely Can't Run across Any Data
If you are connected to the correct port but don't see whatever data, there are ii possible culprits. First check your baud rate. I know I audio like a broken record, simply baud rate is the nearly important setting to friction match upwards. Check that baud!
The other culprit could be that the TX and RX lines are reversed. Make sure you have TX->RX and RX->TX.
Programming Arduino and Series Advice
The Arduino has one dedicated UART, which is just the fancy proper name for the serial TX and RX lines. Information technology is over these ii lines that the Arduino gets programmed. Thus, when working with the Arduino (or other microcontrollers) it'due south best to avoid using these lines to communicate with other serial devices, especially if you are developing your code and demand to upload frequently.
What happens is, if you have another device hooked up to the UART, the information from your calculator might non get interpreted correctly by the Arduino leading to lawmaking not working the style it'due south supposed to or non getting uploaded at all.
The same rule applies to serial terminals. If you have a terminal open on the aforementioned port that you are trying to plan, it won't work. Arduino will throw some errors almost non being able to communicate with that port. If this happens, close your connectedness, and try once more.
One unproblematic mode around this is to use the Software Series Library built into Arduino to create a divide UART for exterior series communication. That way, your Arduino can communicate on ane port while yet leaving the default UART open for programming.
Resources and Going Farther
That was a lot of information! At the very least, yous should walk away from this knowing what a final window is, how to use it, which terminal programme is best suited for you lot and your operating arrangement, and how to navigate that program's interface. Again, terminal programs are a very powerful tool when working with series devices and microcontrollers. Now become collect some data!
If y'all'd like to know more about dissimilar types of communication, visit these tutorials:
- Serial Peripheral Interface
- ItwoC
To see some products that crave the use of a serial terminal, check out these claw-upwards guides:
- OpenLog Hookup Guide
- Bluetooth Mate and BlueSMiRF Hookup
- RN-52 Audio Bluetooth Hookup
Or check out this blog related post:
Your favorite terminal didn't make the list? Tell us which concluding emulator is your favorite and why in the discussion section.
Source: https://learn.sparkfun.com/tutorials/terminal-basics/all
0 Response to "Windows Command Terminal Read Usb Tx Rx"
Post a Comment