PIC 16F877单片机的5个端口(RA~RE)各具什么特色?分别适用于什么场合?

PIC16F877\u5355\u7247\u673a\u76845\u4e2a\u7aef\u53e3RA~RE\u5404\u5177\u4ec0\u4e48\u7279\u8272?\u5206\u522b\u9002\u7528\u4e8e\u4ec0\u4e48\u573a\u5408?

1. PORTA \u603b\u5171\u67096\u4e2a\u4f4d(RA0~RA5)\uff0cPORTA\u7aef\u53e3\u6a21\u5757\u67093\u4e2a\u7279\u6b8a\u7684\u5bc4\u5b58\u5668\uff1a\u7aef\u53e3\u6570\u636e\u5bc4\u5b58\u5668PORTA\uff0c\u7aef\u53e3\u65b9\u5411\u63a7\u5236\u5bc4\u5b58\u5668TRISA\uff0cA/D\u8f6c\u6362\u63a7\u5236\u5bc4\u5b58\u5668ADCIN1\uff1bPORTA\u7aef\u53e3\u5404\u5f15\u811a\u7684\u6240\u590d\u5408\u7684\u529f\u80fd\u76f8\u540c\uff0c\u5404\u5f15\u811a\u7684\u5185\u90e8\u7ed3\u6784\u4e5f\u4e0d\u4e00\u81f4\u3002\u5bf9\u4e09\u4e2a\u5bc4\u5b58\u5668\u7684\u8bbe\u7f6e\u53ef\u63a7\u5236PORTA\u7aef\u53e3\u4f5c\u4e3a\u6570\u5b57I/O\u7aef\u53e3\u7684\u5e94\u7528\uff0c\u800c\u7cfb\u7edf\u91cd\u7f6e\u540e\uff0cPORTA\u81ea\u52a8\u6210\u4e3a\u6a21\u62df\u8f93\u5165\u72b6\u6001\uff0c\u53ef\u8bfb\u53d6\u6a21\u62df\u8f93\u5165\u8baf\u53f7\uff1bPORTB \u662f8\u4f4d\u5bbd\u5ea6\u7684\u6570\u5b57I/O\u7aef\u53e3\uff08RB0~RB7\uff09\uff0c\u4e00\u822c\u53ea\u6709RB6\u548cRB7\u4e24\u4e2a\u5f15\u811a\u5b58\u5728\u590d\u7528\u529f\u80fd\uff0c\u5b83\u4eec\u5728\u82af\u7247\u7f16\u7a0b\u70e7\u5199\u548c\u5728\u7ebf\u8c03\u8bd5\u65f6\uff0cRB6\u4f5c\u4e3a\u7f16\u7a0b\u4e32\u884c\u65f6\u949f\u5f15\u811aPGC\uff0cRB7\u4f5c\u4e3a\u7f16\u7a0b\u4e32\u884c\u6570\u636e\u5f15\u811aPGM\uff0c\u8fd9\u662f\u4e00\u79cd\u7279\u6b8a\u6a21\u5f0f\u7684\u529f\u80fd\u590d\u7528\u7c7b\u578b\uff0c\u5b83\u4e0d\u53ef\u80fd\u51fa\u73b0\u5728\u82af\u7247\u6b63\u5e38\u5de5\u4f5c\u65f6\u3002PORTB\u6a21\u5757\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67094\u4e2a\uff0cPORTB\u7aef\u53e3\u4f5c\u4e3a\u6570\u5b57I/0\u7aef\u53e3\u7684\u5e94\u7528\u53ef\u4ee5\u64b0\u5199\u7a0b\u5e8f\u89c4\u5212\u8f93\u5165\u8f93\u51fa\u65b9\u5411\u3001\u72b6\u6001\uff1bPORTC \u603b\u5171\u67098\u4e2a\u4f4d(RC0~RC7)\uff0c\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67092\u4e2a\uff0c\u5355\u7247\u673a\u4e0a\u7535\u4e4b\u540e\uff0c\u8f93\u51fa\u6570\u636e\u5bc4\u5b58\u5668PORTC\u7684\u503c\u968f\u673a\u503c\uff0c\u65b9\u5411\u5bc4\u5b58\u5668TRISC\u7684\u503c\u5168\u4e3a1\uff0c\u56e0\u6b64\uff0c\u8d77\u59cb\u72b6\u6001\u4e0b\u5404\u4e2a\u5f15\u811a\u5747\u5904\u4e8e\u8f93\u5165\u65b9\u5f0f\uff0c\u5bf9\u5916\u5448\u73b0\u9ad8\u963b\u72b6\u6001\uff0c\u901a\u8fc7\u5b9a\u4e49TRISC\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u53ef\u4ee5\u5206\u522b\u6307\u5b9a\u5f15\u811a\u8bbe\u7f6e\u4e3a\u8f93\u5165\u8fd8\u662f\u8f93\u51fa\u65b9\u5f0f\u3002\u9664\u4e86\u53ef\u4f5c\u4e3a\u6570\u4f4dI/O\u5916\uff0c\u8fd8\u548c\u4e00\u4e9b\u7279\u6b8a\u529f\u80fd\u7684\u5468\u8fb9\u7535\u8def\u5171\u4eab\u63a5\u811a\uff1b PORTC \u662f8\u4f4d\u5bbd\u5ea6\u7684\u53cc\u5411\u6570\u5b57I/O\u7aef\u53e3\uff08RC0~RC7\uff09\uff0c\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67093\u4e2a\uff0c\u5b83\u5728\u57fa\u672c\u8f93\u5165/\u8f93\u51fa\u529f\u80fd\u7684\u57fa\u7840\u4e0a\uff0c\u589e\u52a0\u5e76\u884c\u4ece\u52a8\u7aef\u53e3\u529f\u80fd\uff1b\u53e6\u5916\u6bcf\u4e2a\u5f15\u811a\u4f5cI/O\u5f15\u811a\u4f7f\u7528\u65f6\uff0c\u8f93\u5165\u4fe1\u53f7\u90fd\u8981\u7ecf\u8fc7\u5176\u5185\u90e8\u7684\u65bd\u5bc6\u7279\u89e6\u53d1\u8f93\u5165\u7f13\u51b2\u5668\uff0c\u5bf9\u4e8e\u8f93\u5165\u4fe1\u53f7\u6ce2\u5f62\u53ef\u4ee5\u8d77\u6574\u5f62\u4f5c\u7528\uff0c\u800c\u5de5\u4f5c\u4e8e\u5e76\u884c\u4ece\u52a8\u7aef\u53e3\u65b9\u5f0f\u65f6\u5219\u662f\u7ecf\u8fc7TTL\u7f13\u51b2\u5668\u8f93\u5165\u3002PORTC\u53ef\u4f5c\u4e00\u822c\u6570\u5b57I/O\uff0c\u5e76\u4e0ePSP(Parallel Slave Port)\u5e76\u5217\u4f20\u8f93\u63a5\u53e3\u5171\u4eab\u3002\u5f53\u6574\u4f53\u7cfb\u7edf\u9700\u8981\u591a\u5355\u7247\u673a\u65f6\uff0c\u5f7c\u6b64\u53ef\u4ee5\u7ecf\u7531\u5e76\u5217\u4f20\u8f93\u63a5\u53e3\u6765\u5feb\u901f\u4f20\u8f93\u8d44\u6599\uff1b
PORTE \u53ea\u67093\u6761\u5f15\u811a\u7684\u53cc\u5411I/O\u7aef\u53e3\uff08RE0~RE2\uff09\uff0c\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67093\u4e2a\uff0c\u5b83\u5728\u57fa\u672c\u8f93\u5165/\u8f93\u51fa\u529f\u80fd\u7684\u57fa\u7840\u4e0a\uff0c\u589e\u52a0\u5e76\u884c\u4ece\u52a8\u7aef\u53e3\uff0c\u6a21\u62df\u91cf\u8f93\u5165\u529f\u80fd\u3002\u5355\u7247\u673a\u4e0a\u7535\u4e4b\u540e\uff0c\u8f93\u51fa\u6570\u636e\u5bc4\u5b58\u5668PORTE\u7684\u503c\u968f\u673a\u503c\uff0c\u65b9\u5411\u5bc4\u5b58\u5668TRISC\u7684\u503c\u5168\u4e3a1\uff0c\u56e0\u6b64\uff0c\u8d77\u59cb\u72b6\u6001\u4e0b\u5404\u4e2a\u5f15\u811a\u5747\u5904\u4e8e\u8f93\u5165\u65b9\u5f0f\uff0c\u5bf9\u5916\u5448\u73b0\u9ad8\u963b\u72b6\u6001\uff0c\u901a\u8fc7\u5b9a\u4e49TRISE\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u53ef\u5206\u522b\u6307\u5b9a\u5f15\u811a\u8bbe\u7f6e\u4e3a\u8f93\u5165\u8fd8\u662f\u8f93\u51fa\u65b9\u5f0f\u3002 2\uff0e\u7531RA4\u7684\u5185\u90e8\u7ed3\u6784\u53ef\u77e5\uff0cRA4\u548cPORTA\u7aef\u53e3\u7684\u5176\u5b83\u7aef\u53e3\u6709\u5f88\u5927\u7684\u4e0d\u540c\uff0c\u5b83\u6ca1\u6709\u88ab\u590d\u7528\u6210\u6a21\u62df\u4fe1\u53f7\u8f93\u5165\u3002\u4e00\u822c\u5176\u4f5c\u7528\u6709\u4e2a\uff1a\u666e\u901a\u6570\u5b57I/O\u7aef\u53e3\u548c\u5b9a\u65f6TMR0\u7684\u5916\u90e8\u6570\u5b57\u8109\u51b2\u8f93\u5165\u7aef\u53e3\uff08TOCKI\uff09\u3002RA4\u7279\u5f81\u5982\u4e0b\uff1a \uff081\uff09\u8f93\u5165\u65f6\u4e0e\u5176\u5b83\u7aef\u53e3\u4e00\u6837\uff0c\u90fd\u662f\u5448\u73b0\u9ad8\u963b\u6001\u3002 \uff082\uff09\u8f93\u51fa\u4f4e\u7535\u5e73\u65f6\uff0c\u4e0e\u5176\u5b83\u7aef\u53e3\u4e00\u6837\uff0c\u5438\u5165\u7aef\u53e3\u5916\u90e8\u7535\u8def\u7684\u7535\u6d41\uff0c\u5f15\u811a\u4e0a\u7684\u7535\u538b\u63a5\u8fd10V\u3002 \uff083\uff09\u8f93\u51fa\u9ad8\u7535\u5e73\u65f6\uff0c\u4e0e\u5176\u5b83\u7aef\u53e3\u6709\u5f88\u5927\u4e0d\u540c\uff0cRA4\u7aef\u53e3\u53ea\u6709\u4e00\u4e2aN\u6c9f\u9053\u573a\u6548\u5e94\u9a71\u52a8\u7ba1\uff0c\u6ca1\u6709P\u6c9f\u9053\u573a\u6548\u5e94\u9a71\u52a8\u7ba1\uff0c\u6240\u4ee5RA4\u5f15\u811a\u5904\u4e8e\u6f0f\u6781\u5f00\u8def\u72b6\u6001\uff0c\u8f93\u51fa\u9ad8\u7535\u5e73\u65f6\u4e3a\u60ac\u7a7a\u72b6\u6001\u3002\u6539\u8fdb\u65b9\u6cd5\uff1a\u5c3d\u91cf\u8bbe\u8ba1\u6210\u4f4e\u7535\u5e73\u6709\u6548\uff0c\u82e5\u9700\u8981\u9ad8\u7535\u5e73\u6765\u9a71\u52a8\u5916\u56f4\u7535\u8def\u65f6\uff0c\u5fc5\u987b\u5728RA4\u5f15\u811a\u4e0a\u5916\u52a0\u4e0a\u62c9\u7535\u963b\u3002\u4e0a\u62c9\u7535\u963b\u7684\u53d6\u503c\u8303\u56f4\u4e3a1K\u03a9~10K\u03a9\u5de6\u53f3\u30023\uff0e\u662f\uff0c\u9009\u9879\u5bc4\u5b58\u5668POTION\u4e5f\u662f\u4e00\u4e2a\u53ef\u8bfb/\u5199\u7684\u5bc4\u5b58\u5668\uff0c\u5305\u542bTMR0\uff0c\u5206\u9891\u5668\u548c\u7aef\u53e3RB\u6709\u5173\u7684\u63a7\u5236\u4f4d\u3002\u7aef\u53e3RB0\u4e0e\u5916\u90e8\u4e2d\u65adINT\u5171\u540c\u4e00\u5f15\u811a\uff0c\u4e0e\u8be5\u5f15\u811a\u6709\u5173\u76842\u4e2a\u63a7\u5236\u4f4d\u542b\u4e49\u5982\u4e0b\uff1a 1=RB \u7aef\u53e3\u5f31\u4e0a\u62c9\u7535\u8def\u7981\u6b62 0=RB \u7aef\u53e3\u5f31\u4e0a\u62c9\u7535\u8def\u4f7f\u80fd \u6240\u4ee5\u8be5\u7aef\u53e3\u5185\u90e8\u6bcf\u6761\u5f15\u811a\u7684\u5f31\u4e0a\u62c9\u7535\u8def\u662f\u4e0d\u53ef\u5355\u72ec\u7f16

