当前位置:网站首页>Using virtual serial port to debug serial port in keil MDK
Using virtual serial port to debug serial port in keil MDK
2022-06-22 15:10:00 【Weiwenjie top】
Read a lot of articles , It's all very simple ( It's also very simple :)). Give a more detailed tutorial .
1. utilize VSPD take PC Connect the two virtual serial ports on the . As shown in the picture, I will COM2 and COM3 Connect . Click on Addr pair.

2. You can see Virtual ports Connect the two virtual serial ports together .
3. The virtual serial port is ready . First, debug by directly entering the command . We turn on KEIL MDK Of , Set to simulation mode . spot DEBUG. stay COMMAND Serial port input :MODE COM2 38400, 0, 8, 1

explain :
MODE The function of the command is to set the parameters of the bound computer serial port . The basic usage is :
MODE COMx baudrate, parity, databits, stopbits
among :
COMx(x = 1,2,…) Represents the serial port number of the computer ;
baudrate Represents the baud rate of the serial port ;parity Represents the verification method ;
databits Represents the length of data bits ;
stopbits Represents the stop bit length .
for example :MODE COM1 9600, n, 8, 1
Set the serial port 1. The baud rate is 9 600, No parity bit ,8 Bit data ,1 Bit stop bit .
MODE COM2 19200, 1, 8, 1
Set the serial port 2. The baud rate is 19 200, Odd check ,8 Bit data ,1 Bit stop bit .
4、 Click enter , Input again ASSIGN COM2 <S1IN> S1OUT

explain :
COMx Represents the serial port of the computer , It can be COM1、COM2、COM3 Or others ;
inreg and outreg Represents the serial port of single chip microcomputer . For an ordinary single chip microcomputer with only one serial port , namely SIN and SOUT; For a single chip microcomputer with two or more serial ports , namely SnIN and SnOUT(n=0,1,… Serial port number of single chip microcomputer ).
for example :ASSIGN COM1 < SIN > SOUT
Connect the serial port of the computer 1 Serial port bound to MCU ( For single chip microcomputer with only one serial port ).
ASSIGN COM2 < SIN > SOUT
Connect the serial port of the computer 2 Serial port bound to MCU 0( For single chip microcomputer with multiple serial ports , Pay attention to the position of serial port number ).
It should be noted that , The parentheses of parameters cannot be omitted , and outreg There are no parentheses .
5、 Then debug the program . You can see the serial port COM3 Print out the serial port 1 The data of the .

边栏推荐
- Database connection pool: Code Directory
- [introduction to postgraduate entrance examination] analysis of postgraduate entrance examination data of Cyberspace Security Major of Beijing Jiaotong University from 2018 to 2022
- 得物技术复杂 C 端项目的重构实践
- 同花顺如何开户?在线开户安全么?
- Database connection pool: implementation of connection pool function point
- 本周四晚19:00战码先锋第7期直播丨三方应用开发者如何为开源做贡献
- 基于SSH框架甜品商城管理系统【源码+数据库】
- Is the encryption market a "natural disaster" or a "man-made disaster" in the cold winter?
- 网络安全的五大特点有哪些?五大属性是什么?
- 一文彻底弄懂建造者模式(Builder)
猜你喜欢

What does password security mean? What are the password security standard clauses in the ISO 2.0 policy?

数据采集之:巧用布隆过滤器提取数据摘要

得物技术复杂 C 端项目的重构实践

Zhongshanshan: engineers after being blasted will take off | ONEFLOW u

All famous network platforms in the world

C语言学生管理系统(开源)

Reading of double pointer instrument panel (II) - Identification of dial position

网络地址转换NAT
![Front and back management system of dessert beverage store based on SSM framework dessert mall cake store [source code + database]](/img/1b/9060d58d4dbb7f6f3c3a58959b7f14.png)
Front and back management system of dessert beverage store based on SSM framework dessert mall cake store [source code + database]

【Pr】基础流程
随机推荐
基于SSM框架实现的甜品饮品店前后台管理系统甜品商城蛋糕店【源码+数据库】
先锋期货靠谱么?期货怎么开户安全些?
数据库连接池:代码目录
C # WinForm photo album function, picture zooming, dragging, preview Pagination
U++ operator learning notes
Le modèle de diffusion est encore fou! Cette fois - ci, la zone occupée était...
NF-ResNet:去掉BN归一化,值得细读的网络信号分析 | ICLR 2021
Common real machine debugging plug-ins for unity commercial games
How to compare the size of two dates in unity and C #
那些令人懵逼的用户态&内核态
Sword finger offer46 -- translate numbers into strings
[Software Engineering] planning and project management
Biden signe deux nouvelles lois visant à renforcer la cybersécurité du Gouvernement
数据库连接池:连接池功能点的实现
visual studio开发过程中常见操作
晒晒我这两年的私活单,业余时间月入6k,有份副业也太香啦
同花顺如何开户?在线开户安全么?
剑指Offer46——把数字翻译成字符串
What are the five characteristics of network security? What are the five attributes?
Phpstudy 2016 build Pikachu range