{"id":6827,"date":"2024-07-27T08:01:01","date_gmt":"2024-07-27T00:01:01","guid":{"rendered":""},"modified":"2024-07-27T08:01:01","modified_gmt":"2024-07-27T00:01:01","slug":"pic\u5355\u7247\u673a\u5bc4\u5b58\u5668\u5b9a\u4e49_\u5355\u7247\u673a\u5bc4\u5b58\u5668\u6709\u54ea\u4e9b","status":"publish","type":"post","link":"https:\/\/mushiming.com\/6827.html","title":{"rendered":"pic\u5355\u7247\u673a\u5bc4\u5b58\u5668\u5b9a\u4e49_\u5355\u7247\u673a\u5bc4\u5b58\u5668\u6709\u54ea\u4e9b"},"content":{"rendered":"
\u914d\u7f6e\u5b57\uff08<\/strong>__CONFIG<\/strong>\uff09\uff1a<\/strong><\/p>\n 1) \u82af\u7247\u7684\u632f\u8361\u6a21\u5f0f\u9009\u62e9\u3002<\/p>\n 2) \u7247\u5185\u770b\u95e8\u72d7\u7684\u542f\u52a8\u3002<\/p>\n 3) \u4e0a\u7535\u590d\u4f4d\u5ef6\u65f6\u5b9a\u65f6\u5668PWRT\u7684\u542f\u7528\u3002<\/p>\n 4) \u4f4e\u7535\u538b\u68c0\u6d4b\u590d\u4f4dBOR\u6a21\u5757\u7684\u542f\u7528\u3002<\/p>\n 5) \u4ee3\u7801\u4fdd\u62a4\u3002<\/p>\n __CONFIG_CP_OFF &_WDT_OFF &_BODEN_OFF &_PWRTE_ON &_XT_OSC &_WRT_OFF &_LVP_OFF &_CPD_OFF ;<\/p>\n <\/p>\n _CP_OFF \u4ee3\u7801\u4fdd\u62a4\u5173\u95ed<\/p>\n _WDT_OFF \u770b\u95e8\u72d7\u5173\u95ed<\/p>\n _BODEN_OFF <\/p>\n _PWRTE_ON \u4e0a\u7535\u5ef6\u65f6\u5b9a\u65f6\u5668\u6253\u5f00<\/p>\n _XT_OSC XT\u632f\u8361\u6a21\u5f0f<\/p>\n _WRT_OFF \u7981\u6b62Flash\u7a0b\u5e8f\u7a7a\u95f4\u5199\u64cd\u4f5c<\/p>\n _LVP_OFF \u7981\u6b62\u4f4e\u7535\u538b\u7f16\u7a0b<\/p>\n _CPD_OFF EEPROM\u6570\u636e\u8bfb\u4fdd\u62a4\u5173\u95ed<\/p>\n <\/p>\n LVP Low Voltage Program \u4f4e\u7535\u538b\u7f16\u7a0b<\/p>\n CP Code Protect \u4ee3\u7801\u4fdd\u62a4<\/p>\n Date EE Read Protect EEPROM\u6570\u636e\u8bfb\u4fdd\u62a4<\/p>\n Brown Out Detect<\/p>\n Power Up Timer<\/p>\n Watchdog Timer<\/p>\n Flash Program Write<\/p>\n \u5916\u90e8\u65f6\u949f\u8f93\u5165\uff08HS\uff0c XT\u6216LP OSC\u914d\u7f6e\uff09\u5982\u4e0b\u56fe\uff1a<\/p>\n <\/p>\n \n \u9676\u74f7\uff08<\/strong>ceramic<\/strong>\uff09<\/strong>\u8c10\u632f\u5668\u7535\u5bb9\u7684\u9009\u62e9 \u5982\u4e0b\u8868\uff1a<\/strong><\/p>\n <\/p>\n \n \u914d\u7f6e\u5b57\uff08<\/strong>__CONFIG<\/strong>\uff09\uff1a<\/strong><\/p>\n <\/p>\n <\/p>\n \u4e00\u822c\u60c5\u51b5\u4e3a\uff1a 11 1111 0011 0001 0x3F31 \u62160x3F71<\/p>\n <\/p>\n \u4f4d13 CP<\/span>\uff1a\u95ea\u5b58\u7a0b\u5e8f\u5b58\u50a8\u5668\u4ee3\u7801\u4fdd\u62a4\u4f4d 1<\/span><\/p>\n 1=\u4ee3\u7801\u4fdd\u62a4\u5173\u95ed<\/p>\n 0=\u6240\u6709\u7a0b\u5e8f\u5b58\u50a8\u5668\u4ee3\u7801\u4fdd\u62a4<\/p>\n \u4f4d12 \u672a\u5b9a\u4e49<\/span>\uff1a\u8bfb\u6b64\u4f4d\u4e3a1 1<\/span><\/p>\n \u4f4d11 DEBUG<\/span>\uff1a\u5728\u7ebf\u8c03\u8bd5\u5668\u6a21\u5f0f\u4f4d 1<\/span><\/p>\n 1=\u7981\u6b62\u5728\u7ebf\u8c03\u8bd5\u5668\uff0cRB6\u548cRB7\u662f\u901a\u7528I \/ O\u5f15\u811a <\/p>\n 0=\u5728\u7ebf\u8c03\u8bd5\u529f\u80fd\u5f00\u542f\uff0cRB6\u548cRB7\u4e13\u7528\u4e8e\u8c03\u8bd5<\/p>\n \u4f4d10\uff1a9 WRT1<\/span>\uff1a<\/span>WRT0<\/span>\uff1a\u95ea\u5b58\u7a0b\u5e8f\u5b58\u50a8\u5668\u7684\u5199\u4f7f\u80fd\u4f4d 11<\/span><\/p>\n PIC16F876A \/ 877A<\/span><\/p>\n 11=\u5199\u4fdd\u62a4\u5173\u95ed\uff0c\u6240\u6709\u7684\u7a0b\u5e8f\u5b58\u50a8\u5668\u53ef\u80fd\u88ab\u5199\u5165\u7531EECON\u63a7\u5236<\/p>\n 10=0000h-00FFh\u5199\u4fdd\u62a4\uff0c0100h-1FFFh\u5199\u5165\u7531EECON\u63a7\u5236<\/p>\n 01=0000h-07FFh\u5199\u4fdd\u62a4\uff0c0800h-1FFFh\u5199\u5165\u7531EECON\u63a7\u5236<\/p>\n 00=0000h-0FFFh\u5199\u4fdd\u62a4\uff0c1000h-1FFFh\u5199\u5165\u7531EECON\u63a7\u5236<\/p>\n \u4f4d8 CPD<\/span>\uff1a\u6570\u636eEEPROM\u5b58\u50a8\u5668\u4ee3\u7801\u4fdd\u62a4\u4f4d (Code Protection bit<\/span>) 1<\/span><\/p>\n 1=\u6570\u636eEEPROM\u5b58\u50a8\u5668\u4ee3\u7801\u4fdd\u62a4\u5173\u95ed<\/p>\n 0=\u6570\u636eEEPROM\u5b58\u50a8\u5668\u4ee3\u7801\u4fdd\u62a4\u529f\u80fd\u5f00\u542f<\/p>\n \u4f4d7 LVP<\/span>\uff1a\u4f4e\u7535\u538b\uff08\u5355\u7535\u6e90\uff09\u5728\u7ebf\u4e32\u884c\u7f16\u7a0b\u4f7f\u80fd\u4f4d (Low Voltage Program<\/span>) 0<\/span><\/p>\n 1=RB3\/PGM\u5f15\u811a\u6709PGM\u529f\u80fd\uff0c\u4f4e\u7535\u538b\u7f16\u7a0b\u542f\u7528<\/p>\n 0=RB3\u662f\u6570\u5b57I \/ O \u5f15\u811a\uff0cHV(\u9ad8\u7535\u538b13V\u5de6\u53f3) \u52a0\u5230 MCLR\u5fc5\u987b\u7528\u4e8e\u7f16\u7a0b<\/p>\n \u4f4d6 BOREN<\/span>\uff1a\u6b20\u538b\u590d\u4f4d\u4f7f\u80fd\u4f4d\uff08\u4f4e\u7535\u538b\u68c0\u6d4b\u590d\u4f4d\uff09 (Brown-out Reset(Detect)<\/span>) 0<\/span><\/p>\n 1=\u4f4e\u7535\u538b\u68c0\u6d4b\u590d\u4f4dBOR\uff08BOD\uff09\u6a21\u5757\u542f\u7528<\/p>\n 0=\u4f4e\u7535\u538b\u68c0\u6d4b\u590d\u4f4dBOR\uff08BOD\uff09\u6a21\u5757\u5173\u95ed<\/p>\n \u4f4d5:4 \u672a\u5b9a\u4e49<\/span>\uff1a\u8bfb\u6b64\u4e24\u4f4d\u5747\u4e3a1 11<\/span><\/p>\n \u4f4d3 PWRTEN<\/span>\uff1a\u4e0a\u7535\u5b9a\u65f6\u5668\u4f7f\u80fd\u4f4d\uff08\u4e0a\u7535\u590d\u4f4d\u5ef6\u65f6\u5b9a\u65f6\u5668\uff09 (Power-up Timer<\/span>) 0<\/span><\/p>\n <\/p>\n 1=\u4e0a\u7535\u5b9a\u65f6\u5668\u5173\u95ed<\/p>\n 0=\u4e0a\u7535\u5b9a\u65f6\u5668\u5f00\u542f<\/p>\n \u4f4d2 WDT<\/span>\uff1a\u770b\u95e8\u72d7\u5b9a\u65f6\u5668\u4f7f\u80fd\u4f4d 0<\/span>\u6676\u4f53\u632f\u8361\u5668\u7535\u5bb9\u7684\u9009\u62e9<\/p>\n 1=\u770b\u95e8\u72d7\u5f00\u542f \u5982\u53f3\u56fe\uff1a<\/p>\n 0=\u770b\u95e8\u72d7\u5173\u95ed<\/p>\n \u4f4d1\uff1a0 Fosc1<\/span>\uff1a<\/span>Fosc0<\/span>\uff1a\u632f\u8361\u5668\u9009\u62e9\u4f4d 01<\/span><\/p>\n 11=RC\u632f\u8361\u5668<\/p>\n 10=\u6676\u4f53\u632f\u8361\u5668HS\u6a21\u5f0f\u3002\u53c2\u8003\u632f\u8361\u9891\u7387\u8303\u56f4\uff1a>2 MHz<\/p>\n 01=\u6676\u4f53\u632f\u8361\u5668XT\u6a21\u5f0f\u3002\u53c2\u8003\u632f\u8361\u9891\u7387\u8303\u56f4\uff1a100 kHz ~ 4 MHz <\/p>\n 00=\u6676\u4f53\u632f\u8361\u5668LP\u6a21\u5f0f\u3002\u53c2\u8003\u632f\u8361\u9891\u7387\u8303\u56f4\uff1a<200 kHz<\/p>\n OPTION_REG<\/span><\/strong>\u5bc4\u5b58\u5668<\/span><\/strong>\uff1a<\/p>\n <\/p>\n \u4f4d7 RBPU<\/span>\uff1aPORTB\u8f93\u5165\u5f15\u811a\u5185\u90e8\u5f31\u4e0a\u62c9\u4f7f\u80fd\u63a7\u5236\u4f4d<\/p>\n 1=\u6240\u6709PORTB\u7684\u5185\u90e8\u5f31\u4e0a\u62c9\u88ab\u7981\u6b62<\/p>\n 0=\u8bbe\u5b9a\u4e3a\u8f93\u5165\u72b6\u6001\u7684\u5f15\u811a\u5185\u90e8\u5f31\u4e0a\u62c9\u88ab\u4f7f\u80fd<\/p>\n \u4f4d6 INTEDG<\/span>\uff1a\u9009\u62e9RB0\/INT\u5f15\u811a\u7684\u4e2d\u65ad\u6cbf<\/p>\n 1=RB0\/INT \u4e0a\u5347\u6cbf\u4e2d\u65ad<\/p>\n 0=RB0\/INT \u4e0b\u964d\u6cbf\u4e2d\u65ad<\/p>\n \u4f4d5 T0CS<\/span>\uff1a\u9009\u62e9TMR0\u7684\u8ba1\u6570\u65f6\u949f\u6e90<\/p>\n 1=\u5916\u90e8\u8109\u51b2\u6cbf\u8df3\u53d8\u8ba1\u6570<\/p>\n 0=\u5185\u90e8\u6307\u4ee4\u5468\u671f\u8ba1\u6570<\/p>\n \u4f4d4 T0SE<\/span>\uff1a\u9009\u62e9\u8ba1\u6570\u7684\u5916\u90e8\u8109\u51b2\u6cbf<\/p>\n 1=T0CKI\u8109\u51b2\u4e0a\u5347\u6cbf\u8ba1\u6570<\/p>\n 0=T0CKI\u8109\u51b2\u4e0b\u964d\u6cbf\u8ba1\u6570<\/p>\n \u4f4d3 PSA<\/span>\uff1a\u9884\u5206\u9891\u5668\u6307\u6d3e<\/p>\n 1=\u9884\u5206\u9891\u5668\u5206\u914d\u7ed9\u770b\u95e8\u72d7\u5b9a\u65f6\u5668WDT\uff0c\u6b64\u65f6TMR0\u7684\u8ba1\u6570\u9884\u5206\u9891\u4e3a1:1<\/p>\n 0=\u9884\u5206\u9891\u5668\u5206\u914d\u7ed9TMR0<\/p>\n \u4f4d2\uff1a0 PS2<\/span>\uff1a<\/span>PS0<\/span>\uff1a\u8bbe\u5b9a\u9884\u5206\u9891\u5668\u7684\u5206\u9891\u7cfb\u6570\u5982\u4e0b\u8868\u6240\u793a<\/p>\n <\/p>\n \u5206\u9891\u8bbe\u5b9a<\/p>\n<\/td>\n TMR0\u5206\u9891\u6bd4<\/p>\n<\/td>\n WDT\u5206\u9891\u6bd4<\/p>\n<\/td>\n<\/tr>\n 000<\/p>\n<\/td>\n 1:2<\/p>\n<\/td>\n 1:1<\/p>\n<\/td>\n<\/tr>\n 001<\/p>\n<\/td>\n 1:4<\/p>\n<\/td>\n 1:2<\/p>\n<\/td>\n<\/tr>\n 010<\/p>\n<\/td>\n 1:8<\/p>\n<\/td>\n 1:4<\/p>\n<\/td>\n<\/tr>\n 011<\/p>\n<\/td>\n 1:16<\/p>\n<\/td>\n 1:8<\/p>\n<\/td>\n<\/tr>\n 100<\/p>\n<\/td>\n 1:32<\/p>\n<\/td>\n 1:16<\/p>\n<\/td>\n<\/tr>\n 101<\/p>\n<\/td>\n 1:64<\/p>\n<\/td>\n 1:32<\/p>\n<\/td>\n<\/tr>\n 110<\/p>\n<\/td>\n 1:128<\/p>\n<\/td>\n 1:64<\/p>\n<\/td>\n<\/tr>\n 111<\/p>\n<\/td>\n 1:256<\/p>\n<\/td>\n 1:128<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n T1CON\u5bc4\u5b58\u5668\uff1a<\/strong><\/span><\/p>\n <\/p>\n <\/p>\n \u4f4d7\uff1a6 \u6ca1\u6709\u5b9a\u4e49\uff0c\u8bfb\u6b64\u4e24\u4f4d\u7684\u7ed3\u679c\u4e3a0<\/p>\n <\/p>\n \u4f4d5\uff1a4 T1CKPS1<\/span>\uff1a<\/span>T1CKPS0<\/span>\uff1aTMR1\u9884\u5206\u9891\u8bbe\u7f6e<\/p>\n 11=\u9884\u5206\u9891\u7cfb\u65701\uff1a8<\/p>\n 10=\u9884\u5206\u9891\u7cfb\u65701\uff1a4<\/p>\n 01=\u9884\u5206\u9891\u7cfb\u65701\uff1a2<\/p>\n 00=\u9884\u5206\u9891\u7cfb\u65701\uff1a1<\/p>\n \u4f4d3 T1OSCEN<\/span>\uff1a TMR1\u5185\u90e8\u632f\u8361\u5668\u63a7\u5236\u4f4d<\/p>\n 1=\u6253\u5f00\u5185\u90e8\u632f\u8361\u5668\uff0c\u53cd\u76f8\u653e\u5927\u5668\u5de5\u4f5c\uff0c\u9700\u5916\u63a5\u6676\u4f53\u4ea7\u751f\u632f\u8361\u65f6\u949f<\/p>\n 0=\u5173\u95ed\u5185\u90e8\u632f\u8361\u7535\u8def<\/p>\n \u4f4d2 T1SYNC<\/span>\uff1aTMR1\u540c\u6b65\/\u5f02\u6b65\u8ba1\u6570\u63a7\u5236\u4f4d<\/p>\n 1=\u5f02\u6b65\u8ba1\u6570\u6a21\u5f0f<\/p>\n 0=\u540c\u6b65\u8ba1\u6570\u6a21\u5f0f<\/p>\n \u4f4d1 TMR1CS<\/span>\uff1a\u9009\u62e9TMR1\u7684\u8ba1\u6570\u65f6\u949f\u6e90<\/p>\n 1=T1CKI\u5f15\u811a\u4e0a\u7684\u4e0a\u5347\u6cbf\u8ba1\u6570<\/p>\n 0=\u5185\u90e8\u6307\u4ee4\u5468\u671f\u8ba1\u6570\uff08Fosc\/4\uff09<\/p>\n \u4f4d0 TMR1ON<\/span>\uff1aTMR1\u8ba1\u6570\u5141\u8bb8\/\u7981\u6b62\u63a7\u5236\u4f4d<\/p>\n 1=TMR1\u53ef\u4ee5\u8ba1\u6570<\/p>\n 0=TMR1\u8ba1\u6570\u6682\u505c<\/p>\n T2CON<\/strong>\u5bc4\u5b58\u5668\uff1a<\/strong><\/span><\/p>\n <\/p>\n \n \u4f4d7 \u6ca1\u6709\u5b9a\u4e49\uff0c\u8bfb\u6b64\u4f4d\u7684\u7ed3\u679c\u4e3a0 <\/p>\n \u4f4d6\uff1a3 TOUTPS3<\/span>\uff1a<\/span>TOUTPS0<\/span>\uff1aTMR2\u8ba1\u6570\u6ea2\u51fa\u540e\u5206\u9891\u8bbe\u7f6e<\/p>\n 0000=\u540e\u5206\u9891\u7cfb\u65701\uff1a1<\/p>\n 0001=\u540e\u5206\u9891\u7cfb\u65701\uff1a2<\/p>\n \u2026\u2026<\/p>\n 1111=\u540e\u5206\u9891\u7cfb\u65701\uff1a16<\/p>\n \u4f4d2 TMR2ON<\/span>\uff1aTMR2\u8ba1\u6570\u5141\u8bb8\/\u7981\u6b62\u63a7\u5236\u4f4d<\/p>\n 1=TMR2\u53ef\u4ee5\u8ba1\u6570<\/p>\n 0=TMR2\u8ba1\u6570\u6682\u505c<\/p>\n \u4f4d1\uff1a0 T2CKPS1<\/span>\uff1a<\/span>T2CKPS0<\/span>\uff1aTMR2\u9884\u5206\u9891\u8bbe\u7f6e<\/p>\n 00= 1\uff1a1\u9884\u5206\u9891<\/p>\n 01= 1\uff1a4\u9884\u5206\u9891<\/p>\n 1x= 1\uff1a16\u9884\u5206\u9891<\/p>\n CCPxCON<\/strong>\u5bc4\u5b58\u5668\uff1a<\/strong><\/span><\/p>\n <\/p>\n \u4f4d7\uff1a6 \u6ca1\u6709\u5b9a\u4e49\uff0c\u8bfb\u6b64\u4e24\u4f4d\u7684\u7ed3\u679c\u4e3a0<\/p>\n \u4f4d5\uff1a4 CCPxX<\/span>\uff1a<\/span>CCPxY<\/span>\uff1aTMR1\u9884\u5206\u9891\u8bbe\u7f6e<\/p>\n \u6355\u6349\u6a21\u5f0f\uff1a \u672a\u7528<\/p>\n \u6bd4\u8f83\u6a21\u5f0f\uff1a \u672a\u7528<\/p>\n PWM\u6a21\u5f0f\uff1a<\/p>\n PWM\u6a21\u5f0f\u5360\u7a7a\u6bd4\u63a7\u5236\u5b57\u4e3a10\u4f4d\uff0c\u6700\u4f4e2\u4f4d\u5373\u653e\u5728CCPxX\uff1aCCPxY\u4e2d\uff0c\u9ad88\u4f4d\u6570\u636e\u653e\u5165\u4e13\u95e8\u7684\u4e00\u4e2a\u5bc4\u5b58\u5668CCPRxL<\/p>\n \u4f4d3\uff1a0 CCPxM2<\/span>\uff1a<\/span> CCPxM0<\/span>\uff1aCCP\u6a21\u5757\u5de5\u4f5c\u6a21\u5f0f\u9009\u62e9\u4f4d<\/p>\n 0000 =\u5173\u95ed\u6240\u6709\u6a21\u5f0f\uff0cCCPx\u6a21\u5757\u5904\u4e8e\u590d\u4f4d\u72b6\u6001<\/p>\n 0100 =\u6355\u6349\u6a21\u5f0f\uff0c\u6bcf\u4e00\u4e2a\u4e0a\u5347\u6cbf\u6355\u6349\u4e00\u6b21<\/p>\n 0101 =\u6355\u6349\u6a21\u5f0f\uff0c\u6bcf\u4e00\u4e2a\u4e0b\u964d\u6cbf\u6355\u6349\u4e00\u6b21<\/p>\n 0110 =\u6355\u6349\u6a21\u5f0f\uff0c\u6bcf4\u4e2a\u4e0a\u5347\u6cbf\u6355\u6349\u4e00\u6b21<\/p>\n 0111 =\u6355\u6349\u6a21\u5f0f\uff0c\u6bcf16\u4e2a\u4e0a\u5347\u6cbf\u6355\u6349\u4e00\u6b21<\/p>\n 1000 =\u6bd4\u8f83\u6a21\u5f0f\uff0c\u9884\u7f6eCCPx\u5f15\u811a\u8f93\u51fa\u4e3a0\uff0c\u6bd4\u8f83\u4e00\u81f4\u65f6CCPx\u5f15\u811a\u8f93\u51fa\u4e3a1<\/p>\n 1001 =\u6bd4\u8f83\u6a21\u5f0f\uff0c\u9884\u7f6eCCPx\u5f15\u811a\u8f93\u51fa\u4e3a1\uff0c\u6bd4\u8f83\u4e00\u81f4\u65f6CCPx\u5f15\u811a\u8f93\u51fa\u4e3a0<\/p>\n 1010 =\u6bd4\u8f83\u6a21\u5f0f\uff0c\u5f53\u6bd4\u8f83\u4e00\u81f4\u65f6CCPxIF=1\u4ea7\u751f\u8f6f\u4e2d\u65ad\uff0cCCPx\u5f15\u811a\u6ca1\u6709\u53d8\u5316<\/p>\n 1011 =\u6bd4\u8f83\u6a21\u5f0f\uff0c\u5f53\u6bd4\u8f83\u4e00\u81f4\u65f6CCPxIF=1\u4e14\u89e6\u53d1\u7279\u6b8a\u4e8b\u4ef6<\/p>\n 11xx =PWM\u6a21\u5f0f<\/p>\n INTCON\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n <\/p>\n \u4f4d7 GIE<\/span>\uff1a\u5168\u5c40\u4e2d\u65ad\u4f7f\u80fd\u63a7\u5236\u4f4d<\/p>\n 1=\u5141\u8bb8\u4e2d\u65ad\uff0c\u4f46\u5404\u4e2d\u65ad\u8fd8\u6709\u72ec\u7acb\u7684\u4f7f\u80fd\u63a7\u5236\u4f4d<\/p>\n 0=\u7981\u6b62\u6240\u6709\u7684\u4e2d\u65ad\uff0c\u4e0d\u7ba1\u5404\u81ea\u7684\u4e2d\u65ad\u662f\u5426\u5141\u8bb8<\/p>\n \u4f4d6 PEIE<\/span>\uff1a\u5916\u56f4\u529f\u80fd\u6a21\u5757\u4e2d\u65ad\u5141\u8bb8\u63a7\u5236\u4f4d<\/p>\n 1=\u5141\u8bb8\u5916\u56f4\u529f\u80fd\u6a21\u5757\u4e2d\u65ad<\/p>\n 0=\u7981\u6b62\u6240\u6709\u5916\u56f4\u529f\u80fd\u6a21\u5757\u4e2d\u65ad<\/p>\n \u4f4d5 TMR0IE<\/span>\uff08<\/span>T0IE<\/span>\uff09<\/span>\uff1aTMR0\u4e2d\u65ad\u4f7f\u80fd\u63a7\u5236\u4f4d<\/p>\n 1=\u5141\u8bb8TMR0\u4e2d\u65ad<\/p>\n 0=\u7981\u6b62TMR0\u4e2d\u65ad<\/p>\n \u4f4d4 INTE<\/span>\uff1aRB0\/INT\u5f15\u811a\u6cbf\u8df3\u53d8\u4e2d\u65ad\u5141\u8bb8\u63a7\u5236\u4f4d<\/p>\n 1=\u5141\u8bb8RB0\/INT\u5f15\u811a\u4e2d\u65ad<\/p>\n 0=\u7981\u6b62RB0\/INT\u5f15\u811a\u4e2d\u65ad<\/p>\n \u4f4d3 RBIE<\/span>\uff1aPORTB\u5f15\u811a\u72b6\u6001\u53d8\u5316\u4e2d\u65ad\u4f7f\u80fd\u63a7\u5236\u4f4d<\/p>\n 1=\u5141\u8bb8PORTB\u72b6\u6001\u53d8\u5316\u4e2d\u65ad<\/p>\n 0=\u7981\u6b62PORTB\u72b6\u6001\u53d8\u5316\u4e2d\u65ad<\/p>\n \u4f4d2 TMR0IF<\/span>\uff08<\/span>T0IF<\/span>\uff09<\/span>\uff1aTMR0\u4e2d\u65ad\u6807\u5fd7\u4f4d<\/p>\n 1=TMR0\u8ba1\u6570\u6ea2\u51fa\u53d1\u751f\u4e2d\u65ad\uff0c\u5fc5\u987b\u7528\u8f6f\u4ef6\u5c06\u5176\u6e05\u9664<\/p>\n 0=TMR0\u6ca1\u6709\u6ea2\u51fa\u4e2d\u65ad<\/p>\n \u4f4d1 INTF<\/span>\uff1aRB0\/INT\u5f15\u811a\u6cbf\u8df3\u53d8\u4e2d\u65ad\u6807\u5fd7<\/p>\n 1=RB0\/INT\u5f15\u811a\u53d1\u751f\u4e2d\u65ad\uff0c\u5fc5\u987b\u7528\u8f6f\u4ef6\u5c06\u5176\u6e05\u9664<\/p>\n 0=\u6ca1\u6709\u53d1\u751fRB0\/INT\u5f15\u811a\u4e2d\u65ad<\/p>\n \u4f4d0 RBIF<\/span>\uff1aPROTB\u5f15\u811a\u72b6\u6001\u53d8\u5316\u4e2d\u65ad\u6807\u5fd7\u4f4d<\/p>\n 1=PORTB\u5f15\u811a\u51fa\u73b0\u72b6\u6001\u53d8\u5316\u4e2d\u65ad\uff0c\u5fc5\u987b\u7528\u8f6f\u4ef6\u5c06\u5176\u6e05\u9664<\/p>\n 0=PORTB\u5f15\u811a\u6ca1\u6709\u53d1\u751f\u72b6\u6001\u53d8\u5316\u4e2d\u65ad<\/p>\n STATUS<\/strong>\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n PIE1\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n PIR1\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n PIE2\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n PIR2\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n SSPSTAT\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n \u4f4d7 SMP<\/span>\uff1aSPI\u6a21\u5f0f\u4e0b\u6570\u636e\u8f93\u5165\u91c7\u6837\u70b9\u63a7\u5236 \uff08sample\u91c7\u6837\uff09<\/p>\n SPI\u4e3b\u6a21\u5f0f \uff08Serial Peripheral interface <\/span>\u4e32\u884c\u5916\u56f4\u8bbe\u5907\u63a5\u53e3<\/span>\uff09<\/p>\n 1=\u8f93\u51fa\u65f6\u95f4\u7684\u4e2d\u70b9\u5bf9\u8f93\u5165\u6570\u636e\u91c7\u6837<\/p>\n 0=\u8f93\u51fa\u65f6\u95f4\u7ed3\u675f\u65f6\u5bf9\u8f93\u5165\u6570\u636e\u91c7\u6837<\/p>\n SPI\u4ece\u6a21\u5f0f<\/p>\n \u6b64\u4f4d\u5fc5\u987b\u4fdd\u6301\u4e3a0<\/p>\n \u4f4d6 CKE<\/span>\uff1aSPI\u6a21\u5f0f\u4e0b\u65f6\u949f\u6cbf\u9009\u62e9\uff0c\u4e0eCKE\u4f4d\u4e00\u8d77\u5b9e\u73b0SPI\u65f6\u949f\u6781\u6027\u76844\u4e2d\u6a21\u5f0f<\/p>\n CKP=0 \uff08clock edge <\/span>\u65f6\u949f\u6cbf<\/span>\uff09<\/p>\n 0=\u6570\u636e\u5728\u65f6\u949f\u7684\u4e0a\u5347\u6cbf\u65f6\u53d1\u9001<\/p>\n 1=\u6570\u636e\u5728\u65f6\u949f\u7684\u4e0b\u964d\u6cbf\u65f6\u53d1\u9001<\/p>\n CKP=1<\/p>\n 0=\u6570\u636e\u5728\u65f6\u949f\u7684\u4e0b\u964d\u6cbf\u65f6\u53d1\u9001<\/p>\n 1=\u6570\u636e\u5728\u65f6\u949f\u7684\u4e0a\u5347\u6cbf\u65f6\u53d1\u9001<\/p>\n \u4f4d5 D\/A<\/span>\uff1a\u6570\u636e\/\u5730\u5740\u63a7\u5236\u4f4d\uff0c\u53ea\u9002\u7528\u4e8eI2C\u6a21\u5f0f<\/p>\n 0=\u8868\u660e\u63a5\u6536\u6216\u53d1\u9001\u7684\u662f\u5730\u5740\u7801<\/p>\n 1=\u8868\u660e\u63a5\u6536\u6216\u53d1\u9001\u7684\u662f\u666e\u901a\u6570\u636e<\/p>\n \u4f4d4 P<\/span>\uff1a\u505c\u6b62\u4f4d\u6307\u793a\uff0c\u53ea\u9002\u7528\u4e8eI2C\u6a21\u5f0f\u3002\u5f53SSP\u6a21\u5757\u6ca1\u6709\u542f\u7528\u65f6\uff0c\u6b64\u4f4d\u4e3a0<\/p>\n 1=\u8868\u660e\u521a\u624d\u68c0\u6d4b\u5230\u4e00\u4e2a\u505c\u6b62\u4f4d\uff08\u82af\u7247\u590d\u4f4d\u540e\u6b64\u4f4d\u4e3a0\uff09<\/p>\n 0=\u6ca1\u6709\u68c0\u6d4b\u5230\u505c\u6b62\u4f4d<\/p>\n \u4f4d3 S<\/span>\uff1a\u8d77\u59cb\u4f4d\u6307\u793a\uff0c\u53ea\u9002\u7528\u4e8eI2C\u6a21\u5f0f\u3002\u5f53SSP\u6a21\u5757\u6ca1\u6709\u542f\u7528\u65f6\uff0c\u6b64\u4f4d\u4e3a0<\/p>\n 1=\u8868\u660e\u521a\u624d\u68c0\u6d4b\u5230\u4e00\u4e2a\u8d77\u59cb\u4f4d\uff08\u82af\u7247\u590d\u4f4d\u540e\u6b64\u4f4d\u4e3a0\uff09<\/p>\n 0=\u6ca1\u6709\u68c0\u6d4b\u5230\u8d77\u59cb\u4f4d<\/p>\n \u4f4d2 R\/W<\/span>\uff1a\u8bfb\/\u5199\u547d\u4ee4\u6307\u4ee4\uff0c\u53ea\u9002\u7528\u4e8eI2C\u6a21\u5f0f\u3002<\/p>\n \u5728I2C\u901a\u4fe1\u65f6\u5982\u679c\u5bfb\u5740\u5730\u5740\u5339\u914d\uff0c\u8be5\u4f4d\u5c31\u7559\u6709\u8bfb\u6216\u5199\u7684\u6807\u5fd7\u3002\u5176\u6709\u6548\u671f\u9650\u5230\u51fa\u73b0\u4e0b\u4e00\u4e2a\u8d77\u59cb\u4f4d\/\u505c\u6b62\u4f4d\/\u65e0\u5e94\u7b54\u4fe1\u53f7\u4e3a\u6b62<\/p>\n 0=\u6b64\u6b21I2C\u901a\u4fe1\u4e3a\u5199\u64cd\u4f5c<\/p>\n 1=\u6b64\u6b21I2C\u901a\u4fe1\u4e3a\u8bfb\u64cd\u4f5c\uff0c\u4e0eBF\u4f4d\u914d\u5408\u53ef\u4ee5\u5224\u65ad\u4e3b\u5668\u4ef6\u6709\/\u65e0\u5e94\u7b54\u4f4d\u8f93\u51fa<\/p>\n \u4f4d1 UA<\/span>\uff1a\u5730\u5740\u66f4\u65b0\u6807\u5fd7\uff0c\u53ea\u9002\u7528\u4e8eI2C\u901a\u4fe1\u65f6\u768410\u4f4d\u5bfb\u5740\u6a21\u5f0f<\/p>\n 0=\u65e0\u9700\u5730\u5740\u66f4\u65b0<\/p>\n 1=\u8868\u660eSSPADD\u5bc4\u5b58\u5668\u9700\u8981\u66f4\u65b0\u5730\u5740<\/p>\n \u4f4d0 BF<\/span>\uff1a\u6570\u636e\u7f13\u51b2\u5668\u6ee1\u6807\u5fd7<\/p>\n \u63a5\u6536\u65f6\uff08SPI\u548cI2C\uff09<\/p>\n 0=\u63a5\u6536\u6ca1\u6709\u5b8c\u6210\uff0cSSPBUF\u5bc4\u5b58\u5668\u4e3a\u7a7a<\/p>\n 1=\u63a5\u6536\u5df2\u7ecf\u5b8c\u6210\uff0cSSPBUF\u5bc4\u5b58\u5668\u6ee1<\/p>\n \u53d1\u9001\u65f6\uff08\u53ea\u9002\u7528\u4e8eI2C\uff09<\/p>\n 0=\u53d1\u9001\u5b8c\u6210\uff0cSSPBUF\u5bc4\u5b58\u5668\u4e3a\u7a7a<\/p>\n 1=\u6b63\u5728\u53d1\u9001\u8fc7\u7a0b\u4e2d\uff0cSSPBUF\u5bc4\u5b58\u5668\u6ee1<\/p>\n <\/p>\n <\/p>\n SSPCON<\/strong>\uff08<\/strong>SSPCON1<\/strong>\uff09\u5bc4\u5b58\u5668\uff1a<\/strong><\/p>\n <\/p>\n \u4f4d7 WCOL<\/span>\uff1a\u53d1\u9001\u6570\u636e\u5199\u5165\u65f6\u7684\u51b2\u7a81\u6807\u5fd7<\/p>\n 0=\u5199\u5165\u65f6\u6ca1\u6709\u51b2\u7a81\u53d1\u751f<\/p>\n 1=\u5f53SSPBUF\u6b63\u5728\u53d1\u9001\u6570\u636e\u65f6\u7a0b\u5e8f\u53c8\u5bf9\u5176\u8fdb\u884c\u6570\u636e\u5199\u5165\u800c\u53d1\u9001\u51b2\u7a81\uff0c\u6b64\u4f4d\u88ab\u7f6e\u4f4d\u540e\u5fc5\u987b\u6709\u8f6f\u4ef6\u5c06\u5176\u6e050<\/p>\n \u4f4d6 SSPOV<\/span>\uff1a\u63a5\u6536\u6570\u636e\u6ea2\u51fa\u6807\u5fd7\u4f4d<\/p>\n SPI\u6a21\u5f0f<\/p>\n 0=\u6570\u636e\u63a5\u6536\u6ca1\u6709\u6ea2\u51fa<\/p>\n 1=\u5f53SSPBUF\u5bc4\u5b58\u5668\u4e2d\u6240\u63a5\u6536\u7684\u6570\u636e\u8fd8\u6ca1\u6709\u88ab\u8bfb\u8d70\u65f6\uff0c\u5185\u90e8\u7684\u79fb\u4f4d\u5bc4\u5b58\u5668SSPSR\u5185\u53c8\u6709\u65b0\u7684\u6570\u636e\u5c31\u7eea\uff0c\u6b64\u65f6SSPSR\u5185\u7684\u6570\u636e\u5c06\u88ab\u4e22\u5f03\uff0cSSPBUF\u4e0d\u4f1a\u88ab\u66f4\u65b0\u3002SPI\u6a21\u5f0f\u4e0b\u63a5\u6536\u6570\u636e\u6ea2\u51fa\u53ea\u53ef\u80fd\u53d1\u751f\u5728\u4ece\u6a21\u5f0f\u4e0b\u3002\u5982\u679c\u5728\u4ece\u6a21\u5f0f\u4e0b\u53ea\u53d1\u9001\u6570\u636e\uff0c\u53d1\u9001\u5b8c\u6bd5\u540e\u5e94\u7528\u7a0b\u5e8f\u4e5f\u5fc5\u987b\u8bfb\u4e00\u6b21SSPBUF\u4ee5\u514d\u53d1\u751f\u6ea2\u51fa\u6807\u5fd7\u3002\u5728\u4e3b\u6a21\u5f0f\u4e0b\u5f97\u4e00\u6b21\u63a5\u6536\uff08\u6216\u53d1\u9001\uff09\u8fc7\u7a0b\u90fd\u5fc5\u987b\u901a\u8fc7\u5199SSPBUF\u624d\u80fd\u542f\u52a8\uff0c\u6545\u4e00\u822c\u4e0d\u4f1a\u51fa\u73b0\u63a5\u6536\u6ea2\u51fa\uff0c\u9664\u975e\u4f60\u5728\u63a5\u6536\u6570\u636e\u5230\u6765\u540e\u6545\u610f\u4e0d\u53bb\u8bfbSSPBUF\u5bc4\u5b58\u5668\u3002<\/p>\n I2C\u6a21\u5f0f<\/p>\n 0=\u63a5\u6536\u6570\u636e\u6ca1\u6709\u6ea2\u51fa<\/p>\n 1=\u5f53SSPBUF\u4e2d\u539f\u6765\u63a5\u6536\u5230\u7684\u6570\u636e\u8fd8\u6ca1\u6709\u88ab\u53d6\u8d70\u65f6\u53c8\u6709\u65b0\u7684\u6570\u636e\u88ab\u6536\u5230\u3002\u5728I2C\u5904\u4e8e\u6570\u636e\u53d1\u9001\u6a21\u5f0f\u65f6\uff0c\u6b64\u4f4d\u4e0d\u8d77\u4efb\u4f55\u4f5c\u7528\u3002\u4f46\u65e0\u8bba\u662f\u63a5\u6536\u8fd8\u662f\u53d1\u9001\uff0c\u5982\u679c\u6b64\u4f4d\u88ab\u7f6e1\uff0c\u5fc5\u987b\u7528\u8f6f\u4ef6\u5c06\u5176\u6e050\u3002<\/p>\n \u4f4d5 SSPEN<\/span>\uff1a\u540c\u6b65\u4e32\u884c\u63a5\u53e3\u4f7f\u80fd\u63a7\u5236\u4f4d<\/p>\n SPI\u6a21\u5f0f<\/p>\n 1=\u5f00\u542fSPI\u529f\u80fd\uff0c\u914d\u7f6e\u82af\u7247\u7684SCK\u3001SDO\u3001SDI\u3001\u548cSS\u5f15\u811a\u4e3aSPI\u901a\u4fe1\u5f15\u811a<\/p>\n 0=SSP\u6a21\u5757\u88ab\u5173\u95ed\uff0c\u76f8\u5e94\u7684\u5f15\u811a\u4e3a\u666e\u901a\u6570\u5b57I\/O\u529f\u80fd\u3002<\/p>\n I2C\u6a21\u5f0f<\/p>\n 1=\u5f00\u542fI2C\u529f\u80fd\uff0c\u914d\u7f6e\u82af\u7247\u7684SDA\u3001SDL\u4e3aI2C\u901a\u4fe1\u5f15\u811a<\/p>\n 0=SSP\u6a21\u5757\u88ab\u5173\u95ed\uff0c\u76f8\u5e94\u7684\u5f15\u811a\u4e3a\u666e\u901a\u6570\u5b57I\/O\u529f\u80fd\u3002<\/p>\n \u4f4d4 CKP<\/span>\uff1a\u65f6\u949f\u6781\u6027\u63a7\u5236\u4f4d \uff08clock polarity<\/span>\u65f6\u949f\u6781\u6027<\/span>\uff09<\/p>\n SPI\u6a21\u5f0f<\/p>\n 0=\u5728\u901a\u4fe1\u7684\u7a7a\u95f2\u72b6\u6001\u4e0b\u65f6\u949f\u5904\u4e8e\u4f4e\u7535\u5e73<\/p>\n 1=\u5728\u901a\u4fe1\u7684\u7a7a\u95f2\u72b6\u6001\u4e0b\u65f6\u949f\u5904\u4e8e\u9ad8\u7535\u5e73<\/p>\n I2C\u6a21\u5f0f \u7528\u4e8e\u65f6\u949fSCK\u7684\u91ca\u653e\u63a7\u5236<\/p>\n 0=\u5c06\u65f6\u949f\u6301\u7eed\u62c9\u4f4e\uff0c\u7528\u4ee5\u4fdd\u8bc1\u6570\u636e\u5efa\u7acb\u6216\u51c6\u5907\u6240\u9700\u7684\u65f6\u95f4<\/p>\n 1=\u5141\u8bb8\u4e3b\u5668\u4ef6\u63a7\u5236\u65f6\u949f\u53d8\u5316<\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n <\/p>\n \u4f4d3\uff1a0 SSPM3<\/span>\uff1a<\/span>SSPM0<\/span>\uff1a\u540c\u6b65\u4e32\u884c\u63a5\u53e3\u5de5\u4f5c\u6a21\u5f0f\u9009\u62e9 M=Mode \u6a21\u5f0f<\/p>\n 0000=SPI\u4e3b\u6a21\u5f0f\uff0c\u65f6\u949f=fosc\/4<\/p>\n 0001=SPI\u4e3b\u6a21\u5f0f\uff0c\u65f6\u949f=fosc\/16<\/p>\n 0010=SPI\u4e3b\u6a21\u5f0f\uff0c\u65f6\u949f=fosc\/64<\/p>\n 0011=SPI\u4e3b\u6a21\u5f0f\uff0c\u65f6\u949f=TMR2\u7684\u6ea2\u51fa\u7387\/2<\/p>\n 0100=SPI\u4ece\u6a21\u5f0f\uff0c\u65f6\u949f=SCK\u5f15\u811a\u8f93\u5165\uff0c\u4f7f\u7528SS\u5f15\u811a\u63a7\u5236<\/p>\n 0101=SPI\u4ece\u6a21\u5f0f\uff0c\u65f6\u949f=SCK\u5f15\u811a\u8f93\u5165\uff0c\u65e0SS\u5f15\u811a\u63a7\u5236\uff08SS\u53ef\u4ee5\u4f5c\u4e3a\u666e\u901aI\/O\uff09<\/p>\n 0110=I2C\u4ece\u6a21\u5f0f\uff0c7\u4f4d\u5bfb\u5740\u53d1\u9001<\/p>\n 0111=I2C\u4ece\u6a21\u5f0f\uff0c10\u4f4d\u5bfb\u5740\u53d1\u9001<\/p>\n 1000=I2C\u4e3b\u6a21\u5f0f\uff0c\u65f6\u949f=fosc\/(4(SSPADD+1))<\/p>\n 1001=\u4fdd\u7559<\/p>\n 1010=\u4fdd\u7559<\/p>\n 1011=\u8f6f\u4ef6\u63a7\u5236\u578bI2C\u4e3b\u6a21\u5f0f\uff0c\u786c\u4ef6\u4ece\u6a21\u5f0f\u529f\u80fd\u5173\u95ed<\/p>\n 1100=\u4fdd\u7559<\/p>\n 1101=\u4fdd\u7559<\/p>\n 1110=I2C\u4ece\u6a21\u5f0f\uff0c7\u4f4d\u5bfb\u5740\u53d1\u9001\uff0c\u8d77\u59cb\u4f4d\u548c\u505c\u6b62\u4f4d\u4ea7\u751f\u4e2d\u65ad\u54cd\u5e94<\/p>\n 1111=I2C\u4ece\u6a21\u5f0f\uff0c10\u4f4d\u5bfb\u5740\u53d1\u9001\uff0c\u8d77\u59cb\u4f4d\u548c\u505c\u6b62\u4f4d\u4ea7\u751f\u4e2d\u65ad\u54cd\u5e94<\/p>\n <\/p>\n <\/p>\n <\/p>\n SSPCON2<\/strong>\u5bc4\u5b58\u5668\uff1a<\/strong> \uff08\u53ea\u6709\u5e26<\/span>MSSP<\/span>\u6a21\u5757\u7684\u6709\u8be5\u5bc4\u5b58\u5668\u4e14\u53ea\u5728<\/span>I2C<\/span>\u6a21\u5f0f\u65f6\u6709\u7528<\/span>\uff09<\/p>\n <\/p>\n \n \u4f4d7 GCEN<\/span>\uff1a\u5e7f\u64ad\u547c\u53eb\u4f7f\u80fd\u4f4d\uff08\u53ea\u9002\u7528\u4e8eI2C\u4ece\u6a21\u5f0f\uff09<\/p>\n 0=\u7981\u6b62\u5e7f\u64ad\u5bfb\u547c<\/p>\n 1=\u5f53\u63a5\u6536\u5230\u7279\u6b8a\u7684\u5e7f\u64ad\u5bfb\u547c\u5730\u57400x00\u65f6\uff0c\u5141\u8bb8\u4ea7\u751f\u4e2d\u65ad<\/p>\n \u4f4d6 ACKSTST<\/span>\uff1a\u5e94\u7b54\u4f4d\u63a5\u6536\u72b6\u6001\u6807\u5fd7\uff08\u53ea\u9002\u7528\u4e8eI2C\u4e3b\u6a21\u5f0f\u53d1\u9001\u6570\u636e\uff09<\/p>\n 0=\u53d1\u51fa\u6570\u636e\u540e\u63a5\u6536\u5230\u4ece\u5668\u4ef6\u53d1\u51fa\u7684\u5e94\u7b54\u4f4d<\/p>\n 1=\u53d1\u51fa\u6570\u636e\u540e\u4ece\u5668\u4ef6\u6ca1\u6709\u4ea7\u751f\u5e94\u7b54\u4f4d<\/p>\n \u4f4d5 ACKDT<\/span>\uff1a\u5e94\u7b54\u6570\u636e\u4f4d\uff08\u53ea\u9002\u7528\u4e8eI2C\u4e3b\u6a21\u5f0f\u63a5\u6536\u6570\u636e\uff09<\/p>\n 0=\u6570\u636e\u6536\u5230\u540e\u4e3b\u5668\u4ef6\u5c06\u53d1\u51fa\u5e94\u7b54\u4f4d<\/p>\n 1=\u6570\u636e\u6536\u5230\u540e\u4e3b\u5668\u4ef6\u5c06\u4e0d\u53d1\u51fa\u5e94\u7b54\u4f4d<\/p>\n \u4f4d4 ACKEN<\/span>\uff1a\u4f7f\u80fd\u786c\u4ef6\u81ea\u52a8\u4ea7\u751f\u5e94\u7b54\u4f4d\uff08\u53ea\u9002\u7528\u4e8eI2C\u4e3b\u6a21\u5f0f\u63a5\u6536\u6570\u636e\uff09<\/p>\n 0=\u65e0\u5e94\u7b54\u4f4d\u53d1\u51fa<\/p>\n 1=\u542f\u52a8SDA\u548cSCL\u603b\u7ebf\u4e0a\u4ea7\u751fACKDT\u6240\u8bbe\u7f6e\u7684\u5e94\u7b54\u4f4d\u3002\u5728\u5e94\u7b54\u4f4d\u53d1\u51fa\u540e\u6b64\u4f4d\u88ab\u786c\u4ef6\u81ea\u52a8\u6e05\u96f60<\/p>\n \u4f4d3 RCEN<\/span>\uff1a\u63a5\u6536\u4f7f\u80fd\u4f4d\uff08\u53ea\u9002\u7528\u4e8eI2C\u4e3b\u6a21\u5f0f\uff09<\/p>\n 0=\u7981\u6b62I2C\u63a5\u6536\u6570\u636e<\/p>\n 1=\u542f\u52a8I2C\u63a5\u65368\u4f4d\u6570\u636e\uff0c8\u4f4d\u6570\u636e\u63a5\u6536\u5b8c\u6bd5\u540e\u786c\u4ef6\u81ea\u52a8\u6e050<\/p>\n \u4f4d2 PEN<\/span>\uff1a\u4f7f\u80fd\u786c\u4ef6\u81ea\u52a8\u4ea7\u751f\u505c\u6b62\u4f4d\uff08\u53ea\u9002\u7528\u4e8eI2C\u4e3b\u6a21\u5f0f\uff09<\/p>\n 0=\u65e0\u505c\u6b62\u4f4d\u53d1\u51fa<\/p>\n 1=\u542f\u52a8SDA\u548cSCL\u603b\u7ebf\u4e0a\u4ea7\u751f\u505c\u6b62\u4f4d\u3002\u505c\u6b62\u4f4d\u53d1\u51fa\u540e\u6b64\u4f4d\u88ab\u786c\u4ef6\u81ea\u52a8\u6e05\u96f60<\/p>\n \u4f4d1 RSEN<\/span>\uff1a\u4f7f\u80fd\u786c\u4ef6\u81ea\u52a8\u4ea7\u751f\u91cd\u590d\u8d77\u59cb\u4f4d\uff08\u53ea\u9002\u7528\u4e8eI2C\u4e3b\u6a21\u5f0f\uff09<\/p>\n 0=\u65e0\u91cd\u590d\u8d77\u59cb\u4f4d\u53d1\u51fa<\/p>\n 1=\u542f\u52a8SDA\u548cSCL\u603b\u7ebf\u4e0a\u4ea7\u751f\u91cd\u590d\u8d77\u59cb\u4f4d\u3002\u91cd\u590d\u8d77\u59cb\u4f4d\u53d1\u51fa\u540e\u6b64\u4f4d\u88ab\u786c\u4ef6\u81ea\u52a8\u6e05\u96f60<\/p>\n \u4f4d0 SEN<\/span>\uff1a\u4f7f\u80fd\u786c\u4ef6\u81ea\u52a8\u4ea7\u751f\u8d77\u59cb\u4f4d\/\u7535\u5e73\u5ef6\u4f38\u63a7\u5236\u4f4d<\/p>\n I2C\u4e3b\u6a21\u5f0f<\/p>\n 0=\u65e0\u8d77\u59cb\u4f4d\u53d1\u51fa<\/p>\n 1=\u542f\u52a8SDA\u548cSCL\u603b\u7ebf\u4e0a\u4ea7\u751f\u8d77\u59cb\u4f4d\u3002\u8d77\u59cb\u4f4d\u53d1\u51fa\u540e\u6b64\u4f4d\u88ab\u786c\u4ef6\u81ea\u52a8\u6e05\u96f60<\/p>\n I2C\u4ece\u6a21\u5f0f<\/p>\n 0=\u53ea\u5728\u4ece\u5668\u4ef6\u53d1\u9001<\/span>\u6570\u636e\u65f6\u5ef6\u4f38\u65f6\u949f\u7535\u5e73<\/p>\n 1=\u5728\u4ece\u5668\u4ef6\u63a5\u6536\u6216\u53d1\u9001\u6570<\/span>\u636e\u65f6\u5ef6\u4f38\u65f6\u949f\u7535\u5e73<\/p>\n <\/p>\n <\/p>\n ADCON0<\/strong>\u5bc4\u5b58\u5668\uff1a<\/strong>\uff08\u8bbe\u7f6e<\/span>ADC<\/span>\u6a21\u5757\u5de5\u4f5c\u65b9\u5f0f<\/span>\uff09<\/p>\n <\/p>\n \n <\/p>\n \u4f4d7\uff1a6 ADCS1<\/span>\uff1a<\/span>ADCS0<\/span>\uff1aA\/D\u8f6c\u6362\u65f6\u949f\u9009\u62e9<\/p>\n 00= fosc\/2\uff0c\u5373\u65f6\u949f\u6e90\u81ea\u4e8e\u82af\u7247\u4e3b\u632f\u8361\u76842\u5206\u9891<\/p>\n 01= fosc\/8\uff0c\u5373\u65f6\u949f\u6e90\u81ea\u4e8e\u82af\u7247\u4e3b\u632f\u8361\u76848\u5206\u9891<\/p>\n 10= fosc\/32\uff0c\u5373\u65f6\u949f\u6e90\u81ea\u4e8e\u82af\u7247\u4e3b\u632f\u8361\u768432\u5206\u9891<\/p>\n 11= fRC\uff0c\u5373\u65f6\u949f\u6e90\u81ea\u4e8eAD\u6a21\u5757\u5185\u81ea\u5e26\u7684RC\u632f\u8361\u9891\u7387<\/p>\n \u4f4d5\uff1a3 CHS2<\/span>\uff1a<\/span>CHS0<\/span>\uff1aA\/D\u8f6c\u6362\u8f93\u5165\u6a21\u62df\u4fe1\u53f7\u901a\u9053\u9009\u62e9<\/p>\n 000=\u901a\u90530\uff0cAN0<\/p>\n 001=\u901a\u90531\uff0cAN1<\/p>\n 010=\u901a\u90532\uff0cAN2<\/p>\n 011=\u901a\u90533\uff0cAN3<\/p>\n 100=\u901a\u90534\uff0cAN4<\/p>\n 101=\u901a\u90535\uff0cAN5<\/p>\n 110=\u901a\u90536\uff0cAN6<\/p>\n 111=\u901a\u90537\uff0cAN7<\/p>\n \u4f4d2 GO\/DONE<\/span>\uff1aA\/D\u8f6c\u6362\u542f\u52a8\u63a7\u5236\u4f4d\u548c\u8f6c\u6362\u72b6\u6001\u6807\u5fd7\u4f4d<\/p>\n \u8fd9\u4e00\u4f4d\u65e2\u662fA\/D\u8f6c\u6362\u63a7\u5236\u4f4d\uff0c\u901a\u8fc7\u8f6f\u4ef6\u5c06\u5176\u7f6e1\u540e\u5f00\u59cb\u4e00\u4e2aA\/D\u8f6c\u6362\u8fc7\u7a0b\uff1b\u540c\u65f6\u53c8\u662f\u4e00\u4e2a\u6807\u5fd7\u4f4d<\/p>\n 1=A\/D\u8f6c\u6362\u6b63\u5728\u8fdb\u884c\u4e2d<\/p>\n 0=A\/D\u8f6c\u6362\u8fc7\u7a0b\u7ed3\u675f<\/p>\n \u4f4d1 \u672a\u5b9a\u4e49\uff1a\u7a0b\u5e8f\u4e2d\u8bb0\u5f97\u8be5\u4f4d\u8981\u59cb\u7ec8\u4fdd\u6301\u4e3a0<\/p>\n \u4f4d0 ADON<\/span>\uff1aA\/D\u6a21\u5757\u542f\u52a8\u63a7\u5236\u4f4d<\/p>\n 1=A\/D\u8f6c\u6362\u6a21\u5757\u5f00\u59cb\u5de5\u4f5c<\/p>\n 0=A\/D\u8f6c\u6362\u6a21\u5757\u88ab\u7981\u6b62\uff0c\u8be5\u90e8\u5206\u7535\u8def\u6ca1\u6709\u4efb\u4f55\u8017\u7535<\/p>\n <\/p>\n <\/p>\n ADCON1<\/strong>\u5bc4\u5b58\u5668\uff1a<\/strong>\uff08\u8bbe\u7f6e<\/span>ADC<\/span>\u6a21\u5757\u7aef\u53e3\u548c\u6570\u636e\u683c\u5f0f<\/span>\uff09<\/p>\n <\/p>\n \u4f4d7 ADFM<\/span>\uff1aA \/ D\u8f6c\u6362\u7ed3\u679c\u683c\u5f0f\u9009\u62e9\u4f4d \uff08AD Result Format Select Bit<\/span>\uff09<\/p>\n 0=\u7ed3\u679c\u5de6\u5bf9\u9f50\uff0cADRESL \u5bc4\u5b58\u5668\u7684\u4f4e6\u4f4d\u8bfb\u4f5c0<\/p>\n 1=\u7ed3\u679c\u53f3\u5bf9\u9f50\uff0cADRESH\u5bc4\u5b58\u5668\u7684\u9ad86\u4f4d\u8bfb\u4f5c0<\/p>\n \n \u4f4d6 ADCS2<\/span>\uff1aA \/ D\u8f6c\u6362\u65f6\u949f\u9891\u7387\u9009\u62e9\u4f4d\uff08ADCON1\u4f4d\u5728\u9634\u5f71\u533a\u57df\uff0c\u5e76\u4ee5\u7c97\u4f53\u5b57\uff09<\/p>\n\n\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n