在linux下,用minicom作为终端连接ARM开发板。由于电脑没有串口,需要用usb转串口
首先接上usb转串口,在终端输入:
lsusb查看信息:
crazyleen@crazyleen-desktop:/dev$ lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
其中这个Bus 003 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port就是我的usb转串口器
然后查看器驱动: ls /dev/ttyUSB*
crazyleen@crazyleen-desktop:/dev$ ls /dev/ttyUSB*
/dev/ttyUSB0
我的串口设备文件就是/dev/ttyUSB0
接下来设置minicom
提示:安装minicom:sudo apt-get install minicom
输入:sudo minicom
Welcome to minicom 2.4
OPTIONS: I18n
Compiled on Jan 25 2010, 06:49:09.
Port /dev/tty8
Press CTRL-A Z for help on special keys
按 TCRL+A,然后按下Z
Welco+-------------------------------------------------------------------+
| Minicom Command Summary |
OPTIO| |
Compi| Commands can be called by CTRL-A |
Port | |
| Main Functions Other Functions |
Press| |
| Dialing directory..D run script (Go)....G | Clear Screen.......C |
| Send files.........S Receive files......R | cOnfigure Minicom..O |
| comm Parameters....P Add linefeed.......A | Suspend minicom....J |
| Capture on/off.....L Hangup.............H | eXit and reset.....X |
| send break.........F initialize Modem...M | Quit with no reset.Q |
| Terminal settings..T run Kermit.........K | Cursor key mode....I |
| lineWrap on/off....W local Echo on/off..E | Help screen........Z |
| Paste file.........Y | scroll Back........B |
| |
| Select function or press Enter for none. |
| |
| Written by Miquel van Smoorenburg 1991-1995 |
| Some additions by Jukka Lahtinen 1997-2000 |
| i18n by Arnaldo Carvalho de Melo 1998
按下o选择设置串口通讯
Welcome to minicom 2.4
OPTIONS: I18n
Compiled on Jan 25 2010, 06:49:09.
Port /dev/tty8
Press CTRL-A Z for help on special keys
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
+--------------------------+
选择| Serial port setup
Welcome to minicom 2.4
OPTI+-----------------------------------------------------------------------+
Comp| A - Serial Device : /dev/tty8 |
Port| B - Lockfile Location : /var/lock |
| C - Callin Program : |
Pres| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : Yes |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-----------------------------------------------------------------------+
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
+--------------------------+
按下A设置设备:/dev/ttyUSB0,按下F关闭flow control
然后保存成dft,就退出
ok,设置完毕
minicom 参数
minicom -D /dev/ttyS0 -b 57600 -8 -c on