{"id":2624,"date":"2019-06-11T08:31:57","date_gmt":"2019-06-11T08:31:57","guid":{"rendered":""},"modified":"2019-06-11T16:32:16","modified_gmt":"2019-06-11T08:32:16","slug":"msp430%e7%b3%bb%e5%88%97%e5%8d%95%e7%89%87%e6%9c%ba%e7%9a%84%e6%97%b6%e9%92%9f%e9%97%ae%e9%a2%98%e5%88%86%e6%9e%90","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2624","title":{"rendered":"MSP430\u7cfb\u5217\u5355\u7247\u673a\u7684\u65f6\u949f\u95ee\u9898\u5206\u6790"},"content":{"rendered":"

\n\tMSP430<\/u>\u7684\u65f6\u949f<\/u>\u95ee\u9898\u4e00\u76f4\u662f\u6a21\u6a21\u7cca\u7cca\uff0c\u8001\u662f\u5fd8\u8bb0\uff0c\u4e8e\u662f\u51b3\u5b9a\u5199\u4e0b\u6b64\u6587\u5e2e\u52a9\u8bb0\u5fc6\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5747\u53c2\u8003\u7f51\u7edc\u8d44\u6599\uff0c\u4ec5\u4f9b\u53c2\u8003\u3002<\/p>\n

\n\t\u8be5MSP430\u7cfb\u5217\u5355\u7247\u673a<\/u>\u65f6\u949f\u6e90\u67093\u79cd\uff0c\u5206\u522b\u4e3a\uff1a<\/p>\n

\n\t <\/div>\n

\n\t1.LFXT1CLK\uff1a\u4f4e\u9891\/\u9ad8\u9891\u65f6\u949f\u6e90\uff0c\u53ef\u5916\u63a5\u6676\u4f53<\/u>\u632f\u8361\u5668<\/u>\uff0c\u7531\u4e8e\u5355\u7247\u673a\u5185\u90e8\u96c6\u6210\u53ef\u4f9b\u9009\u62e9\u7684\u7535\u5bb9<\/u>\uff0c\u5219\u65e0\u9700\u5916\u63a5\u4e24\u4e2a\u632f\u8361\u7535\u5bb9\u5668<\/u>\u3002\u8f83\u5e38\u4f7f\u7528\u7684\u6676\u632f<\/u>\u4e3a32768HZ\uff0c\u53ef\u9009\u6676\u632f\u8303\u56f4450KHZ-8MHZ\u3002\uff08\u5de5\u4f5c\u5728\u9ad8\u9891\u6a21\u5f0f\u4e0b\u65f6\uff0c\u9700\u5916\u63a5\u632f\u8361\u7535\u5bb9\uff09<\/p>\n

\n\t\"MSP430\u7cfb\u5217\u5355\u7247\u673a\u7684\u65f6\u949f\u95ee\u9898\u5206\u6790\"<\/p>\n

\n\t2.XT2CLK\uff1a\u9ad8\u9891\u65f6\u949f\u6e90\uff0c\u53ef\u5916\u63a5\u6676\u4f53\u632f\u8361\u5668\uff0c\u9700\u5916\u63a5\u8fde\u4e2a\u632f\u8361\u7535\u5bb9\u5668\u3002\u8f83\u5e38\u4f7f\u7528\u7684\u6676\u632f\u4e3a8MHZ\uff0c\u53ef\u9009\u6676\u632f\u8303\u56f4450KHZ-8MHZ\u3002<\/p>\n

\n\t3.DCOCLK\uff1a\u6570\u5b57\u53ef\u63a7\u5236\u7684RC\u632f\u8361\u5668\uff0c\u7ea6800KHZ\uff0c\u5b83\u7684\u9891\u7387\u968f\u4f9b\u7535\u7535\u538b\u548c\u6e29\u5ea6\u53d8\u5316\u800c\u5177\u6709\u4e00\u5b9a\u7684\u4e0d\u7a33\u5b9a\u6027\u3002MSP430\u53ef\u4ee5\u901a\u8fc7\u64cd\u4f5c\u63a7\u5236\u5bc4\u5b58\u5668<\/u>\u8f6f\u4ef6\u8c03\u8282\u6765\u589e\u5f3a\u632f\u8361\u9891\u7387\u7684\u7a33\u5b9a\u6027\u3002 \u5f53LFXT1\u548cXT2\u5931\u6548\u65f6\uff0cDCO\u632f\u8361\u5668\u4f1a\u81ea\u52a8\u88ab\u9009\u4f5cMCLK\u7684\u65f6\u949f\u6e90\u3002\u632f\u8361\u5668\u5931\u6548\u5f15\u8d77\u7684NMI<\/u>\u4e2d\u65ad\u8bf7\u6c42\u53ef\u4ee5\u5f97\u5230\u54cd\u5e94\uff0c\u751a\u81f3\u5728CPU<\/u>\u5173\u95ed\u7684\u60c5\u51b5\u4e0b\u4e5f\u53ef\u4ee5\u3002<\/p>\n

\n\t\u8be5\u7cfb\u5217\u5355\u7247\u673a\u63d0\u4f9b3\u4e2a\u65f6\u949f\u8f93\u51fa\uff0c\u5206\u522b\u4e3a\uff1a<\/p>\n

\n\t1.ACLK\uff08Auxiliary clolck\uff09\uff1a\u8f85\u52a9\u65f6\u949f\uff0c\u7531LFXT1CLK\u4fe1\u53f7\u7ecf1\u30012\u30014\u30018\u5206\u9891\u540e\u5f97\u5230\u3002ACLK\u53ef\u7531\u8f6f\u4ef6\u9009\u505a\u5404\u5916\u56f4\u6a21\u5757\u7684\u65f6\u949f\u4fe1\u53f7\uff0c\u4e00\u822c\u7528\u4e8e\u4f4e\u901f\u5916\u56f4\u6a21\u5757\u3002<\/p>\n

\n\t2.MCLK\uff08Mai<\/u>n clock\uff09\uff1a\u4e3b\u65f6\u949f\uff0c\u7531\u8f6f\u4ef6\u9009\u62e9\u6765\u81eaLFXT1CLK\u3001XT2CLK\u3001DCOCLK\uff0c\u7136\u540e\u7ecf\u8fc71\u30012\u30014\u30018\u5206\u9891\u5f97\u5230\u3002MCLK\u4e3b\u8981\u7528\u4e8eCPU\u548c\u7cfb\u7edf\u3002<\/p>\n

\n\t3.SMCLK\uff08Sub-Main clock\uff09\uff1a\u5b50\u7cfb\u7edf\u65f6\u949f\uff0c\u53ef\u7531\u8f6f\u4ef6\u9009\u62e9\u6765\u81eaLFXT1CLK\u548cDCOCLK\uff08\u5bf9\u4e8eMXP430X11X\u548cMSP430X12X\uff09\u6216\u8005XT2CLK\u548cDCOCLK\u7136\u540e\u7ecf\u8fc71\u30012\u30014\u30018\u5206\u9891\u5f97\u5230\u3002SMCLK\u4e3b\u8981\u7528\u4e8e\u9ad8\u901f\u5916\u56f4\u6a21\u5757\u3002<\/p>\n

\n\t\u65f6\u949f\u521d\u59cb\u5316\u4f8b\u7a0b\uff1a<\/p>\n

\n\tPUC\u4fe1\u53f7\u540eDCOCLK\u88ab\u81ea\u52a8\u9009\u4f5cMCLK\u65f6\u949f\u4fe1\u53f7\uff0c\u6839\u636e\u9700\u8981MCLK\u7684\u65f6\u949f\u6e90\u53ef\u4ee5\u53e6\u5916\u8bbe\u7f6e\u4e3aLFXT1\u6216\u8005XT2.\u987a\u5e8f\u5982\u4e0b\uff1a<\/p>\n

\n\ta\uff09\u590d\u4f4dOSCOFF<\/p>\n

\n\tb\uff09\u6e05\u9664OFIF<\/u>G<\/p>\n

\n\tc\uff09\u5ef6\u65f6\u7b49\u5f85\u81f3\u5c1150us<\/p>\n

\n\td\uff09\u518d\u68c0\u67e5OFIFG\uff0c\u5982\u679c\u7f6e\u4f4d\uff0c\u5219\u91cd\u590d3\uff0c4\u6b65\uff0c\u76f4\u5230OFIFG=0<\/p>\n

\n\tvoid Initi<\/u>al_Crystal\uff08void\uff09<\/p>\n

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

\n\tunsigned char i;<\/p>\n

\n\tWDTCTL=WDTPW+WDTHOLD;\/\/\u5173\u95ed\u770b\u95e8\u72d7<\/u><\/p>\n

\n\tBCSCTL1 &= ~\uff08XT2OFF + XTS\uff09;\/\/\u4f7f\u80fdXT2\uff0cLPXT1\u9009\u62e9\u4f4e\u9891<\/p>\n

\n\tBCSCTL2 = SELM_2 + DIVM_0 + SELS + DIVS_0;\/\/\u4e3b\u65f6\u949f\u9009\u62e9XT2\uff0c\u5b50\u7cfb\u7edf\u65f6\u949f\u9009\u62e9XT2<\/p>\n

\n\tdo<\/p>\n

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

\n\tIFG1&=~OFIFG;<\/p>\n

\n\tfor\uff08i=0xff;i\u300b0;i--\uff09;<\/p>\n

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

\n\twhile\uff08\uff08IFG1&OFIFG\uff09\uff01=0\uff09;<\/p>\n

\n\t}<\/p>\n","protected":false},"excerpt":{"rendered":"

MSP430 \u7684 \u65f6\u949f \u95ee\u9898\u4e00\u76f4\u662f\u6a21\u6a21\u7cca\u7cca\uff0c\u8001\u662f\u5fd8\u8bb0\uff0c\u4e8e\u662f\u51b3\u5b9a\u5199\u4e0b\u6b64\u6587\u5e2e\u52a9\u8bb0\u5fc6\uff0c\u4ee5\u4e0b\u5185\u5bb9\u5747\u53c2\u8003\u7f51\u7edc\u8d44\u6599\uff0c\u4ec5\u4f9b\u53c2\u8003\u3002 \u8be5MSP430\u7cfb\u5217 \u5355\u7247\u673a \u65f6\u949f\u6e90\u67093\u79cd\uff0c\u5206\u522b\u4e3a\uff1a 1.LFXT1CLK\uff1a\u4f4e\u9891\/\u9ad8\u9891\u65f6\u949f<\/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\/2624"}],"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=2624"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2624\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2624"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}