VB串口通信源程序_第1頁
VB串口通信源程序_第2頁
VB串口通信源程序_第3頁
VB串口通信源程序_第4頁
VB串口通信源程序_第5頁
已閱讀5頁,還剩19頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、精選優(yōu)質(zhì)文檔-傾情為你奉上Private Sub Form_Load()  '設(shè)置打開端口  If OpenPort(3) = False Then  MsgBox "串口打開失敗!"  End IfEnd SubPrivate Sub Command1_Click()  Dim sBuf(2) As Byte  sBuf(0) = &H55  sBuf(1) = &H31  sBuf(2) = &HFF  If SendByte(sBuf) = Fal

2、se Then      End IfEnd Sub'收到數(shù)據(jù)產(chǎn)生MSComm事件Private Sub MSComm1_OnComm()  Dim i As Integer  Dim rBuf() As Byte  rBuf = MSComm1.Input  For i = 0 To UBound(rBuf)  Debug.Print rBuf(i)  Next iEnd Sub'串口初始化Private Function OpenPort(PortNum As Integer) As

3、Boolean  On Error GoTo ErrExit '出錯(cuò)轉(zhuǎn)移到ErrExit處理  With Me.MSComm1  .CommPort = PortNum '端口號(hào)  .Settings = "9600,n,8,1" '波特率=9600bps;n(無奇偶校驗(yàn))e(偶校驗(yàn))o(奇校驗(yàn));8位數(shù)據(jù)位;1位停止位  .InputMode = 1 '采用二進(jìn)制數(shù)據(jù)傳輸  .NullDiscard = False 'NULL字符從端口傳送到接受緩沖區(qū)  .DTR

4、Enable = False 'DTR線無效  .EOFEnable = False '不尋找EOF符  .RTSEnable = False 'RTS線無效  .InBufferCount = 0 '清空接受緩沖區(qū)  .OutBufferCount = 0 '清空傳輸緩沖區(qū)  .SThreshold = 0 '不產(chǎn)生MSComm事件  .RThreshold = 1 '產(chǎn)生MSComm事件  .InputLen = 0 '當(dāng)輸入占用時(shí),告訴控件讀入整個(gè)緩沖區(qū)。

5、  .InBufferSize = 256 '接收緩沖區(qū) 默認(rèn)為1024個(gè)字節(jié)  .OutBufferSize = 256 '發(fā)送緩沖區(qū) 默認(rèn)為512個(gè)字節(jié)  .PortOpen = True '打開端口  End With  OpenPort = True '標(biāo)明串口打開  Exit Function '函數(shù)結(jié)束ErrExit: '錯(cuò)誤處理  OpenPort = False '標(biāo)明串口打開失敗End Function '函數(shù)結(jié)束'以二進(jìn)制發(fā)送byte

6、數(shù)組Private Function SendByte(Buf() As Byte) As Boolean  On Error GoTo ErrExit '出錯(cuò)轉(zhuǎn)移到ErrExit處理  With MSComm1  .OutBufferCount = 0 '清空接收緩沖區(qū)  .Output = Buf '發(fā)送數(shù)據(jù)  End With  SendByte = True '標(biāo)明數(shù)據(jù)發(fā)送成功  Exit Function '函數(shù)結(jié)束ErrExit: '錯(cuò)誤處理  SendB

7、yte = False '標(biāo)明串口發(fā)送失敗End Function  程序匠人    2005-9-22 14:23:00     | |  |  VB串口通訊實(shí)例作者:liwenzhao高精度電壓表(24bit)  VB源程序Dim PortValue As Integer    '端口號(hào)選擇1-4Dim value As Double        

8、; '當(dāng)前一次取值Dim value2 As Double        '要顯示的值Dim valueSum As Double        '和Dim numCount As Double      '算平均值是的計(jì)數(shù)個(gè)數(shù)Dim func As Integer         '功能

9、號(hào)標(biāo)志1-4Dim valueFlag As Integer/*' Check1_Click()為控制Command1是否EnabledPrivate Sub Check1_Click()'自動(dòng)刷新 被選中則 刷新按鈕無效If Check1.value Then    Command1.Enabled = FalseElse    Command1.Enabled = True        Command1.SetFocusEnd IfEnd Sub*/*P

