- 0
- 0
- 约2.29千字
- 约 6页
- 2026-02-05 发布于山西
- 举报
串口返回接收到的数据实验
实验现象:
通过串口助手发送数据到单片机,同时单片机将接收到的数据发
送到串口助手
实验步骤:
1.本实验无需连线,直接通过模块进行串口实验
2.程序
程序后关闭软件
3.设置串口助手
打开串口
设置好后就可以发送数据,将需要发送的数据写入发送框,点击发送,
同时接收区返回您刚才发送的数据!
常见问题解决方法:
1.提示当前串口已被占用
请您程序后关闭软件
2.无法返回数据
请您检查程序是否正确,串口助手是否设置正确,本串口
实验是利用模块做的,所以能程序就说明串口是没有问
题的!
4.返回的数据乱码
请检查串口助手的波特率设置是否为4800,因为例程的波特率设置
的是4800
5.自写程序设置9600波特率乱码
因51单片机用12Mhz的晶振时使用9600波特率误差较大,您可
以把晶振换成11.0592MHz晶振解决
ExperimentonReturningReceived
DataviaSerialPort
ExperimentalPhenomenon:
Senddatatothemicrocontrollerusingaserialportassistant,and
simultaneouslyhavethemicrocontrollersendthereceiveddatabackto
theserialportassistant.
ExperimentalSteps:
1.Thisexperimentdoesnotrequireanywiring;itcanbeconducted
directlythroughthedownloadmodulefortheserialporttest.
2.Download
theprogram.
Closethedownloadsoftwareafter
downloadingtheprogram
3.Setuptheserial
portassistant
打开串口
Aftersettingitup,youcansenddatabywritingtherequireddatainto
thesendbox,clickingsend,andthereceiveareawillreturnthedata
youjustsent!
o
CmmonSolutionsto
Issues:
1Promptindicatingthecurrent
.
serialportisoccupied
Pleaseclosethedownloadsoftware
afterdownloadingtheprogram.
2.Unabletoreturn
data
Pleasecheckiftheprogramhasbeendownloadedcorrectly
andiftheserialassistantsettingsarecorrect.Thisserial
experimentusesadownloadmodule,sobeingabletodownloadthe
programindicatesthatthereisnoissuewiththeserialport!
4.Returneddatais
garbled
Pleasecheckifthebaudratesettingintheserialassistantissetto4
原创力文档

文档评论(0)