1. PORTA \u603b\u5171\u67096\u4e2a\u4f4d(RA0~RA5)\uff0cPORTA\u7aef\u53e3\u6a21\u5757\u67093\u4e2a\u7279\u6b8a\u7684\u5bc4\u5b58\u5668\uff1a\u7aef\u53e3\u6570\u636e\u5bc4\u5b58\u5668PORTA\uff0c\u7aef\u53e3\u65b9\u5411\u63a7\u5236\u5bc4\u5b58\u5668TRISA\uff0cA/D\u8f6c\u6362\u63a7\u5236\u5bc4\u5b58\u5668ADCIN1\uff1bPORTA\u7aef\u53e3\u5404\u5f15\u811a\u7684\u6240\u590d\u5408\u7684\u529f\u80fd\u76f8\u540c\uff0c\u5404\u5f15\u811a\u7684\u5185\u90e8\u7ed3\u6784\u4e5f\u4e0d\u4e00\u81f4\u3002\u5bf9\u4e09\u4e2a\u5bc4\u5b58\u5668\u7684\u8bbe\u7f6e\u53ef\u63a7\u5236PORTA\u7aef\u53e3\u4f5c\u4e3a\u6570\u5b57I/O\u7aef\u53e3\u7684\u5e94\u7528\uff0c\u800c\u7cfb\u7edf\u91cd\u7f6e\u540e\uff0cPORTA\u81ea\u52a8\u6210\u4e3a\u6a21\u62df\u8f93\u5165\u72b6\u6001\uff0c\u53ef\u8bfb\u53d6\u6a21\u62df\u8f93\u5165\u8baf\u53f7\uff1b