10、rivate Sub Command1_Click()    '顯示    Call displayEnd Sub*/Private Sub Command2_Click() '復(fù)位    valueSum = 0 '清計(jì)數(shù)和    numCount = 1 '清計(jì)數(shù)個(gè)數(shù)    Label6.Caption = Str(numCount - 1) '顯示復(fù)位    value

11、= 0    '當(dāng)前一次取值value2 = 0    '要顯示的值valueFlag = 0    Call displayEnd SubPrivate Sub Form_Activate()    numCount = 1    value = 0    valueSum = 0    PortValue = 1    Text1.Vis

12、ible = False    Label6.Caption = "0"    Option1(0).value = True    Option2(0).value = True '為什么兩個(gè)都是True    Command1.SetFocus   'SetFocus是什么?Label1.Caption = Format(value2, "0.000,000")  &

13、#160;'Format為格式輸出函數(shù)For i = 0 To 3        If Option2(i).value = True Then            func = i + 1        End If    Next i    Check1.value = 1&

14、#160;   'Call ComPortOpenEnd SubPublic Sub ComPortOpen() '開串口    With MSComm1        .CommPort = PortValue              '使用COM1      

15、  .Settings = "9600,N,8,1"       '設(shè)置通信口參數(shù)        .InBufferSize = 40        '設(shè)置MSComm1接收緩沖區(qū)為40字節(jié)        '.OutBufferSize = 2  

16、0;     '設(shè)置MSComm1發(fā)送緩沖區(qū)為2字節(jié)        'VB中OutBufferSize是以字符為單位的?.InputMode = comInputModeBinary        '設(shè)置接收數(shù)據(jù)模式為二進(jìn)制形式        .InputLen = 1    

17、0;   'VB中InputLen單位是字符數(shù)'設(shè)置Input 一次從接收緩沖讀取字節(jié)數(shù)為1        '.SThreshold = 1'VB中SThreshold單位是字符數(shù)'設(shè)置Output 一次從發(fā)送緩沖讀取字節(jié)數(shù)為1        .InBufferCount = 0  '清除接收緩沖區(qū)'.OutBufferCount = 0   

18、;  '清除發(fā)送緩沖區(qū)'MaxW = -99        '最大值賦初值 ?        'MinW = 99             '最小值賦初值 ?        'w = 0  &

19、#160;     '數(shù)據(jù)個(gè)數(shù)計(jì)數(shù)器清零        .RThreshold = 1        On Error Resume Next'?        '設(shè)置接收一個(gè)字節(jié)產(chǎn)生OnComm事件/*'打開串口,如打不開,則Err,出現(xiàn)msg      

20、  If .PortOpen = False Then            '判斷通信口是否打開            .PortOpen = True       '打開通信口         

21、60;  If Err Then        '錯(cuò)誤處理                msg = MsgBox(" 串口 COM" & PortValue & " 無效! ", vbOKOnly, "警告")'vbOKOnly顯示確定按鈕   

22、             Exit Sub            End If        End If*/    End With    'MsgBox "端口已打開"End SubPublic Sub Co

23、mPortClose() '關(guān)串口    MSComm1.PortOpen = False    '   MsgBox "端口已關(guān)閉"End SubPrivate Sub MSComm1_OnComm()    Call reciveEnd SubPrivate Sub Option1_Click(Index As Integer)    If MSComm1.PortOpen = True Then 

24、0;      Call ComPortClose    End If    PortValue = Index + 1    Call ComPortOpenEnd SubPrivate Sub recive() '檢測起始位并接收數(shù)據(jù)    Dim Buffer As Variant    Dim Arr() As Byte    Dim inData(5

25、) As Byte    Dim count  As Integer    Dim temp As Byte    '  MsgBox "OnComm"    With MSComm1            Select Case .CommEvent      

26、;      '判斷MSComm1通信事件 CommEvent ?                Case comEvReceive                    '收到Rthresho

27、ld個(gè)字節(jié)產(chǎn)生的接收事件                    Buffer = .Input                    Arr = Buffer     &

28、#160;              '讀取一個(gè)接收字節(jié)                    ' Text1.Text = Arr(0)          

29、60;         If Arr(0) = &H1B Then                       ' &H表示是十六進(jìn)制數(shù),1B即27 ?是27.RThreshold = 0      

