{"id":1064,"date":"2020-03-15T10:01:07","date_gmt":"2020-03-15T10:01:07","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=1064"},"modified":"2022-02-18T15:37:48","modified_gmt":"2022-02-18T15:37:48","slug":"using-code-configurator","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/mplab-x\/mcc\/using-code-configurator","title":{"rendered":".Using Code Configurator"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.microchip.com\/mplab\/mplab-code-configurator\" target=\"_blank\">Microchip videos are here<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To view the Code Configurator, press the blue &#8216;MCC&#8217; button on the toolbar.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Project resources panel &#8211; shows all of the existing things being setup by the code configurator.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Adding a new peripheral to code configurator<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">In the \u2018Device Resources\u2019 panel double click the peripheral to all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A page for it opens and it is added to the \u2018Project Resources\u2019 panel.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Generating The Code<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">&#8216;Project Resources&#8217; panel &gt; &#8216;Generate&#8217; button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you get a &#8220;Configuration has warnings&#8221; message you can see them in the &#8216;Notifications [MCC]&#8217; panel of the output window.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once generated, when you view your project files you will have:<\/p>\n\n\n<p>main.c<\/p>\n<p style=\"padding-left: 40px;\">Has the main() function with calls to the necessary initialise code it has generated.<\/p>\n<p style=\"padding-left: 40px;\">If you have your own main() function then rename it to say ap_main() and call it from here.<\/p>\n<p>MCC Generated Files<\/p>\n<p style=\"padding-left: 40px;\">These folders will have been added to your &#8216;Source Files&#8217; and &#8216;Header Files&#8217; folders.&nbsp; In here you will find all the code the code configurator has created as well as example functions you can call to use the peripherals you&#8217;ve setup.<\/p>\n\n\n<h4 class=\"wp-block-heading\">Using the MCC peripherals in your code<\/h4>\n\n\n\n<h5 class=\"wp-block-heading\">Include the header files you want to use from the &#8220;MCC Generated Files&#8221; folder<\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">e.g.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include \"mcc_generated_files\/adc.h\"<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Use the code<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Look in the .c files &#8220;Source Files&#8221; > &#8220;MCC Generated Files&#8221; for functions you can call or use their code as examples and just copy and use what you need in your own code<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The&nbsp;Microchip videos are here To view the Code Configurator, press the blue &#8216;MCC&#8217; button on the toolbar. Project resources panel &#8211; shows all of the existing things being setup by the code configurator. Adding a new peripheral to code configurator In the \u2018Device Resources\u2019 panel double click the peripheral to all. A page for it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[88],"tags":[],"class_list":["post-1064","post","type-post","status-publish","format-standard","hentry","category-mcc"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1064","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=1064"}],"version-history":[{"count":7,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1064\/revisions"}],"predecessor-version":[{"id":1191,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/1064\/revisions\/1191"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=1064"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=1064"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=1064"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}