PORTB \u662f8\u4f4d\u5bbd\u5ea6\u7684\u6570\u5b57I/O\u7aef\u53e3\uff08RB0~RB7\uff09\uff0c\u4e00\u822c\u53ea\u6709RB6\u548cRB7\u4e24\u4e2a\u5f15\u811a\u5b58\u5728\u590d\u7528\u529f\u80fd\uff0c\u5b83\u4eec\u5728\u82af\u7247\u7f16\u7a0b\u70e7\u5199\u548c\u5728\u7ebf\u8c03\u8bd5\u65f6\uff0cRB6\u4f5c\u4e3a\u7f16\u7a0b\u4e32\u884c\u65f6\u949f\u5f15\u811aPGC\uff0cRB7\u4f5c\u4e3a\u7f16\u7a0b\u4e32\u884c\u6570\u636e\u5f15\u811aPGM\uff0c\u8fd9\u662f\u4e00\u79cd\u7279\u6b8a\u6a21\u5f0f\u7684\u529f\u80fd\u590d\u7528\u7c7b\u578b\uff0c\u5b83\u4e0d\u53ef\u80fd\u51fa\u73b0\u5728\u82af\u7247\u6b63\u5e38\u5de5\u4f5c\u65f6\u3002PORTB\u6a21\u5757\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67094\u4e2a\uff0cPORTB\u7aef\u53e3\u4f5c\u4e3a\u6570\u5b57I/0\u7aef\u53e3\u7684\u5e94\u7528\u53ef\u4ee5\u64b0\u5199\u7a0b\u5e8f\u89c4\u5212\u8f93\u5165\u8f93\u51fa\u65b9\u5411\u3001\u72b6\u6001\uff1b

