{"id":643,"date":"2012-11-29T09:48:00","date_gmt":"2012-11-29T09:48:00","guid":{"rendered":"http:\/\/Ascenten.net\/tech-notes\/?p=643"},"modified":"2018-10-26T12:23:03","modified_gmt":"2018-10-26T12:23:03","slug":"selecting-an-mcu","status":"publish","type":"post","link":"https:\/\/ascenten.net\/tech-notes\/selecting-an-mcu\/","title":{"rendered":"Selecting an MCU"},"content":{"rendered":"<p>A\u00a0micro controller\u00a0is primarily a computing device that provides internal data and program memory and a high level of input and output (I\/O) peripheral options. Using such processing technology helps to optimize the number of external peripherals that may be required for a particular system, project or application. Moreover, this also allows enhancing the scope for external interfacing to switches, motors and additional input \/ output devices.<\/p>\n<p>&nbsp;<\/p>\n<p>There exists no cut and dried rule to decide if a particular microcontroller unit (MCU) befits for a given project or application requirement. Since the success or failure of your project hinges on how well you are selecting an MCU, this decision needs an evaluation approach that takes into account several key aspects. To begin with, one is required to assign a proper objective to MCU selection process \u2013 whether it is <span class=\"GINGER_SOFATWARE_correct\">optimizing<\/span> BOM, enhancing application \/ project reliability or a need for rigorous performance <span class=\"GINGER_SOFATWARE_correct\">for<\/span> R&amp;D engineering activity. Ideally an MCU that delivers better performance, reliability, compatibility and conformance to standards and other requirements should be given priority. Lastly, one should also look at what kind of ecosystem exists for a particular MCU such as availability of development tools, manufacturer support etc. Also as MCUs continue to add new capabilities, it is becoming all the more difficult to decide which MCU fairly meets all key requirements for a project or an application. When choosing an MCU, a balanced approach keeping in mind the following aspects will prove useful.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Energy Consumption<\/strong><\/h2>\n<p>The energy consumption of a processor depends on many factors such as the target technology (lithography size, process flavor, threshold voltages), the library of standard cells used to implement the core and the execution activity imposed on the processor during power simulation. From 90 <span class=\"GINGER_SOFATWARE_correct\">nm<\/span> and below as technology is shrinking, the static power consumption represents a significant part of the total consumption and has become more and more comparable to the dynamic power consumption. So both Static and dynamic power consumptions should be checked while selecting <span class=\"GINGER_SOFATWARE_correct\">a<\/span> MCU. If the application is battery operated then this criteria must be kept in mind.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Speed<\/strong><\/h2>\n<p>Millions of instructions per second (MIPS) indicates the speed of a <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span>. Higher the frequencies of operation of <span class=\"GINGER_SOFATWARE_correct\">microcontroller<\/span>, higher are the area and power dissipation. A <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> selected should have the best trade-off between frequency and area \/ power.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Area<\/strong><\/h2>\n<p>The MCU area depends a lot on the configuration considered. As a result, in order to compare the area of two MCUs, their configurations have to be purely the same. \u00a0Areas of MCUs are specified either in terms of <span class=\"GINGER_SOFATWARE_correct\">number<\/span> of (equivalent) gates or by giving a silicon area in mm<sup>2<\/sup>. For the same core area we get different gate counts depending on the gate selected from a specific library. Thus <span class=\"GINGER_SOFATWARE_correct\">gate count<\/span> is uncertain. Silicon area on <span class=\"GINGER_SOFATWARE_correct\">other hand<\/span> depends on many parameters: the lithography size and the process, the standard <span class=\"GINGER_SOFATWARE_correct\">cells<\/span> library used, the PVT conditions, the synthesis constraints (frequency, I\/O delays, max cap, rest of <span class=\"GINGER_SOFATWARE_correct\">SoC<\/span> constraints, <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">etc<\/span>\u2026), and if the result is pre or post place and route. Taking into account all these parameters, it seems impossible to compare area figures from different providers measured in exactly the same conditions. As a conclusion, a system designer should consider an MCU with lower <span class=\"GINGER_SOFATWARE_correct\">nm<\/span> technology, offering higher gate counts and logic.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Computing Power\/Code Density<\/strong><\/h2>\n<p>While evaluating the code density or the processing power benchmark plays an important role. Different synthetic benchmarks corresponding to different execution characteristics are available, for instance, Dhrystone: integer performance; LINPACK: <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">vectorizable<\/span> computations; and Whetstone: floating point intensive applications. To improve the limited capabilities of synthetic benchmarks, standardized sets of real application programs have been collected into six <span class=\"GINGER_SOFATWARE_correct\">application<\/span>-program benchmark suites specific to the area of the embedded market. The categories are Automotive and Industrial Control, Consumer Devices, Office Automation, Networking, Security, and Telecommunications. All the programs are available as standard C source code for being portable. In summary, select your benchmark carefully according to your application domain.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Architecture<\/strong><\/h2>\n<p>The &#8220;architecture&#8221; of a <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> refers to the philosophy of the internal implementation. It includes details like how many registers, whether code can execute out of data memory, whether the peripherals are treated like memory, registers, or something else, whether there is a stack and how it works, and so on. Below are the architectures that should be considered while selecting an MCU.<\/p>\n<p><span class=\"GINGER_SOFATWARE_correct\">1)<\/span>CISC, <span class=\"GINGER_SOFATWARE_correct\">2)<\/span>RISC, <span class=\"GINGER_SOFATWARE_correct\">3)<\/span>Harvard Architecture, <span class=\"GINGER_SOFATWARE_correct\">4)<\/span>Von Neuman Architecture, <span class=\"GINGER_SOFATWARE_correct\">5)<\/span>Accumulator based, <span class=\"GINGER_SOFATWARE_correct\">6)<\/span>Load\/Store<\/p>\n<p>A RISC processor can handle simple math functions much faster, but a CISC processor will handle complicated functions faster because it can do them all at once instead of the several processing commands that a RISC processor would have to take to complete the same function.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>I\/<span class=\"GINGER_SOFATWARE_correct\">Os<\/span><\/strong><\/h2>\n<p>The number of free pins <span class=\"GINGER_SOFATWARE_correct\">decide<\/span> how many different devices you can connect to the <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span>. There are two basic pin types: digital input\/output (I\/O) and analog input\/output (I\/O). Other pin types include <span class=\"GINGER_SOFATWARE_correct\">peripherals<\/span> input\/output (I\/O) like UART, SPI I2C etc. <span class=\"GINGER_SOFATWARE_correct\">and<\/span> also Power &amp; ground (GND). A <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> selected should have equivalent or adequate pin count, required for Embedded System.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Built-in Peripherals and Resources<\/strong><\/h2>\n<p>The CPU is only a small part of the MCU needs and choosing your product based on which peripherals and resources you want is probably a way one should go for. Various built in peripherals and resources like ADC\/DAC, UART\/USART, Ethernet, CAN, USB, SPI, I2C, Timers, watchdog system, floating point arithmetic units, multiply-accumulate (MAC) etc. <span class=\"GINGER_SOFATWARE_correct\">are<\/span> now available in <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontrollers<\/span>. According to the requirements, one should choose the right mix of them.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Memory<\/strong><\/h2>\n<p>Memory devices include random access memory (RAM), read-only memory (ROM). A <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> with larger RAM and <span class=\"GINGER_SOFATWARE_correct\">reprogrammable<\/span> ROM is desired.<\/p>\n<p><em>RAM<\/em>: The selected <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> for an Embedded System should have enough internal RAM required for data memory. Some algorithms require substantial RAM to be implemented in a straightforward manner, and it may be worthwhile looking for a micro with a lot of RAM<\/p>\n<p><em>ROM<\/em>: The abilities to retain data after removing power and rapidly reprogram products have driven the move to flash. The size of Flash memory depends on the size of object file generated by the assembler\/compiler. The size of Flash program memory is an important factor when the user has decided to use internal program memory. The user must have to keep in mind to keep few % (<span class=\"GINGER_SOFATWARE_correct\">dependent<\/span> on application nature) of free space in program memory for future requirements.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>OS Requirements<\/strong><\/h2>\n<p>Moving up to applications that require an OS, real-time or otherwise, in some ways reduces the complexity of the decision. You automatically disqualify a large portion of the available chips. Going with a generic OS like Linux or Android might very well move your decision tree into cost versus performance. The amount of expertise required at this level is likely to add a lot more engineering and less preference into the design choice than is possible in lower-end applications.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Languages Known<\/strong><\/h2>\n<p>The most general division is between assembly and high level language programming. Assembly language is often used where code minimization or speed maximization is critical. High level language programming (often C) requires the use of a compiler to translate the more readable and structured program constructs produced by an engineer into <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> readable form C programs allow <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">reusability<\/span>, and advantages in debugging your system. Consider choosing a <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> with\u00a0a large user community and existing free libraries.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Development and Debug Tools<\/strong><\/h2>\n<p>Whether you program bare metal or are using an <a href=\"http:\/\/www.arm.com\/community\/partners\/company_list\/rw\/ProductTypes\/15\">RTOS<\/a>, you will be more than likely to use an <a href=\"http:\/\/www.arm.com\/community\/partners\/company_list\/rw\/ProductTypes\/10\/\">IDE<\/a>. A wide variety of options exist. These include: <em>Simulators, ROM Emulators, Development Boards and Emulators.<\/em><\/p>\n<p>The selection of a suitable development tool will be related to the available budget. Low complexity systems can be developed using low cost development boards and assemblers; more complex tasks require an emulator of some form.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Cost, Product Availability and Supplier<\/strong><\/h2>\n<p>Cost is a major factor when targeting low budget applications. Select a <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> which is easily available and comparatively cheap, sufficing all specifications.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Third Party Support<\/strong><\/h2>\n<p>One of the most important, but least recognized factors in selecting a <span class=\"GINGER_SOFATWARE_noSuggestion GINGER_SOFATWARE_correct\">microcontroller<\/span> is the third party support available. <span class=\"GINGER_SOFATWARE_correct\">Number of open source<\/span> developers, experts, entrepreneurs, hobbyists keeps their work and product ideas on <span class=\"GINGER_SOFATWARE_correct\">internet<\/span>, which help many developers to start work in <span class=\"GINGER_SOFATWARE_correct\">right direction<\/span> and complete their design on the right schedule.<\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h2><strong>Deadlines<\/strong><\/h2>\n<p>Very short deadlines make allocation of time to learning a new architecture more difficult, or even impossible, to justify. In that case, you\u2019ll need to look at a part you\u2019ve used before, or something similar.<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>It is very easy to make a processor assessment that leads to a wrong conclusion, because at each step of the evaluation, there are many possibilities to compare data that were not measured under the same conditions. In conclusion, selecting the right MCU for your project is not an easy decision, as MCUs have become more complex devices since on-chip resources are getting added. Also as the trend is towards more on-chip integration of off-chip resources to reduce system costs, the decision will become increasingly complex with time. This application note is not intended to make the choice for the designer, but to serve as a thought-provoking guideline as to all the possible selection criteria that should be considered in this important decision process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A\u00a0micro controller\u00a0is primarily a computing device that provides internal data and program memory and a high level of input and output (I\/O) peripheral options. Using such processing technology helps to optimize the number of external peripherals that may be required for a particular system, project or application. Moreover, this also&#8230;<\/p>\n","protected":false},"author":1,"featured_media":901,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-643","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mansi"],"_links":{"self":[{"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/posts\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/comments?post=643"}],"version-history":[{"count":1,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/posts\/643\/revisions"}],"predecessor-version":[{"id":926,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/posts\/643\/revisions\/926"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/media\/901"}],"wp:attachment":[{"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/media?parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/categories?post=643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ascenten.net\/tech-notes\/wp-json\/wp\/v2\/tags?post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}