新手上路
- 积分
- 38
- 金钱
- 38
- 注册时间
- 2020-2-13
- 在线时间
- 20 小时
|
5金钱
精英板与上位机通过USB串口通信,上位机可以接收到STM32发送的数据,但是STM32无法接收到上位机发送的数据,串口调试助手可以成功通信,为什么自己编程的上位机就不能通信,请问可能是什么原因?是上位机软件缺少什么设置吗?
STM32的程序代码如“串口实验“
上位机程序:
SeiralPort spcom = new SerialPort();
spcom.PortName = "COM5";
spcom.BaudRate = 115200;
spcom.Parity = System.IO.Ports.Parity.None;
spcom.DataBits = 8;
spcom.StopBits = System.IO.Ports.StopBits.One;
spcom.Open();//打开串口
spcom.Write("YES");//向开发板发送数据
spcom.Close();
|
|