PORTC \u603b\u5171\u67098\u4e2a\u4f4d(RC0~RC7)\uff0c\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67092\u4e2a\uff0c\u5355\u7247\u673a\u4e0a\u7535\u4e4b\u540e\uff0c\u8f93\u51fa\u6570\u636e\u5bc4\u5b58\u5668PORTC\u7684\u503c\u968f\u673a\u503c\uff0c\u65b9\u5411\u5bc4\u5b58\u5668TRISC\u7684\u503c\u5168\u4e3a1\uff0c\u56e0\u6b64\uff0c\u8d77\u59cb\u72b6\u6001\u4e0b\u5404\u4e2a\u5f15\u811a\u5747\u5904\u4e8e\u8f93\u5165\u65b9\u5f0f\uff0c\u5bf9\u5916\u5448\u73b0\u9ad8\u963b\u72b6\u6001\uff0c\u901a\u8fc7\u5b9a\u4e49TRISC\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u53ef\u4ee5\u5206\u522b\u6307\u5b9a\u5f15\u811a\u8bbe\u7f6e\u4e3a\u8f93\u5165\u8fd8\u662f\u8f93\u51fa\u65b9\u5f0f\u3002\u9664\u4e86\u53ef\u4f5c\u4e3a\u6570\u4f4dI/O\u5916\uff0c\u8fd8\u548c\u4e00\u4e9b\u7279\u6b8a\u529f\u80fd\u7684\u5468\u8fb9\u7535\u8def\u5171\u4eab\u63a5\u811a\uff1b

