{"id":2336,"date":"2019-04-15T08:12:53","date_gmt":"2019-04-15T08:12:53","guid":{"rendered":""},"modified":"2019-04-15T16:13:23","modified_gmt":"2019-04-15T08:13:23","slug":"c51%e5%8d%95%e7%89%87%e6%9c%ba%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b%e7%9a%84%e5%85%b7%e4%bd%93%e5%ae%9a%e4%b9%89%e5%8f%8a%e5%ba%94%e7%94%a8","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2336","title":{"rendered":"C51\u5355\u7247\u673a\u6570\u636e\u7c7b\u578b\u7684\u5177\u4f53\u5b9a\u4e49\u53ca\u5e94\u7528"},"content":{"rendered":"

\n\t\u5148\u6765\u7b80\u5355\u8bf4\u8bf4C\u8bed\u8a00\u7684\u6807\u8bc6\u7b26\u548c\u5173\u952e\u5b57\u3002\u6807\u8bc6\u7b26\u662f\u7528\u6765\u6807\u8bc6\u6e90\u7a0b\u5e8f\u4e2d\u67d0\u4e2a\u5bf9\u8c61\u7684\u540d\u5b57\u7684\uff0c\u8fd9\u4e9b\u5bf9\u8c61\u53ef\u4ee5\u662f\u8bed\u53e5\u3001\u6570\u636e\u7c7b\u578b\u3001\u51fd\u6570\u3001\u53d8\u91cf\u3001\u6570\u7ec4\u7b49\u7b49\u3002C\u8bed\u8a00\u662f\u5927\u5c0f\u5b57\u654f\u611f\u7684\u4e00\u79cd\u9ad8\u7ea7\u8bed\u8a00\uff0c\u5982\u679c\u6211\u4eec\u8981\u5b9a\u4e49\u4e00\u4e2a\u5b9a\u65f6\u5668<\/u>1\uff0c\u53ef\u4ee5\u5199\u505a“Ti<\/u>mer1”\uff0c\u5982\u679c\u7a0b\u5e8f\u4e2d\u6709“TIMER1”\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u662f\u5b8c\u5168\u4e0d\u540c\u5b9a\u4e49\u7684\u6807\u8bc6\u7b26\u3002\u6807\u8bc6\u7b26\u7531\u5b57\u7b26\u4e32\uff0c\u6570\u5b57\u548c\u4e0b\u5212\u7ebf\u7b49\u7ec4\u6210\uff0c\u6ce8\u610f\u7684\u662f\u7b2c\u4e00\u4e2a\u5b57\u7b26\u5fc5\u987b\u662f\u5b57\u6bcd\u6216\u4e0b\u5212\u7ebf\uff0c\u5982“1TImer”\u662f\u9519\u8bef\u7684\uff0c\u7f16\u8bd1\u65f6\u4fbf\u4f1a\u6709\u9519\u8bef\u63d0\u793a\u3002\u6709\u4e9b\u7f16\u8bd1\u7cfb\u7edf\u4e13\u7528\u7684\u6807\u8bc6\u7b26\u662f\u4ee5\u4e0b\u5212\u7ebf\u5f00\u5934\uff0c\u6240\u4ee5\u4e00\u822c\u4e0d\u8981\u4ee5\u4e0b\u5212\u7ebf\u5f00\u5934\u547d\u540d\u6807\u8bc6\u7b26\u3002\u6807\u8bc6\u7b26\u5728\u547d\u540d\u65f6\u5e94\u5f53\u7b80\u5355\uff0c\u542b\u4e49\u6e05\u6670\uff0c\u8fd9\u6837\u6709\u52a9\u4e8e\u9605\u8bfb\u7406\u89e3\u7a0b\u5e8f\u3002\u5728C51\u7f16\u8bd1\u5668\u4e2d\uff0c\u53ea\u652f\u6301\u6807\u8bc6\u7b26\u7684\u524d32\u4f4d\u4e3a\u6709\u6548\u6807\u8bc6\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u4e5f\u8db3\u591f\u7528\u4e86\uff0c\u9664\u975e\u4f60\u8981\u5199\u5929\u4e66\uff1aP\u3002<\/p>\n

\n\t\u5173\u952e\u5b57\u5219\u662f\u7f16\u7a0b\u8bed\u8a00\u4fdd\u7559\u7684\u7279\u6b8a\u6807\u8bc6\u7b26\uff0c\u5b83\u4eec\u5177\u6709\u56fa\u5b9a\u540d\u79f0\u548c\u542b\u4e49\uff0c\u5728\u7a0b\u5e8f\u7f16\u5199\u4e2d\u4e0d\u5141\u8bb8\u6807\u8bc6\u7b26\u4e0e\u5173\u952e\u8d44\u4ea6\u540c\u3002\u5728KEIL<\/u> uVision2\u4e2d\u7684\u5173\u952e\u5b57\u9664\u4e86\u6709ANSI C\u6807\u51c6\u768432\u4e2a\u5173\u952e\u5b57\u5916\u8fd8\u6839\u636e51\u5355\u7247\u673a<\/u>\u7684\u7279\u70b9\u6269\u5c55\u4e86\u76f8\u5173\u7684\u5173\u952e\u5b57\u3002\u5176\u5b9e\u5728KEIL uVision2\u7684\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u7f16\u5199C\u7a0b\u5e8f\uff0c\u7cfb\u7edf\u53ef\u4ee5\u628a\u4fdd\u7559\u5b57\u4ee5\u4e0d\u540c\u989c\u8272\u663e\u793a\uff0c\u7f3a\u7701\u989c\u8272\u4e3a\u5929\u84dd\u8272\u3002<\/p>\n

\n\t <\/div>\n

\n\t\u5148\u770b\u88684\uff0d1\uff0c\u8868\u4e2d\u5217\u51fa\u4e86KEIL uVision2 C51\u7f16\u8bd1\u5668\u6240\u652f\u6301\u7684\u6570\u636e\u7c7b\u578b\u3002\u5728\u6807\u51c6C\u8bed\u8a00\u4e2d\u57fa\u672c\u7684\u6570\u636e\u7c7b\u578b\u4e3achar\uff0cint\uff0cshort\uff0clong\uff0cfloat\u548cdouble\uff0c\u800c\u5728C51\u7f16\u8bd1\u5668\u4e2dint\u548cshort\u76f8\u540c\uff0cfloat\u548cdouble\u76f8\u540c\uff0c\u8fd9\u91cc\u5c31\u4e0d\u5217\u51fa\u8bf4\u660e\u4e86\u3002\u4e0b\u9762\u6765\u770b\u770b\u5b83\u4eec\u7684\u5177\u4f53\u5b9a\u4e49\uff1a<\/p>\n

\n\t1\uff0e char\u5b57\u7b26\u7c7b\u578b<\/p>\n

\n\tchar\u7c7b\u578b\u7684\u957f\u5ea6\u662f\u4e00\u4e2a\u5b57\u8282\uff0c\u901a\u5e38\u7528\u4e8e\u5b9a\u4e49\u5904\u7406\u5b57\u7b26\u6570\u636e\u7684\u53d8\u91cf\u6216\u5e38\u91cf\u3002\u5206\u65e0\u7b26\u53f7\u5b57\u7b26\u7c7b\u578bunsigned char\u548c\u6709\u7b26\u53f7\u5b57\u7b26\u7c7b\u578bsigned char\uff0c\u9ed8\u8ba4\u503c\u4e3asigned char\u7c7b\u578b\u3002unsigned char\u7c7b\u578b\u7528\u5b57\u8282\u4e2d\u6240\u6709\u7684\u4f4d\u6765\u8868\u793a\u6570\u503c\uff0c\u6240\u53ef\u4ee5\u8868\u8fbe\u7684\u6570\u503c\u8303\u56f4\u662f0\uff5e255\u3002signed char\u7c7b\u578b\u7528\u5b57\u8282\u4e2d\u6700\u9ad8\u4f4d\u5b57\u8282\u8868\u793a\u6570\u636e\u7684\u7b26\u53f7\uff0c“0”\u8868\u793a\u6b63\u6570\uff0c“1”\u8868\u793a\u8d1f\u6570\uff0c\u8d1f\u6570\u7528\u8865\u7801\u8868\u793a\u3002\u6240\u80fd\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u662f-128\uff5e+127\u3002unsigned char\u5e38\u7528\u4e8e\u5904\u7406ASCII\u5b57\u7b26\u6216\u7528\u4e8e\u5904\u7406\u5c0f\u4e8e\u6216\u7b49\u4e8e255\u7684\u6574\u578b\u6570\u3002<\/p>\n

\n\t\uff0a\u6b63\u6570\u7684\u8865\u7801\u4e0e\u539f\u7801\u76f8\u540c\uff0c\u8d1f\u4e8c\u8fdb\u5236\u6570\u7684\u8865\u7801\u7b49\u4e8e\u5b83\u7684\u7edd\u5bf9\u503c\u6309\u4f4d\u53d6\u53cd\u540e\u52a01\u3002<\/p>\n

\n\t2\uff0e int\u6574\u578b<\/p>\n

\n\tint\u6574\u578b\u957f\u5ea6\u4e3a\u4e24\u4e2a\u5b57\u8282\uff0c\u7528\u4e8e\u5b58\u653e\u4e00\u4e2a\u53cc\u5b57\u8282\u6570\u636e\u3002\u5206\u6709\u7b26\u53f7int\u6574\u578b\u6570signed int\u548c\u65e0\u7b26\u53f7\u6574\u578b\u6570unsigned int\uff0c\u9ed8\u8ba4\u503c\u4e3asigned int\u7c7b\u578b\u3002signed int\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u662f-32768\uff5e+32767\uff0c\u5b57\u8282\u4e2d\u6700\u9ad8\u4f4d\u8868\u793a\u6570\u636e\u7684\u7b26\u53f7\uff0c“0”\u8868\u793a\u6b63\u6570\uff0c“1”\u8868\u793a\u8d1f\u6570\u3002unsigned int\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u662f0\uff5e65535\u3002<\/p>\n

\n\t\u597d\u4e86\uff0c\u5148\u505c\u4e00\u4e0b\u5427\uff0c\u6211\u4eec\u6765\u5199\u4e2a\u5c0f\u7a0b\u5e8f\u770b\u770bunsigned char\u548cunsigned int\u7528\u4e8e\u5ef6\u65f6\u7684\u4e0d\u540c\u6548\u679c\uff0c\u8bf4\u660e\u5b83\u4eec\u7684\u957f\u5ea6\u662f\u4e0d\u540c\u7684\uff0c\u5475\uff0c\u5c3d\u7ba1\u5b83\u5e76\u6ca1\u6709\u5b9e\u9645\u7684\u5e94\u7528\u610f\u4e49\uff0c\u8fd9\u91cc\u6211\u4eec\u5b66\u4e60\u5b83\u4eec\u7684\u7528\u6cd5\u5c31\u884c\u3002\u4f9d\u65e7\u7528\u6211\u4eec\u4e0a\u4e00\u8bfe\u7684\u6700\u5c0f\u5316\u7cfb\u7edf\u505a\u5b9e\u9a8c\uff0c\u4e0d\u8fc7\u8981\u52a0\u591a\u4e00\u4e2a\u7535\u963b<\/u>\u548cLED\uff0c\u5982\u56fe4\uff0d1\u3002\u5b9e\u9a8c\u4e2d\u7528D1\u7684\u70b9\u4eae\u8868\u660e\u6b63\u5728\u7528unsigned int\u6570\u503c\u5ef6\u65f6\uff0c\u7528D2\u70b9\u4eae\u8868\u660e\u6b63\u5728\u7528unsigned char\u6570\u503c\u5ef6\u65f6\u3002<\/p>\n

\n\t\"C51\u5355\u7247\u673a\u6570\u636e\u7c7b\u578b\u7684\u5177\u4f53\u5b9a\u4e49\u53ca\u5e94\u7528\"<\/p>\n

\n\t\u56fe4\uff0d1\u3000\u7b2c4\u8bfe\u5b9e\u9a8c\u7528\u7535\u8def<\/u><\/p>\n

\n\t\u6211\u4eec\u628a\u8fd9\u4e2a\u9879\u76ee\u79f0\u4e3aTwOLED<\/u>\uff0c\u5b9e\u9a8c\u7a0b\u5e8f\u5982\u4e0b\uff1a<\/p>\n

\n\t#include\/\/\u9884\u5904\u7406\u547d\u4ee4 void mai<\/u>n\uff08void\uff09 \/\/\u4e3b\u51fd\u6570\u540d<\/p>\n

\n\t{<\/p>\n

\n\tunsigned int a; \/\/\u5b9a\u4e49\u53d8\u91cfa\u4e3aunsigned int\u7c7b\u578b<\/p>\n

\n\tunsigned char b; \/\/\u5b9a\u4e49\u53d8\u91cfb\u4e3aunsigned char\u7c7b\u578b<\/p>\n

\n\tdo<\/p>\n

\n\t{ \/\/do while\u7ec4\u6210\u5faa\u73af<\/p>\n

\n\tfor \uff08a=0; a\u300a65535; a++\uff09<\/p>\n

\n\tP1_0 = 0; \/\/65535\u6b21\u8bbeP1.0\u53e3\u4e3a\u4f4e\u7535\u5e73\uff0c\u70b9\u4eaeLED<\/p>\n

\n\tP1_0 = 1; \/\/\u8bbeP1.0\u53e3\u4e3a\u9ad8\u7535\u5e73\uff0c\u7184\u706dLED<\/p>\n

\n\tfor \uff08a=0; a\u300a30000; a++\uff09; \/\/\u7a7a\u5faa\u73af<\/p>\n

\n\tfor \uff08b=0; b\u300a255; b++\uff09<\/p>\n

\n\tP1_1 = 0; \/\/255\u6b21\u8bbeP1.1\u53e3\u4e3a\u4f4e\u7535\u5e73\uff0c\u70b9\u4eaeLED<\/p>\n

\n\tP1_1 = 1; \/\/\u8bbeP1.1\u53e3\u4e3a\u9ad8\u7535\u5e73\uff0c\u7184\u706dLED<\/p>\n

\n\tfor \uff08a=0; a\u300a30000; a++\uff09; \/\/\u7a7a\u5faa\u73af<\/p>\n

\n\t}<\/p>\n

\n\twhile\uff081\uff09;<\/p>\n

\n\t}<\/p>\n

\n\t\u540c\u6837\u7f16\u8bd1\u70e7\u5199\uff0c\u4e0a\u7535\u8fd0\u884c\u60a8\u5c31\u53ef\u4ee5\u770b\u5230\u7ed3\u679c\u4e86\u3002\u5f88\u660e\u663eD1\u70b9\u4eae\u7684\u65f6\u95f4\u957f\u4e8eD2\u70b9\u4eae\u7684\u65f6\u95f4\u3002\u7a0b\u5e8f\u4e2d\u7684\u5faa\u73af\u5ef6\u65f6\u65f6\u95f4\u5e76\u4e0d\u662f\u5f88\u597d\u786e\u5b9a\uff0c\u5e76\u4e0d\u592a\u9002\u5408\u8981\u6c42\u7cbe\u786e\u5ef6\u65f6\u7684\u573a\u5408\uff0c\u5173\u4e8e\u8fd9\u65b9\u9762\u6211\u4eec\u4ee5\u540e\u4e5f\u4f1a\u505a\u8ba8\u8bba\u3002\u8fd9\u91cc\u5fc5\u987b\u8981\u8bb2\u7684\u662f\uff0c\u5f53\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cf\u4e3a\u7279\u5b9a\u7684\u6570\u636e\u7c7b\u578b\u65f6\uff0c\u5728\u7a0b\u5e8f\u4f7f\u7528\u8be5\u53d8\u91cf\u4e0d\u5e94\u4f7f\u5b83\u7684\u503c\u8d85\u8fc7\u6570\u636e\u7c7b\u578b\u7684\u503c\u57df\u3002\u5982\u672c\u4f8b\u4e2d\u7684\u53d8\u91cfb\u4e0d\u80fd\u8d4b\u8d85\u51fa0\uff5e255\u7684\u503c\uff0c\u5982for \uff08b=0; b\u300a255; b++\uff09\u6539\u4e3afor \uff08b=0; b\u300a256; b++\uff09\uff0c\u7f16\u8bd1\u662f\u53ef\u4ee5\u901a\u8fc7\u7684\uff0c\u4f46\u8fd0\u884c\u65f6\u5c31\u4f1a\u6709\u95ee\u9898\u51fa\u73b0\uff0c\u5c31\u662f\u8bf4b\u7684\u503c\u6c38\u8fdc\u90fd\u662f\u5c0f\u4e8e256\u7684\uff0c\u6240\u4ee5\u65e0\u6cd5\u8df3\u51fa\u5faa\u73af\u6267\u884c\u4e0b\u4e00\u53e5P1_1 = 1\uff0c\u4ece\u800c\u9020\u6210\u6b7b\u5faa\u73af\u3002\u540c\u7406a\u7684\u503c\u4e0d\u5e94\u8d85\u51fa0\uff5e65535\u3002\u5927\u5bb6\u53ef\u4ee5\u70e7\u7247\u770b\u770b\u5b9e\u9a8c\u7684\u8fd0\u884c\u7ed3\u679c\uff0c\u540c\u6837\u8f6f\u4ef6\u4eff\u771f\u4e5f\u662f\u53ef\u4ee5\u770b\u5230\u7ed3\u679c\u7684\u3002<\/p>\n

\n\t3\uff0elong\u957f\u6574\u578b<\/p>\n

\n\tlong\u957f\u6574\u578b\u957f\u5ea6\u4e3a\u56db\u4e2a\u5b57\u8282\uff0c\u7528\u4e8e\u5b58\u653e\u4e00\u4e2a\u56db\u5b57\u8282\u6570\u636e\u3002\u5206\u6709\u7b26\u53f7long\u957f\u6574\u578bsigned long\u548c\u65e0\u7b26\u53f7\u957f\u6574\u578bunsigned long\uff0c\u9ed8\u8ba4\u503c\u4e3asigned long\u7c7b\u578b\u3002signed int\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u662f-2147483648\uff5e+2147483647\uff0c\u5b57\u8282\u4e2d\u6700\u9ad8\u4f4d\u8868\u793a\u6570\u636e\u7684\u7b26\u53f7\uff0c“0”\u8868\u793a\u6b63\u6570\uff0c“1”\u8868\u793a\u8d1f\u6570\u3002unsigned long\u8868\u793a\u7684\u6570\u503c\u8303\u56f4\u662f0\uff5e4294967295\u3002<\/p>\n

\n\t4\uff0efloat\u6d6e\u70b9\u578b<\/p>\n

\n\tfloat\u6d6e\u70b9\u578b\u5728\u5341\u8fdb\u5236\u4e2d\u5177\u67097\u4f4d\u6709\u6548\u6570\u5b57\uff0c\u662f\u7b26\u5408IEEE\uff0d754\u6807\u51c6\u7684\u5355\u7cbe\u5ea6\u6d6e\u70b9\u578b\u6570\u636e\uff0c\u5360\u7528\u56db\u4e2a\u5b57\u8282\u3002\u56e0\u6d6e\u70b9\u6570\u7684\u7ed3\u6784\u8f83\u590d\u6742\u5728\u4ee5\u540e\u7684\u7ae0\u8282\u4e2d\u518d\u505a\u8be6\u7ec6\u7684\u8ba8\u8bba\u3002<\/p>\n

\n\t5\uff0e*\u3000\u6307\u9488\u578b<\/p>\n

\n\t\u6307\u9488\u578b\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u53d8\u91cf\uff0c\u5728\u8fd9\u4e2a\u53d8\u91cf\u4e2d\u5b58\u653e\u7684\u6307\u5411\u53e6\u4e00\u4e2a\u6570\u636e\u7684\u5730\u5740\u3002\u8fd9\u4e2a\u6307\u9488\u53d8\u91cf\u8981\u5360\u636e\u4e00\u5b9a\u7684\u5185\u5b58\u5355\u5143\uff0c\u5bf9\u4e0d\u540c\u7684\u5904\u7406\u5668\u957f\u5ea6\u4e5f\u4e0d\u5c3d\u76f8\u540c\uff0c\u5728C51\u4e2d\u5b83\u7684\u957f\u5ea6\u4e00\u822c\u4e3a1\uff5e3\u4e2a\u5b57\u8282\u3002\u6307\u9488\u53d8\u91cf\u4e5f\u5177\u6709\u7c7b\u578b\uff0c\u5728\u4ee5\u540e\u7684\u8bfe\u7a0b\u4e2d\u6709\u4e13\u95e8\u4e00\u8bfe\u505a\u63a2\u8ba8\uff0c\u8fd9\u91cc\u5c31\u4e0d\u591a\u8bf4\u4e86\u3002<\/p>\n

\n\t6\uff0e bit\u4f4d\u6807\u91cf<\/p>\n

\n\tbit\u4f4d\u6807\u91cf\u662fC51\u7f16\u8bd1\u5668\u7684\u4e00\u79cd\u6269\u5145\u6570\u636e\u7c7b\u578b\uff0c\u5229\u7528\u5b83\u53ef\u5b9a\u4e49\u4e00\u4e2a\u4f4d\u6807\u91cf\uff0c\u4f46\u4e0d\u80fd\u5b9a\u4e49\u4f4d\u6307\u9488\uff0c\u4e5f\u4e0d\u80fd\u5b9a\u4e49\u4f4d\u6570\u7ec4\u3002\u5b83\u7684\u503c\u662f\u4e00\u4e2a\u4e8c\u8fdb\u5236\u4f4d\uff0c\u4e0d\u662f0\u5c31\u662f1\uff0c\u7c7b\u4f3c\u4e00\u4e9b\u9ad8\u7ea7\u8bed\u8a00\u4e2d\u7684Boolean\u7c7b\u578b\u4e2d\u7684True\u548cFalse\u3002<\/p>\n

\n\t7\uff0e sfr\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668<\/u><\/p>\n

\n\tsfr\u4e5f\u662f\u4e00\u79cd\u6269\u5145\u6570\u636e\u7c7b\u578b\uff0c\u70b9\u7528\u4e00\u4e2a\u5185\u5b58\u5355\u5143\uff0c\u503c\u57df\u4e3a0\uff5e255\u3002\u5229\u7528\u5b83\u53ef\u4ee5\u8bbf\u95ee51\u5355\u7247\u673a\u5185\u90e8\u7684\u6240\u6709\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u3002\u5982\u7528sfr P1 = 0x90\u8fd9\u4e00\u53e5\u5b9aP1\u4e3aP1\u7aef\u53e3\u5728\u7247\u5185\u7684\u5bc4\u5b58\u5668\uff0c\u5728\u540e\u9762\u7684\u8bed\u53e5\u4e2d\u6211\u4eec\u7528\u4ee5\u7528P1 = 255\uff08\u5bf9P1\u7aef\u53e3\u7684\u6240\u6709\u5f15\u811a\u7f6e\u9ad8\u7535\u5e73\uff09\u4e4b\u7c7b\u7684\u8bed\u53e5\u6765\u64cd\u4f5c\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u3002<\/p>\n

\n\t\uff0aAT89C51\u7684\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u8868\u8bf7\u770b\u9644\u5f55\u4e8c<\/p>\n

\n\t8\uff0esfr16 16\u4f4d\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668<\/p>\n

\n\tsfr16\u5360\u7528\u4e24\u4e2a\u5185\u5b58\u5355\u5143\uff0c\u503c\u57df\u4e3a0\uff5e65535\u3002sfr16\u548csfr\u4e00\u6837\u7528\u4e8e\u64cd\u4f5c\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\uff0c\u6240\u4e0d\u540c\u7684\u662f\u5b83\u7528\u4e8e\u64cd\u4f5c\u5360\u4e24\u4e2a\u5b57\u8282\u7684\u5bc4\u5b58\u5668\uff0c\u597d\u5b9a\u65f6\u5668T0\u548cT1\u3002<\/p>\n

\n\t9\uff0esbit\u53ef\u5f55\u5740\u4f4d<\/p>\n

\n\tsbit\u540c\u4f4d\u662fC51\u4e2d\u7684\u4e00\u79cd\u6269\u5145\u6570\u636e\u7c7b\u578b\uff0c\u5229\u7528\u5b83\u53ef\u4ee5\u8bbf\u95ee\u82af\u7247\u5185\u90e8\u7684RAM<\/u>\u4e2d\u7684\u53ef\u5bfb\u5740\u4f4d\u6216\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u4e2d\u7684\u53ef\u5bfb\u5740\u4f4d\u3002\u5982\u5148\u524d\u6211\u4eec\u5b9a\u4e49\u4e86<\/p>\n

\n\tsfr P1 = 0x90; \/\/\u56e0P1\u7aef\u53e3\u7684\u5bc4\u5b58\u5668\u662f\u53ef\u4f4d\u5bfb\u5740\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49<\/p>\n

\n\tsbit P1_1 = P1\uff3e1;\u3000\/\/P1_1\u4e3aP1\u4e2d\u7684P1.1\u5f15\u811a<\/p>\n

\n\t\/\/\u540c\u6837\u6211\u4eec\u53ef\u4ee5\u7528P1.1\u7684\u5730\u5740\u53bb\u5199\uff0c\u5982sbit P1_1 = 0x91;<\/p>\n

\n\t\u8fd9\u6837\u6211\u4eec\u5728\u4ee5\u540e\u7684\u7a0b\u5e8f\u8bed\u53e5\u4e2d\u5c31\u53ef\u4ee5\u7528P1_1\u6765\u5bf9P1.1\u5f15\u811a\u8fdb\u884c\u8bfb\u5199\u64cd\u4f5c\u4e86\u3002\u901a\u5e38\u8fd9\u4e9b\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u7cfb\u7edf\u63d0\u4f9b\u7684\u9884\u5904\u7406\u6587\u4ef6\uff0c\u91cc\u9762\u5df2\u5b9a\u4e49\u597d\u5404\u7279\u6b8a\u529f\u80fd\u5bc4\u5b58\u5668\u7684\u7b80\u5355\u540d\u5b57\uff0c\u76f4\u63a5\u5f15\u7528\u53ef\u4ee5\u7701\u53bb\u4e00\u70b9\u65f6\u95f4\uff0c\u6211\u81ea\u5df1\u662f\u4e00\u76f4\u7528\u7684\u3002\u5f53\u7136\u60a8\u4e5f\u53ef\u4ee5\u81ea\u5df1\u5199\u81ea\u5df1\u7684\u5b9a\u4e49\u6587\u4ef6\uff0c\u7528\u60a8\u8ba4\u4e3a\u597d\u8bb0\u7684\u540d\u5b57\u3002<\/p>\n

\n\t\u5173\u4e8e\u6570\u636e\u7c7b\u578b\u8f6c\u6362\u7b49\u76f8\u5173\u64cd\u4f5c\u5728\u540e\u9762\u7684\u8bfe\u7a0b\u6216\u7a0b\u5e8f\u5b9e\u4f8b\u4e2d\u5c06\u6709\u6240\u63d0\u53ca\u3002\u5927\u5bb6\u53ef\u4ee5\u7528\u6240\u8bb2\u5230\u7684\u6570\u636e\u7c7b\u578b\u6539\u5199\u4e00\u4e0b\u8fd9\u8bfe\u7684\u5b9e\u4f8b\u7a0b\u5e8f\uff0c\u52a0\u6df1\u5bf9\u5404\u7c7b\u578b\u7684\u8ba4\u8bc6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5148\u6765\u7b80\u5355\u8bf4\u8bf4C\u8bed\u8a00\u7684\u6807\u8bc6\u7b26\u548c\u5173\u952e\u5b57\u3002\u6807\u8bc6\u7b26\u662f\u7528\u6765\u6807\u8bc6\u6e90\u7a0b\u5e8f\u4e2d\u67d0\u4e2a\u5bf9\u8c61\u7684\u540d\u5b57\u7684\uff0c\u8fd9\u4e9b\u5bf9\u8c61\u53ef\u4ee5\u662f\u8bed\u53e5\u3001\u6570\u636e\u7c7b\u578b\u3001\u51fd\u6570\u3001\u53d8\u91cf\u3001\u6570\u7ec4\u7b49\u7b49\u3002C\u8bed\u8a00\u662f\u5927\u5c0f\u5b57\u654f\u611f\u7684\u4e00\u79cd\u9ad8\u7ea7\u8bed\u8a00\uff0c<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2336"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2336"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2336\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2336"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}