30、60;                 Do                            DoEvents    

31、60;                   ' DoEvents是什么?Loop Until .InBufferCount >= 4                       

32、0;'這里的4是不是應(yīng)該是40                        For i = 1 To 4                     &#

33、160;      'count = .InBufferCount                            Buffer = .Input          

34、                  Arr = Buffer                            inData(i) = Arr(0)

35、0;                       Next i                        If inData(4) = &

36、HA Then                            If (inData(1) Mod 64) >= 32 Then                

37、;                .RThreshold = 1                                Exit S

38、ub                            End If                     

39、60;      valueFlag = 1                            '0.              

40、;              temp = inData(1) Mod 16                            If temp <= 7 Then  &#

41、160;                             value = inData(1) Mod 8                 &#

42、160;              value = value * 256 * 256                                value

43、 = value + Val(inData(2) * 256                                value = value + Val(inData(3)         

44、                       value = value * 3.5E-06                        

45、        'Text1.Text = Format(value, "0.000,000")                            Else      

46、                          value = inData(1) Mod 8                     

47、           value = value * 256 * 256                                value = value + Val(inData(

48、2) * 256                                value = value + Val(inData(3)            

49、0;                   value = value * 3.5E-06                           

50、0;    value = 0 - value                            End If               

51、60;            temp = inData(1) Mod 128                            ' test OF     

52、                       If temp >= 64 Then                        &#

53、160;       If value < 0 Then                                    value = value - 0. 

54、0;                              Else                    

55、;                value = value + 0.                                End

56、 If                            End If                     &#

57、160;      '檢測自動(dòng)刷新                            If Check1.value Then            

58、;                     'valueFlag = 1                          

59、0;      Call display                            End If              &#

60、160;         Else                            .RThreshold = 1           

61、;                 Exit Sub                        End If        &

62、#160;               .InBufferCount = 0                        .RThreshold = 1      &#

63、160;             End If            Case Else        End Select    End With    'Text1.Text = Text1.Text + 1End SubPri

64、vate Sub Option2_Click(Index As Integer)    func = Index + 1End SubPublic Sub display() '判斷功能并顯示        '功能選擇    Select Case func        Case 1 '當(dāng)前值       

65、60;    value2 = value                    Case 2 '平均值            If numCount > Then        

66、60;       numCount = 1                valueSum = 0            End If            If va

67、lueFlag = 1 Then                valueSum = valueSum + value                value2 = valueSum / numCount        

68、;        numCount = numCount + 1                valueFlag = 0                Label6.Caption = Str(numCount - 1) 

69、9;Str()為數(shù)字轉(zhuǎn)換成字符串函數(shù)            End If        Case 3 '最大值            If value > value2 Then          

70、;      value2 = value            End If        Case 4 '最小值            If value < value2 Then     &

71、#160;          value2 = value            End If        Case Else    End Select    'Text1.Text = Str(valueSum)    Lab

72、el1.Caption = Format(value2, "0.000,000")    End SubPrivate Sub Timer1_Timer()'清緩沖區(qū)    ' Text1.Text = MSComm1.InBufferCount    If MSComm1.InBufferCount >= 80 Then        MSComm1.InBufferCount = 0

73、0;   End IfEnd Sub  程序匠人    2005-10-22 19:48:00     | |  |  Visual Basic串口通訊調(diào)試方法     現(xiàn)有電子秤一臺(tái),使用串口與計(jì)算機(jī)進(jìn)行通訊。編寫VB程序來訪問串口,達(dá)到讀取電子秤上顯示的數(shù)據(jù)。該電子秤為BE01型儀表,輸出為RS-232C標(biāo)準(zhǔn)接口,波特率為300-9600、偶校驗(yàn)、7個(gè)數(shù)據(jù)位、2個(gè)停止位。所有字符均發(fā)送11位ASCII碼,一個(gè)起始位。在VB中與串口通訊需要引入

74、控件MSComm串口通訊控件(在Microsoft Comm Control 6.0中)。具體程序如下:控件簡稱:MSC  Dim Out(12) As Byte 接收var中的值 Dim var As Variant 接收MSC.input中的數(shù)值 Dim nRece As Integer 計(jì)算MSC.inputbuffer的個(gè)數(shù) Dim i As Integer, j As Integer 隨即變量,計(jì)算循環(huán) * Private Sub Form_Load() ClearText With MSC .CommPort = 1 設(shè)置Com1為通信端口 .Settings = &qu

75、ot;9600,E,7,2" 設(shè)置通信端口參數(shù) 9600赫茲、偶校驗(yàn)、7個(gè)數(shù)據(jù)位、2個(gè)停止位.(這里需要進(jìn)一步說明的是:.Setting=”BBBB,P,D,S”。 含義是:B:Baud Rate(波特率);P:Parity(奇偶);D:Data Bit;S:Stop Bit) .InBufferSize = 40 設(shè)置緩沖區(qū)接收數(shù)據(jù)為40字節(jié) .InputLen = 1 設(shè)置Input一次從接收緩沖讀取字節(jié)數(shù)為1 .RThreshold = 1 設(shè)置接收一個(gè)字節(jié)就產(chǎn)生OnComm事件 End With End Sub * Private Sub ClearText() Text3.

76、Text = "" Text2.Text = "5" Text1.Text = "" End Sub Private Sub Command1_Click() 復(fù)位并打開串口ClearText nRece = 0 計(jì)數(shù)器清零 是不是應(yīng)該把前面的去掉???With MSC .InputMode = comInputModeBinary 設(shè)置數(shù)據(jù)接收模式為二進(jìn)制形式 .InBufferCount = 0 清除接收緩沖區(qū) If Not .PortOpen Then .PortOpen = True 打開通信端口 End If End With

77、 End Sub Private Sub MSC_OnComm() DelayTime 用來延續(xù)時(shí)間 ClearText With MSC Select Case .CommEvent 判斷通信事件 Case comEvReceive: 收到Rthreshold個(gè)字節(jié)產(chǎn)生的接收事件 SwichVar 1 是個(gè)子過程If Out(1) = 2 Then 判斷是否為數(shù)據(jù)的開始標(biāo)志 .RThreshold = 0 關(guān)閉OnComm事件接收 End If Do DoEvents Loop Until .InBufferCount >= 3 循環(huán)等待接收緩沖區(qū)>=3個(gè)字節(jié) nRece = n

78、Rece + 1 For i = 2 To 12 SwichVar i Text1.Text = Text1.Text & Chr(Out(i) Next Text1.Text = LTrim(Text1.Text) LTrim函數(shù)是將一個(gè)字符串中最前面的所有空格去掉Text2.Text = Text2.Text & CStr(nRece) CStr同Str.RThreshold = 1 打開MSComm事件接收 Case Else .PortOpen = False End Select End With End Sub * Private Sub DelayTime() D

79、im bDT As Boolean 邏輯型數(shù)據(jù)Dim sPrevious As Single, sLast As Single 單精度bDT = True sPrevious = Timer (Timer可以計(jì)算從子夜到現(xiàn)在所經(jīng)過的秒數(shù),在Microsoft Windows中,Timer函數(shù)可以返回一秒的小數(shù)部分) Do While bDT If Timer - sPrevious >= 0.3 Then bDT = False Loop bDT = True End Sub (通信傳輸速率為9600bps,則最快速度1.04ms發(fā)送一個(gè)字節(jié),儀表每秒發(fā)送50幀數(shù)據(jù),每幀數(shù)據(jù)有4個(gè)字節(jié),

80、即每秒發(fā)送200個(gè)字節(jié),平均5.0ms 發(fā)送一個(gè)字節(jié),連續(xù)讀取串口數(shù)據(jù)時(shí)要在程序中添加循環(huán)等待程序) Private Sub SwichVar(ByVal nNum As Integer) DelayTime var = Null var = MSC.Input Out(nNum) = var(0) End Sub (設(shè)置接收數(shù)據(jù)模式采用二進(jìn)制形式,即 InputMode=comInputModeBinary,但用Input屬性讀取數(shù)據(jù)時(shí),不能直接賦值給 Byte 類型變量,只能通過先賦值給一個(gè) Variant 類型變量,返回一個(gè)二進(jìn)制數(shù)據(jù)的數(shù)組,再轉(zhuǎn)換保存到Byte類型數(shù)變量中。) Priv

81、ate Sub Text1_Change() Text3.Text = CText(Text1.Text) - CText(Text2.Text) End Sub * Private Function CText(ByVal str As String) As Currency ByVal是什么?If str <> "" Then CText = CCur(Val(str) CCur是什么?Else CText = 0 End If End Function  (儀表每秒發(fā)送50幀數(shù)據(jù),微機(jī)收到一幀完整數(shù)據(jù)至少需要20 ms時(shí)間,然后再進(jìn)行數(shù)據(jù)處理。如

82、果微機(jī)在下一幀數(shù)據(jù)接收前即20ms內(nèi)能將數(shù)據(jù)計(jì)算處理完畢,則接收緩沖區(qū)內(nèi)只會(huì)保存有一幀數(shù)據(jù),不會(huì)存有兩幀以上數(shù)據(jù),接收緩沖區(qū)的大小不會(huì)影響實(shí)時(shí)監(jiān)測效果(接收緩沖區(qū)>4字節(jié)),這時(shí)完全可以實(shí)現(xiàn)實(shí)時(shí)監(jiān)測或?qū)崟r(shí)控制;如果微機(jī)在20ms內(nèi)不能將數(shù)據(jù)計(jì)算處理完畢,接收緩沖區(qū)設(shè)置得又很大,在數(shù)據(jù)計(jì)算處理完畢前,接收緩沖區(qū)內(nèi)就會(huì)保存有兩幀以上數(shù)據(jù),而且一次工作時(shí)間越長,緩沖區(qū)內(nèi)滯留數(shù)據(jù)幀就越多,數(shù)據(jù)采集和數(shù)據(jù)處理之間產(chǎn)生逐漸增大的額外時(shí)間差,當(dāng)接收緩沖區(qū)充滿后,時(shí)間差不再增大,固定在某一值,部分?jǐn)?shù)據(jù)因不能及時(shí)采集到接收緩沖區(qū)中,數(shù)據(jù)產(chǎn)生丟失現(xiàn)象,真實(shí)工作情況就會(huì)和微機(jī)處理結(jié)果產(chǎn)生較大的時(shí)間差,對(duì)實(shí)時(shí)監(jiān)

83、測和實(shí)時(shí)控制很不利,這種情況下接收緩沖區(qū)的大小就會(huì)影響實(shí)時(shí)監(jiān)測效果,所以接收緩沖區(qū)設(shè)置不能過大,以保證數(shù)據(jù)處理的實(shí)時(shí)性。) 小結(jié):本文所用的儀表為梅特勒公司出產(chǎn)的BE01型電子秤,其輸出的每個(gè)編碼均為標(biāo)準(zhǔn)的ASCII碼。其他的儀表存在發(fā)射的編碼中含有BCD壓縮碼,而且分為高低位,需要接收后對(duì)其進(jìn)行解碼換算,之后還要將高位和低位數(shù)字進(jìn)行相加,即可以將其BCD碼換算成實(shí)數(shù)。另還存在誤差的可能:判斷最大值,儀表在剛開始工作時(shí)有干擾,會(huì)傳導(dǎo)一些亂碼,位移傳感器有參數(shù)偏差,最大值一般都略大于50毫米,所以取51為極限最大值,取51為極限最小值。暫時(shí)先寫這些,當(dāng)然其他的情況可以依此類推  

84、60;程序匠人    2005-10-2 14:36:00     | |  |  一個(gè)簡單的VB串口發(fā)送程序(源碼)!'-發(fā)送按鈕Click事件子程序-Private Sub Fasong_Click()Dim JIHAO(0)    As Byte             機(jī)號(hào)Dim head_data(4) As Byte&

85、#160;          5 Byte控制字Dim end_data(0) As Byte            '1 Byte 結(jié)束字    JIHAO(0) = Val(Text3.Text)    head_data(0) = Val(Text4.Text)  

86、  head_data(2) = &HEE                 'TIMH    head_data(3) = &HEE                 '

87、TIML    head_data(4) = Val(Combo1.Text)     'INMOD    end_data(0) = &HFF    If Combo2.Text = "增加" Then head_data(1) = &H99    If Combo2.Text = "清空" Then head_data(

88、1) = &H33    If Combo2.Text = "刪除" Then head_data(1) = &H32    Ready = 0: ErrCount = 0    On Error GoTo ERRORCOM              打開錯(cuò)誤處理'-  &#

89、160;  If com1.Value Then MSComm1.CommPort = 1    'Use com1     If com2.Value Then MSComm1.CommPort = 2    'Use com2     MSComm1.Settings = FORM1.Combo3.Text + ",M,8,2"  

90、60;  '設(shè)定波特率和置校驗(yàn)和位為1     MSComm1.InputLen = 0                '     MSComm1.PortOpen = -1           

91、;    'Open the port     MSComm1.OutBufferCount = 0     MSComm1.Output = JIHAO              發(fā)送機(jī)號(hào)     MSComm1.PortOpen = False &

92、#160;          關(guān)閉串口     MSComm1.Settings = FORM1.Combo3.Text + ",S,8,2" '設(shè)定波特率和置校驗(yàn)和位為空     MSComm1.OutBufferCount = 0     MSComm1.PortOpen = True  

93、0;  MSComm1.Output = head_data     MSComm1.Output = Text2.Text     MSComm1.Output = end_data     MSComm1.PortOpen = False     Text1.Text = "發(fā)送成功!" + Chr(13) & Chr(10) + "發(fā)

94、送至" + Text3.Text + "屏體," + "信息編號(hào):" + Text4.Text + Chr(13) & Chr(10) + Chr(13) & Chr(10) + Text1.Text     GoTo comendERRORCOM:     Text1.Text = "ERROR!請(qǐng)重新選擇COM口!" + Chr(13) & Chr(10) + Chr(13) & Chr(1

95、0) + Text1.Textcomend:     On Error GoTo 0End Sub  程序匠人    2005-10-2 14:32:00     | |  |  貼一個(gè)非常好的串口程序!(from iccavr)(hanzhaowei)#include <iom128v.h>#include <macros.h>#include "uart.h"/* USART Buffer

96、 Defines */#define USART_RX_BUFFER_SIZE 16 /* 1,2,4,8,16,32,64,128 or 256 bytes */#define USART_RX_BUFFER_MASK ( USART_RX_BUFFER_SIZE - 1 )#define USART_TX_BUFFER_SIZE 16 /* 1,2,4,8,16,32,64,128 or 256 bytes */#define USART_TX_BUFFER_MASK ( USART_TX_BUFFER_SIZE - 1 )#if ( USART_RX_BUFFER_SIZE &

97、USART_RX_BUFFER_MASK )#error RX buffer size is not a power of 2#endif/* Static Variables */static unsigned char USART_RxBufUSART_RX_BUFFER_SIZE;static volatile unsigned char USART_RxHead;static volatile unsigned char USART_RxTail;static unsigned char USART_TxBufUSART_TX_BUFFER_SIZE;static volatile u