PORTC \u662f8\u4f4d\u5bbd\u5ea6\u7684\u53cc\u5411\u6570\u5b57I/O\u7aef\u53e3\uff08RC0~RC7\uff09\uff0c\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67093\u4e2a\uff0c\u5b83\u5728\u57fa\u672c\u8f93\u5165/\u8f93\u51fa\u529f\u80fd\u7684\u57fa\u7840\u4e0a\uff0c\u589e\u52a0\u5e76\u884c\u4ece\u52a8\u7aef\u53e3\u529f\u80fd\uff1b\u53e6\u5916\u6bcf\u4e2a\u5f15\u811a\u4f5cI/O\u5f15\u811a\u4f7f\u7528\u65f6\uff0c\u8f93\u5165\u4fe1\u53f7\u90fd\u8981\u7ecf\u8fc7\u5176\u5185\u90e8\u7684\u65bd\u5bc6\u7279\u89e6\u53d1\u8f93\u5165\u7f13\u51b2\u5668\uff0c\u5bf9\u4e8e\u8f93\u5165\u4fe1\u53f7\u6ce2\u5f62\u53ef\u4ee5\u8d77\u6574\u5f62\u4f5c\u7528\uff0c\u800c\u5de5\u4f5c\u4e8e\u5e76\u884c\u4ece\u52a8\u7aef\u53e3\u65b9\u5f0f\u65f6\u5219\u662f\u7ecf\u8fc7TTL\u7f13\u51b2\u5668\u8f93\u5165\u3002PORTC\u53ef\u4f5c\u4e00\u822c\u6570\u5b57I/O\uff0c\u5e76\u4e0ePSP(Parallel Slave Port)\u5e76\u5217\u4f20\u8f93\u63a5\u53e3\u5171\u4eab\u3002\u5f53\u6574\u4f53\u7cfb\u7edf\u9700\u8981\u591a\u5355\u7247\u673a\u65f6\uff0c\u5f7c\u6b64\u53ef\u4ee5\u7ecf\u7531\u5e76\u5217\u4f20\u8f93\u63a5\u53e3\u6765\u5feb\u901f\u4f20\u8f93\u8d44\u6599\uff1b
PORTE \u53ea\u67093\u6761\u5f15\u811a\u7684\u53cc\u5411I/O\u7aef\u53e3\uff08RE0~RE2\uff09\uff0c\u6709\u5173\u7684\u7279\u6b8a\u5bc4\u5b58\u5668\u67093\u4e2a\uff0c\u5b83\u5728\u57fa\u672c\u8f93\u5165/\u8f93\u51fa\u529f\u80fd\u7684\u57fa\u7840\u4e0a\uff0c\u589e\u52a0\u5e76\u884c\u4ece\u52a8\u7aef\u53e3\uff0c\u6a21\u62df\u91cf\u8f93\u5165\u529f\u80fd\u3002\u5355\u7247\u673a\u4e0a\u7535\u4e4b\u540e\uff0c\u8f93\u51fa\u6570\u636e\u5bc4\u5b58\u5668PORTE\u7684\u503c\u968f\u673a\u503c\uff0c\u65b9\u5411\u5bc4\u5b58\u5668TRISC\u7684\u503c\u5168\u4e3a1\uff0c\u56e0\u6b64\uff0c\u8d77\u59cb\u72b6\u6001\u4e0b\u5404\u4e2a\u5f15\u811a\u5747\u5904\u4e8e\u8f93\u5165\u65b9\u5f0f\uff0c\u5bf9\u5916\u5448\u73b0\u9ad8\u963b\u72b6\u6001\uff0c\u901a\u8fc7\u5b9a\u4e49TRISE\u5bc4\u5b58\u5668\u7684\u503c\uff0c\u53ef\u5206\u522b\u6307\u5b9a\u5f15\u811a\u8bbe\u7f6e\u4e3a\u8f93\u5165\u8fd8\u662f\u8f93\u51fa\u65b9\u5f0f\u3002



