使用VB进行通过串口读写flash memery的代码和时序请教
- UID
- 128732
- 性别
- 男
|
使用VB进行通过串口读写flash memery的代码和时序请教
qy4a的片子
如果我想读某个flash地址里的数据,是不是可以这样写:
Private Sub Receive_Click()
Dim i As Integer Dim d1 As Long Dim ten As Long Dim shiliu As String
'发送读指令 Dim readCommand(1) As Byte readCommand(0) = &H4A MSComm1.Output = readCommand 'txtReceive.Text = readCommand(0) '延时等待 d1 = Timer()
Do DoEvents Loop Until Timer() - d1 > 1.15
'发送高位地址
ReDim SendData(1) ten = CLng("&H" & txtReceiveHigh.Text) shiliu = Hex$(ten) SendData() = shiliu MSComm1.Output = SendData 'txtReceive.Text = SendData
'延时等待 d1 = Timer() Do DoEvents Loop Until Timer() - d1 > 1.15 '发送低位地址
ten = CLng("&H" & txtReceiveLow.Text) shiliu = Hex$(ten) SendData() = shiliu MSComm1.Output = SendData 'txtReceive.Text = SendData
'延时等待 d1 = Timer() Do DoEvents Loop Until Timer() - d1 > 1.15 '接收读取数据 ReDim ReceiveData(1) ReceiveData = MSComm1.Input txtReceive.Text = ReceiveData 'If txtReceive = "" Then MsgBox "没有收到有效数据"
这样行嘛?? |
|
|
|
|
|
- UID
- 106783
- 性别
- 男
|
你这样说我不明白,你想要干什么?单片机的程序是怎么样的? |
|
|
|
|
|