{"id":2569,"date":"2019-06-03T08:29:42","date_gmt":"2019-06-03T08:29:42","guid":{"rendered":""},"modified":"2019-06-03T16:30:06","modified_gmt":"2019-06-03T08:30:06","slug":"msp430%e5%8d%95%e7%89%87%e6%9c%ba%e7%9a%84%e4%b8%89%e7%a7%8d%e6%97%b6%e9%92%9f%e4%bf%a1%e5%8f%b7%e6%ba%90%e7%9a%84%e7%89%b9%e7%82%b9%e5%8f%8a%e5%ba%94%e7%94%a8%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2569","title":{"rendered":"MSP430\u5355\u7247\u673a\u7684\u4e09\u79cd\u65f6\u949f\u4fe1\u53f7\u6e90\u7684\u7279\u70b9\u53ca\u5e94\u7528\u4ecb\u7ecd"},"content":{"rendered":"

\n\t\u4e0e51\u3001AVR<\/u>\u7b49\u5355\u7247\u673a<\/u>\u4e0d\u540cmsp430<\/u>\u7684\u65f6\u949f<\/u>\u4fe1\u53f7\u6e90\u6709LFXT1\uff0cXT2\uff0cDCO\u4e09\u79cd\u3002<\/p>\n

\n\t1\u3001LFXT1\uff1a\u53ef\u63a5\u9ad8\u901f\u548c\u4f4e\u901f\u6676\u632f\uff0c\u5728\u4f4e\u901f\u6a21\u5f0f\u4e0b\uff0c\u5b83\u53ef\u4ee5\u5916\u63a532k\u7684\u6676\u632f\u800c\u4e0d\u9700\u8981\u8d1f\u8f7d\u7535\u5bb9<\/u>\uff0c\u8fd9\u79cd\u65b9\u5f0f\u8f83\u4e3a\u5e38\u89c1\u4e3b\u8981\u7528\u6765\u4e3aACLK\u63d0\u4f9b\u4f4e\u901f\u7684\u65f6\u949f\u4fe1\u53f7\uff0c\u4ee5\u4f9b\u4f4e\u901f\u5916\u8bbe\u4f7f\u7528\u3002<\/p>\n

\n\t <\/div>\n

\n\t2\u3001XT2\uff1a\u9ad8\u901f\u632f\u8361\u5668<\/u>\uff0c\u5b83\u53ef\u4ee5\u63a5\u4e00\u4e2a0.4~16M\u7684\u6676\u632f\uff0c\u5b83\u76f8\u5f53\u4e8e\u9ad8\u901f\u6a21\u5f0f\u4e0b\u7684LFXT1\u3002\u901a\u5e38\u5c06\u5b83\u914d\u7f6e\u6210\u4e00\u4e2a\u9ad8\u901f\u7684\u632f\u8361\u6e90\uff0c\u4e3aMCLK\u4f55SMCLK\u63d0\u4f9b\u9ad8\u901f\u65f6\u949f\u4fe1\u53f7\u3002<\/p>\n

\n\t3\u3001DCO\uff1a\u5185\u90e8\u6570\u5b57\u63a7\u5236\u632f\u8361\u5668\uff0c\u5b83\u7684\u9891\u7387\u53ef\u4ee5\u901a\u8fc7DCOCLK\u8fdb\u884c\u914d\u7f6e\u3002\u5728\u7cfb\u7edfPUC\u4e4b\u540e\uff0cDCOx=7\uff0cMODx=3\uff0c\u8868\u793a\u9009\u62e9\u4e86\u6700\u9ad8\u7684\u9891\u7387\u3002<\/p>\n

\n\t\"MSP430\u5355\u7247\u673a\u7684\u4e09\u79cd\u65f6\u949f\u4fe1\u53f7\u6e90\u7684\u7279\u70b9\u53ca\u5e94\u7528\u4ecb\u7ecd\"<\/p>\n

\n\t\u524d\u9762\u4ecb\u7ecd\u4e86MSP430\u4e2d\u6709\u4e09\u4e2a\u4e2a\u65f6\u949f\u4fe1\u53f7\u6e90\uff0cMSP430\u7684\u65f6\u949f\u4fe1\u53f7\u4e5f\u6709\u4e09\u79cd\u4e3b\u65f6\u949fMCLK\uff0c\u5b50\u7cfb\u7edf\u65f6\u949fSMCLK\uff0c\u8f85\u52a9\u65f6\u949fACLK\u3002<\/p>\n

\n\t\u5176\u4e2dMCLK\u662f\u7528\u7ed9\u7cfb\u7edf\u4f7f\u7528\u7684\uff0cSMCLK\u7528\u7ed9\u9ad8\u901f\u5916\u8bbe\u4f7f\u7528\u7684\uff0c\u800cACLK\u4e3b\u8981\u7528\u7ed9\u4f4e\u901f\u5916\u8bbe\u4f7f\u7528\u3002<\/p>\n

\n\t\u5728\u7cfb\u7edfPUC\u4e4b\u540e\uff0c\u9ed8\u8ba4SMCLK\u4e0eMCLK\u90fd\u4ee5DCO\u4f5c\u4e3a\u65f6\u949f\u6e90\uff0c\u9707\u8361\u9891\u7387\u57281.1M\u5de6\u53f3\uff0cACLK\u4ee5LFXT1\u4f5c\u4e3a\u65f6\u949f\u6e90\uff0c\u5de5\u4f5c\u5728LF\u6a21\u5f0f\u4e0b\u5185\u90e86pF\u7684\u8d1f\u8f7d\u7535\u5bb9\u3002<\/p>\n

\n\t\u4e00\u822c\u60c5\u51b5\u4e0b\u9009\u62e9XT2\u4f5c\u4e3a\u4e3b\u65f6\u949f\uff0c\u65f6\u949f\u6a21\u5757\u521d\u59cb\u5316\u7a0b\u5e8f\u5982\u4e0b\uff1a<\/p>\n

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

\n\t\/*------\u9009\u62e9\u7cfb\u7edf\u4e3b\u65f6\u949f\u4e3a8MHz-------*\/<\/p>\n

\n\tBCSCTL1&=~XT2OFF;\/\/\u6253\u5f00XT2\u9ad8\u9891\u6676\u4f53\u632f\u8361\u5668<\/p>\n

\n\tdo<\/p>\n

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

\n\tIFG1&=~OFIFG;\/\/\u6e05\u9664\u6676\u632f\u5931\u8d25\u6807\u5fd7<\/p>\n

\n\tfor\uff08i=0xFF;i\u300b0;i--\uff09;\/\/\u7b49\u5f858MHz\u6676\u4f53\u8d77\u632f<\/p>\n

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

\n\twhile\uff08\uff08IFG1&OFIFG\uff09\uff09;\/\/\u6676\u632f\u5931\u6548\u6807\u5fd7\u4ecd\u7136\u5b58\u5728\uff1f<\/p>\n

\n\tBCSCTL2|=SELM_2+SELS;\/\/\u4e3b\u65f6\u949f\u548c\u4ece\u65f6\u949f\u90fd\u9009\u62e9\u9ad8\u9891\u6676\u632f<\/p>\n

\n\t……………………………………………………\u3002<\/p>\n

\n\t\u6ce8\u610f\uff1aa.\u6700\u597d\u5c06IFG1&=~OFIFG;\u653e\u5165do –while\u5faa\u73af\u4e2d\uff0c\u6211\u8c03\u4e86\u597d\u4e00\u9635\u7a0b\u5e8f\uff0c\u53d1\u73b0IFG1\u4f3c\u4e4e\u7f6e\u4f4d\u4e4b<\/p>\n

\n\t\u540e\u4e0d\u80fd\u81ea\u52a8\u590d\u4f4d\u3002<\/p>\n

\n\tb.\u5728XT2\u51fa\u73b0\u9519\u8bef\u7684\u60c5\u51b5\u4e0b\u5c06XT2\u8bbe\u5b9a\u4e3aMCLK SMCLK\u7684\u65f6\u949f\u6e90\uff0c\u5355\u7247\u673a\u4f1a\u81ea\u52a8\u7684\u628a\u65f6\u949f\u6e90\u66f4\u6362<\/p>\n

\n\t\u4e3aDCO\u632f\u8361\u5668\u3002\u5f53\u65f6\u949f\u4fe1\u53f7\u4e22\u593150us\u65f6\uff0c\u632f\u8361\u5668\u5931\u6548\u3002\u5982\u679cMCLK\u4fe1\u53f7\u6765\u81eaLFXT1\u6216\u8005XT2\uff0c<\/p>\n

\n\t\u90a3\u4e48MSP430\u81ea\u52a8\u628aMCLK\u7684\u4fe1\u53f7\u5207\u6362\u4e3aDCO\uff0c\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u7a0b\u5e8f\u7ee7\u7eed\u8fd0\u884c\u3002MSP430\u4e0d\u5bf9\u4f4e\u9891<\/p>\n

\n\t\u6a21\u5f0f\u7684LFXT1\u8fdb\u884c\u76d1\u6d4b\u3002<\/p>\n

\n\tb.BCSCTL2=SELM_2+SELS;\u8bed\u53e5\u5fc5\u987b\u653e\u5728while\u4e4b\u540e\uff0c\u56e0\u4e3a\u5f53XT2\u6ca1\u6709\u8d77\u632f\u4e4b\u524d\uff0cXT2\u5904\u4e8e\u9519\u8bef<\/p>\n

\n\t\u9636\u6bb5\uff0c\u56e0\u6b64\u5728XT2\u6ca1\u6709\u8d77\u632f\u4e4b\u524d\u5c06\u5b83\u8bbe\u5b9a\u4e3a\u4e3b\u65f6\u949f\u4e0e\u5b50\u7cfb\u7edf\u65f6\u949f\u540e\uff0c\u5355\u7247\u673a\u4f1a\u81ea\u52a8\u7684\u5c06DCO<\/p>\n

\n\t\u8bbe\u5b9a\u4e3aSMCLK MCLK\u7684\u65f6\u949f\u6e90\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e0e51\u3001A VR \u7b49 \u5355\u7247\u673a \u4e0d\u540c msp430 \u7684 \u65f6\u949f \u4fe1\u53f7\u6e90\u6709LFXT1\uff0cXT2\uff0cDCO\u4e09\u79cd\u3002 1\u3001LFXT1\uff1a\u53ef\u63a5\u9ad8\u901f\u548c\u4f4e\u901f\u6676\u632f\uff0c\u5728\u4f4e\u901f\u6a21\u5f0f\u4e0b\uff0c\u5b83\u53ef\u4ee5\u5916\u63a532k\u7684\u6676\u632f\u800c\u4e0d\u9700\u8981\u8d1f\u8f7d \u7535\u5bb9 \uff0c\u8fd9\u79cd\u65b9\u5f0f\u8f83\u4e3a\u5e38\u89c1\u4e3b\u8981\u7528<\/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\/2569"}],"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=2569"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2569\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2569"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}