2\uff0e\u7531RA4\u7684\u5185\u90e8\u7ed3\u6784\u53ef\u77e5\uff0cRA4\u548cPORTA\u7aef\u53e3\u7684\u5176\u5b83\u7aef\u53e3\u6709\u5f88\u5927\u7684\u4e0d\u540c\uff0c\u5b83\u6ca1\u6709\u88ab\u590d\u7528\u6210\u6a21\u62df\u4fe1\u53f7\u8f93\u5165\u3002\u4e00\u822c\u5176\u4f5c\u7528\u6709\u4e2a\uff1a\u666e\u901a\u6570\u5b57I/O\u7aef\u53e3\u548c\u5b9a\u65f6TMR0\u7684\u5916\u90e8\u6570\u5b57\u8109\u51b2\u8f93\u5165\u7aef\u53e3\uff08TOCKI\uff09\u3002RA4\u7279\u5f81\u5982\u4e0b\uff1a

\uff081\uff09\u8f93\u5165\u65f6\u4e0e\u5176\u5b83\u7aef\u53e3\u4e00\u6837\uff0c\u90fd\u662f\u5448\u73b0\u9ad8\u963b\u6001\u3002

\uff082\uff09\u8f93\u51fa\u4f4e\u7535\u5e73\u65f6\uff0c\u4e0e\u5176\u5b83\u7aef\u53e3\u4e00\u6837\uff0c\u5438\u5165\u7aef\u53e3\u5916\u90e8\u7535\u8def\u7684\u7535\u6d41\uff0c\u5f15\u811a\u4e0a\u7684\u7535\u538b\u63a5\u8fd10V\u3002

