欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 17882|回復: 5
打印 上一主題 下一主題
收起左側

RS-485單片機通訊模塊原理圖PCB工程及源碼等全套資料下載

[復制鏈接]
跳轉到指定樓層
樓主
Altium Designer畫的RS-485單片機通訊模塊的電路原理圖和PCB圖如下:(51hei附件中可下載工程文件)



【簡要說明】
一、尺寸:全長36mm寬22mm高18mm
二、主芯片:MAX485通訊芯片
三、工作電壓:直流5V
四、特點:
1、電路簡單實用,接線簡單。
2、一端與485模塊連接,另一端可直接和單片機連接。
3、可以單片機與單片機通訊。
4、可UART 與485設備通訊。
5、電路小巧,方便固定安裝。
6、通信距離最大1200米。
7、工作溫度-20°~50°。
8、RS-485的數據最高傳輸速率為10Mbps
9、RS-485最大的通信距離約為1200m,最大傳輸速率為10Mb/S,傳輸速率與傳輸距離成反比,在100Kb/S的傳輸速率下,才可以達到最大的通信距離,如果需傳輸更長的距離,需要加485中繼器。RS-485總線一般最大支持32個節點,如果使用特制的485芯片,可以達到128個或者256個節點,最大的可以支持到400個節點。

測試程序 - 按復位按鍵上數據單片機源程序如下:
  1. /********************************************************************
  2.                             匯誠科技
  3. 實現功能:RS-485單片機通訊模塊_測試程序自動返回
  4. 使用芯片:AT89S52
  5. 晶振:11.0592MHZ
  6. 波特率:9600
  7. 編譯環境:Keil
  8. 作者:zhangxinchun
  9. 【聲明】此程序僅用于學習與參考,引用請注明版權和作者信息!     
  10. /*********************************************************************/
  11. #include "reg51.h"
  12. #include "intrins.h"

  13. typedef unsigned char BYTE;
  14. typedef unsigned int WORD;

  15. #define FOSC 11059200L      //System frequency
  16. #define BAUD 9600           //UART baudrate

  17. /*Define UART parity mode*/
  18. #define NONE_PARITY     0   //None parity
  19. #define ODD_PARITY      1   //Odd parity
  20. #define EVEN_PARITY     2   //Even parity
  21. #define MARK_PARITY     3   //Mark parity
  22. #define SPACE_PARITY    4   //Space parity

  23. #define PARITYBIT EVEN_PARITY   //Testing even parity

  24. sbit bit9 = P2^2;           //P2.2 show UART data bit9
  25. bit busy;

  26. void SendData(BYTE dat);
  27. void SendString(char *s);

  28. void main()
  29. {
  30. #if (PARITYBIT == NONE_PARITY)
  31.     SCON = 0x50;            //8-bit variable UART
  32. #elif (PARITYBIT == ODD_PARITY) || (PARITYBIT == EVEN_PARITY) || (PARITYBIT == MARK_PARITY)
  33.     SCON = 0xda;            //9-bit variable UART, parity bit initial to 1
  34. #elif (PARITYBIT == SPACE_PARITY)
  35.     SCON = 0xd2;            //9-bit variable UART, parity bit initial to 0
  36. #endif

  37.     TMOD = 0x20;            //Set Timer1 as 8-bit auto reload mode
  38.     TH1 = TL1 = -(FOSC/12/32/BAUD); //Set auto-reload vaule
  39.     TR1 = 1;                //Timer1 start run
  40.     ES = 1;                 //Enable UART interrupt
  41.     EA = 1;                 //Open master interrupt switch

  42.     SendString("AT89S52 11.0592MHZ 9600 ");
  43.     while(1);
  44. }

  45. /*----------------------------
  46. UART interrupt service routine
  47. ----------------------------*/
  48. void Uart_Isr() interrupt 4 using 1
  49. {
  50.     if (RI)
  51.     {
  52.         RI = 0;             //Clear receive interrupt flag
  53.         P0 = SBUF;          //P0 show UART data
  54.         bit9 = RB8;         //P2.2 show parity bit
  55.     }
  56.     if (TI)
  57.     {
  58.         TI = 0;             //Clear transmit interrupt flag
  59.         busy = 0;           //Clear transmit busy flag
  60.     }
  61. }

  62. /*----------------------------
  63. Send a byte data to UART
  64. Input: dat (data to be sent)
  65. Output:None
  66. ----------------------------*/
  67. void SendData(BYTE dat)
  68. {
  69.     while (busy);           //Wait for the completion of the previous data is sent
  70.     ACC = dat;              //Calculate the even parity bit P (PSW.0)
  71.     if (P)                  //Set the parity bit according to P
  72.     {
  73. #if (PARITYBIT == ODD_PARITY)
  74.         TB8 = 0;            //Set parity bit to 0
  75. #elif (PARITYBIT == EVEN_PARITY)
  76.         TB8 = 1;            //Set parity bit to 1
  77. #endif
  78.     }
  79.     else
  80.     {
  81. #if (PARITYBIT == ODD_PARITY)
  82.         TB8 = 1;            //Set parity bit to 1
  83. #elif (PARITYBIT == EVEN_PARITY)
  84.         TB8 = 0;            //Set parity bit to 0
  85. #endif
  86.     }
  87.     busy = 1;
  88.     SBUF = ACC;             //Send data to UART buffer
  89. }

  90. /*----------------------------
  91. Send a string to UART
  92. Input: s (address of string)
  93. Output:None
  94. ----------------------------*/
  95. void SendString(char *s)
  96. {
  97.     while (*s)              //Check the end of the string
  98.     {
  99.         SendData(*s++);     //Send current char and increment string ptr
  100.     }
  101. }


  102. /********************************************************************
  103.                               結束
  104. *********************************************************************/
復制代碼

所有資料51hei提供下載:

0.png (12.17 KB, 下載次數: 63)

0.png

0.png (9.11 KB, 下載次數: 55)

0.png

RS-485單片機通訊模塊.rar

7.66 MB, 下載次數: 144, 下載積分: 黑幣 -5

RS-485單片機通訊模塊DXP資料.rar

60.25 KB, 下載次數: 117, 下載積分: 黑幣 -5

RS-485單片機通訊模塊產品使用手冊.doc

8.21 MB, 下載次數: 62, 下載積分: 黑幣 -5

RS-485單片機通訊模塊產品使用手冊.pdf

804.6 KB, 下載次數: 71, 下載積分: 黑幣 -5

RS-485單片機通訊模塊原理圖.doc

13.5 KB, 下載次數: 74, 下載積分: 黑幣 -5

測試程序 - 按復位按鍵上數據.rar

24.29 KB, 下載次數: 65, 下載積分: 黑幣 -5

測試程序.rar

18.14 KB, 下載次數: 83, 下載積分: 黑幣 -5

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏6 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:557742 發表于 2019-6-16 17:42 | 只看該作者
感謝lz
回復

使用道具 舉報

板凳
ID:420321 發表于 2019-6-26 16:43 | 只看該作者
樓主你的R1是多大啊?
回復

使用道具 舉報

地板
ID:420321 發表于 2019-6-26 16:44 | 只看該作者
是120歐還是120k?
回復

使用道具 舉報

5#
ID:140181 發表于 2021-6-17 14:54 | 只看該作者

歐 120 240
回復

使用道具 舉報

6#
ID:140181 發表于 2021-6-17 14:55 | 只看該作者

歐,120或240
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表