98、nsigned char USART_TxHead;static volatile unsigned char USART_TxTail;/* 串口初始化 */void InitUSART(INT8U  baudrate)INT8U x;UBRR0L = baudrate;UCSR0B = ( (1<<RXCIE0) | (1<<RXEN0) | (1<<TXEN0) );/*RX Complete Interrupt Enable, Receiver Enable and Transmitter Enable*/x = 0; /* fl

99、ush receive buffer */USART_RxTail = x;USART_RxHead = x;USART_TxTail = x;USART_TxHead = x;/* 接收中斷 */void USART_RX_interrupt( void )unsigned char data;unsigned char tmphead;data = UDR0; /* read the received data */tmphead = ( USART_RxHead + 1 ) & USART_RX_BUFFER_MASK;/* calculate buffer index */US

100、ART_RxHead = tmphead; /* store new index */if ( tmphead = USART_RxTail )return;/* ERROR! Receive buffer overflow, you can use flux cortorl */USART_RxBuftmphead = data; /* store received data in buffer */* 發(fā)送中斷 */void USART_TX_interrupt( void )unsigned char tmptail;if ( USART_TxHead != USART_TxTail )

101、/* check if all data is transmitted */tmptail = ( USART_TxTail + 1 ) & USART_TX_BUFFER_MASK;/* calculate buffer index */USART_TxTail = tmptail; /* store new index */UDR0 = USART_TxBuftmptail; /* start transmition */elseUCSR0B &= (1<<UDRIE0); /* disable UDRE interrupt */* 讀取數(shù)據(jù)函數(shù) */unsigned char ReceiveByte(

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論