\uff083\uff09\u8f93\u51fa\u9ad8\u7535\u5e73\u65f6\uff0c\u4e0e\u5176\u5b83\u7aef\u53e3\u6709\u5f88\u5927\u4e0d\u540c\uff0cRA4\u7aef\u53e3\u53ea\u6709\u4e00\u4e2aN\u6c9f\u9053\u573a\u6548\u5e94\u9a71\u52a8\u7ba1\uff0c\u6ca1\u6709P\u6c9f\u9053\u573a\u6548\u5e94\u9a71\u52a8\u7ba1\uff0c\u6240\u4ee5RA4\u5f15\u811a\u5904\u4e8e\u6f0f\u6781\u5f00\u8def\u72b6\u6001\uff0c\u8f93\u51fa\u9ad8\u7535\u5e73\u65f6\u4e3a\u60ac\u7a7a\u72b6\u6001\u3002\u6539\u8fdb\u65b9\u6cd5\uff1a\u5c3d\u91cf\u8bbe\u8ba1\u6210\u4f4e\u7535\u5e73\u6709\u6548\uff0c\u82e5\u9700\u8981\u9ad8\u7535\u5e73\u6765\u9a71\u52a8\u5916\u56f4\u7535\u8def\u65f6\uff0c\u5fc5\u987b\u5728RA4\u5f15\u811a\u4e0a\u5916\u52a0\u4e0a\u62c9\u7535\u963b\u3002\u4e0a\u62c9\u7535\u963b\u7684\u53d6\u503c\u8303\u56f4\u4e3a1K\u03a9~10K\u03a9\u5de6\u53f3\u3002

3\uff0e\u662f\uff0c\u9009\u9879\u5bc4\u5b58\u5668POTION\u4e5f\u662f\u4e00\u4e2a\u53ef\u8bfb/\u5199\u7684\u5bc4\u5b58\u5668\uff0c\u5305\u542bTMR0\uff0c\u5206\u9891\u5668\u548c\u7aef\u53e3RB\u6709\u5173\u7684\u63a7\u5236\u4f4d\u3002\u7aef\u53e3RB0\u4e0e\u5916\u90e8\u4e2d\u65adINT\u5171\u540c\u4e00\u5f15\u811a\uff0c\u4e0e\u8be5\u5f15\u811a\u6709\u5173\u76842\u4e2a\u63a7\u5236\u4f4d\u542b\u4e49\u5982\u4e0b\uff1a

1=RB \u7aef\u53e3\u5f31\u4e0a\u62c9\u7535\u8def\u7981\u6b62

0=RB \u7aef\u53e3\u5f31\u4e0a\u62c9\u7535\u8def\u4f7f\u80fd

\u6240\u4ee5\u8be5\u7aef\u53e3\u5185\u90e8\u6bcf\u6761\u5f15\u811a\u7684\u5f31\u4e0a\u62c9\u7535\u8def\u662f\u4e0d\u53ef\u5355\u72ec\u7f16

这些口主要差别是,A口有6个引脚,RA0-RA5除了RA4为漏极开路外,它只能是数字口,其他5个引脚都是可以作为模拟转换的输入口,还有RE口,它只有3个引脚,与RA口一样,这三个引脚也是可以作为模拟转换的输入口,这样一共有8个引脚可以作为模拟输入的引脚。
RB口有8个,RB0-RB7,RB0可作为INT中断,高4位RB4-RB7有电平变换中断功能。RB口还有内部弱上拉的功能。
RC口有8个,RC0-RC7,通信接口大都在RC口。
RD口有8个,RD0-RD7.
以上的所有引脚,除了我说的功能外,都可以作为普通的IO引脚。

PIC大部份端口都是多功能复用口,具体功能请查数据手册,(官网上有,还有中文的)
要使用其中某一功能时,需要对其控制寄存器进行设定,数据手册上也有很详细的说明.

扩展阅读:韩国macbookpro ... p3色域很多笔记本没有 ... 国产plc ... 16寸 macbook pro ... iphone 14 ... imac macbook ... phenomenex色谱柱 ... pic单片机16f877引脚 ... windows11支持p3色域吗 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网