{"id":15996,"date":"2014-04-11T21:00:44","date_gmt":"2014-04-11T12:00:44","guid":{"rendered":"http:\/\/www.sssg.org\/blogs\/hiro345\/?p=15996"},"modified":"2014-04-13T15:15:12","modified_gmt":"2014-04-13T06:15:12","slug":"mplab-x%e3%82%92%e4%bd%bf%e3%81%86","status":"publish","type":"post","link":"https:\/\/www.hiro345.net\/blogs\/hiro345\/archives\/15996.html","title":{"rendered":"MPLAB X\u3092\u4f7f\u3046"},"content":{"rendered":"<p>PIC\u306e\u958b\u767a\u3092\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001\u7d71\u5408\u958b\u767a\u74b0\u5883\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306fMPLAB X\u3092\u4f7f\u3044\u307e\u3059\u3002Microchip\u304c\u7121\u511f\u3067\u63d0\u4f9b\u3092\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<!--more--><br \/>\n\u300c<a href=\"https:\/\/www.microchip.com\/pagehandler\/en-us\/family\/mplabx\/\">MPLABX | Microchip Technology Inc.<\/a>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3092\u3057\u3066\u3001\u5fc5\u8981\u306a\u3082\u306e\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3057\u3087\u3046\u3002\u30b5\u30a4\u30c8\u3092\u65e5\u672c\u8a9e\u7248\u306b\u3059\u308b\u3068\u3001\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u30a2\u30d7\u30ea\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u53e4\u304f\u306a\u308b\u3088\u3046\u3067\u3059\u3002\u597d\u304d\u306a\u65b9\u3067\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308c\u3070\u3044\u3044\u3067\u3057\u3087\u3046\u3002PIC24FJ64GB002\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001MPLAB\u00ae X IDE v2.05 \u3068 MPLAB\u00ae XC16 Compiler v1.21 \u3068\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u81ea\u4f53\u306f\u96e3\u3057\u304f\u306a\u3044\u306f\u305a\u3067\u3059\u3002\u4e21\u65b9\u3068\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u3001\u8d77\u52d5\u3057\u3066\u30e1\u30cb\u30e5\u30fc\u304b\u3089 \u30d5\u30a1\u30a4\u30eb\u2192\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u3068\u3057\u3066\u3001\u65b0\u898f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u30a6\u30a3\u30b6\u30fc\u30c9\u3067\u9806\u306b\u3001\u30c1\u30c3\u30d7\u306b\u300cPIC24FJ64GB002\u300d\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u306b\u300cPICKit3\u300d\u3001\u30b3\u30f3\u30d1\u30a4\u30e9\u306b\u300cXC16\u300d\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u306f\u81ea\u5206\u304c\u4f7f\u3063\u3066\u3044\u308b\u3082\u306e\u306b\u5408\u308f\u305b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>PICKit3\u304b\u3089\u96fb\u6e90\u4f9b\u7d66\u3092\u3059\u308b\u5834\u5408\u306f\u3001\u3067\u304d\u3042\u304c\u3063\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3067PICKit3\u306e\u8a2d\u5b9a\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u307e\u3059\u3002\u300cOption categories\u300d\u3067\u300cPower\u300d\u3092\u6307\u5b9a\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u300cPower target circuit from PICkit3\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3044\u308c\u3066\u304b\u3089\u3001Apply\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u5185\u306e\u300cSource Files\u300d\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001New \u2192 C source \u3092\u6307\u5b9a\u3059\u308b\u3068\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u3053\u304b\u3089 main.c \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\uff08\u300c<a href=\"https:\/\/code.google.com\/p\/ohwada\/source\/browse\/trunk\/PIC24FJ64GB002-LED\/main.c\">main.c &#8211; ohwada &#8211; \u5927\u548c\u7530\u306e\u500b\u4eba\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 &#8211; Google Project Hosting<\/a>\u300d\u3092\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002\uff09<\/p>\n<pre class=\"brush: c; gutter: true\">\r\n#include &quot;p24FJ64GB002.h&quot;\r\n#include &lt;ports.h&gt;\r\n#include &lt;stdlib.h&gt;\r\n\r\n#define CLOCK_FREQ 32000000UL\r\n#define LOOP_COUNT CLOCK_FREQ \/ 50000UL\r\n\r\n_CONFIG1(WDTPS_PS1 &amp; FWPSA_PR32 &amp; WINDIS_OFF &amp; FWDTEN_OFF &amp; ICS_PGx1 &amp; GWRP_OFF &amp; GCP_OFF &amp; JTAGEN_OFF)\r\n_CONFIG2(POSCMOD_HS &amp; I2C1SEL_PRI &amp; IOL1WAY_OFF &amp; OSCIOFNC_ON &amp; FCKSM_CSDCMD &amp; FNOSC_FRCPLL &amp; PLL96MHZ_ON &amp; PLLDIV_DIV2 &amp; IESO_OFF)\r\n_CONFIG3(WPFP_WPFP0 &amp; SOSCSEL_IO &amp; WUTSEL_LEG &amp; WPDIS_WPDIS &amp; WPCFG_WPCFGDIS &amp; WPEND_WPENDMEM)\r\n_CONFIG4(DSWDTPS_DSWDTPS3 &amp; DSWDTOSC_LPRC &amp; RTCOSC_SOSC &amp; DSBOREN_OFF &amp; DSWDTEN_OFF)\r\n\r\nvoid delay(WORD msec) {\r\n    DWORD cnt;\r\n    while (msec--) {\r\n        cnt = LOOP_COUNT;\r\n        while (cnt--) {\r\n            Nop();\r\n        }\r\n    }\r\n}\r\nint main() {\r\n    mPORTBOutputConfig(IOPORT_BIT_15);\r\n    while (1) {\r\n        mPORTBWrite(0); \/\/ on\r\n        delay(500);\r\n        mPORTBWrite(IOPORT_BIT_15); \/\/ off\r\n        delay(500);\r\n    }\r\n    return EXIT_SUCCESS;\r\n}\r\n<\/pre>\n<p>\u3053\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3001PIC24FJ64GB002 \u306e26pin(RB15)\u306bLED\u3092\u3064\u3051\u3066\u70b9\u6ec5\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30e1\u30cb\u30e5\u30fc\u306eRun\u304b\u3089Build Main Project\u3092\u6307\u5b9a\u3059\u308b\u3068XC16\u30b3\u30f3\u30d1\u30a4\u30e9\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3068\u5b9f\u884c\u7528\u30d5\u30a1\u30a4\u30eb\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002PICkit3\u7d4c\u7531\u3067PIC\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304d\u8fbc\u3080\u306b\u306f\u3001\u30e1\u30cb\u30e5\u30fc\u304b\u3089Run\u304b\u3089Run Main Project\u3068\u3057\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PIC\u306e\u958b\u767a\u3092\u3059\u308b\u306b\u3042\u305f\u3063\u3066\u3001\u7d71\u5408\u958b\u767a\u74b0\u5883\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u306fMPLAB X\u3092\u4f7f\u3044\u307e\u3059\u3002Microchip\u304c\u7121\u511f\u3067\u63d0\u4f9b\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1060,978,1061],"class_list":["post-15996","post","type-post","status-publish","format-standard","hentry","category-general","tag-mplab-x","tag-pic","tag-xc16"],"_links":{"self":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/15996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/comments?post=15996"}],"version-history":[{"count":2,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/15996\/revisions"}],"predecessor-version":[{"id":15998,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/posts\/15996\/revisions\/15998"}],"wp:attachment":[{"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/media?parent=15996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/categories?post=15996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hiro345.net\/blogs\/hiro345\/wp-json\/wp\/v2\/tags?post=15996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}