[{"data":1,"prerenderedAt":20},["ShallowReactive",2],{"page:\u002Fresource-library\u002Fselecting-a-microcontroller":3},{"path":4,"layout":5,"title":6,"description":7,"ogImage":8,"post":9,"html":19},"\u002Fresource-library\u002Fselecting-a-microcontroller","post","Selecting a microcontroller","For many simple projects, pick the microcontroller you already know. When that fails, weigh peripherals, pin and timer conflicts, power, cost, and tools.","\u002Fimages\u002Fresource-library\u002Fselecting-a-microcontroller\u002Fqfp-ic-on-blue-pcb-social.jpg",{"author":10,"published":11,"updated":12,"tags":13,"image":17,"imageAlt":18},"Jone Lay","2017-02-04",null,[14],{"name":15,"slug":16},"Electrical engineering","electrical-engineering","\u002Fimages\u002Fresource-library\u002Fselecting-a-microcontroller\u002Fqfp-ic-on-blue-pcb.webp","QFP integrated circuit on a blue PCB with fine-pitch traces","\u003Cp>These days an enormous number of projects involve programmable microcontrollers. At their most\n  basic level, microcontrollers are programmable digital \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FIntegrated_circuit\" target=\"_blank\" rel=\"noopener\">integrated\n  circuits\u003C\u002Fa> that can perform logical operations, have \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSemiconductor_memory\" target=\"_blank\"\n  rel=\"noopener\">memory\u003C\u002Fa>, and interface with the outside world. In most cases their connection to\n  the \"outside world\" is through traces on a \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FPrinted_circuit_board\" target=\"_blank\" rel=\"noopener\">PCB\u003C\u002Fa>\n  to other devices. Common microcontrollers range from tiny 8-bit packages with limited RAM and low\n  cost (such as the popular \u003Ca href=\"http:\u002F\u002Fwww.atmel.com\u002Fdevices\u002FATTINY85.aspx?\" target=\"_blank\"\n  rel=\"noopener\">ATtiny85\u003C\u002Fa>) to massive 32-bit devices with hundreds of pins and an impressive\n  range of peripherals (such as the also popular \u003Ca\n  href=\"http:\u002F\u002Fwww.st.com\u002Fweb\u002Fcatalog\u002Fmmc\u002FFM141\u002FSC1169\u002FSS1577\u002FLN11\" target=\"_blank\"\n  rel=\"noopener\">STM32F407\u003C\u002Fa>). For all of the projects that employ microcontrollers of some kind,\n  there is always the question of \"which one?\"\u003C\u002Fp>\n\u003Cp>There are many aspects of a design to consider when evaluating microcontrollers. What processing\n  speed and memory size is necessary to accomplish the goal? Are there hardware peripherals that are\n  needed for the project, such as specific communication interfaces or advanced features like \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDirect_memory_access\" target=\"_blank\" rel=\"noopener\">DMA\u003C\u002Fa>?\n  What are the requirements for physical size, power consumption, and component cost? What\n  development tools and software libraries are available? Do the developers involved have experience\n  with the development tools, and if not, what kind of learning curve will they face? What external\n  resources are available, such as third-party documentation or online communities? The \u003Ca\n  href=\"http:\u002F\u002Fwww.arduino.cc\u002F\" target=\"_blank\" rel=\"noopener\">Arduino\u003C\u002Fa> platform is wildly\n  popular in large part due to its active community and worldwide user base.\u003C\u002Fp>\n\u003Cp>Many projects have clear requirements for microcontroller peripherals. Perhaps a USB interface is\n  needed, and the device needs to mount as a \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FUSB_mass_storage_device_class\" target=\"_blank\"\n  rel=\"noopener\">mass storage device\u003C\u002Fa>. Maybe it needs an \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSerial_Peripheral_Interface_Bus\" target=\"_blank\"\n  rel=\"noopener\">SPI\u003C\u002Fa> or \u003Ca href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FI%C2%B2C\" target=\"_blank\"\n  rel=\"noopener\">I2C\u003C\u002Fa> interface for communicating with sensors, external flash, or other\n  microcontrollers. In projects where a large amount of external RAM is needed, a special hardware\n  interface may be required. In systems with audio, high quality \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDigital-to-analog_converter\" target=\"_blank\"\n  rel=\"noopener\">DAC\u003C\u002Fa> and \u003Ca href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAnalog-to-digital_converter\"\n  target=\"_blank\" rel=\"noopener\">ADC\u003C\u002Fa> peripherals may be useful, although similar functionality\n  might instead be implemented with digital audio interfaces such as I2S or S\u002FPDIF. A wise designer\n  will be careful when choosing a microcontroller that will employ many different peripherals. It’s\n  common for separate peripherals in a given microcontroller to share certain resources, such as\n  timers or physical IO pins. No one wants to spend hours or days working on a particular\n  microcontroller, and, after all that effort, find out that the intended configuration of pins and\n  peripherals creates showstopping resource conflicts!\u003C\u002Fp>\n\u003Cp>It can be difficult to evaluate all of these design features, let alone navigate the thousands of\n  microcontroller options readily available. For many simple projects, a good answer may be \"go with\n  what you know.\" At Boulder Engineering Studio, we sometimes have projects that involve building\n  only a few devices, such as scientific instruments for research. In these cases, if a\n  microcontroller that we have an existing familiarity with is a good fit for the project, we may be\n  able to save considerable development time by leveraging our past experience. The cost of\n  engineering time, when measured in hours or days saved, can dwarf the cost difference between\n  microcontrollers by orders of magnitude.\u003C\u002Fp>\n\u003Cp>In many other cases, we have projects that involve design for mass production. Anticipated build\n  volumes of thousands or millions of units are common for electronics manufacturing. In these\n  designs, optimizing for small improvements in cost can have enormous implications. However, the\n  evaluation of cost involves more than just the price of the microcontroller itself. Selecting a\n  microcontroller can have wide-ranging impacts that ripple into other elements of the product.\n  Imagine a hypothetical project, comparing the STM32F405 and the STM32F407. Although the 407 is\n  more expensive, it has an internal Ethernet controller. If paying slightly more for that part\n  means eliminating the need for an external Ethernet controller, the reduction in \u003Ca\n  href=\"http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBill_of_materials\" target=\"_blank\" rel=\"noopener\">BOM\u003C\u002Fa> size\n  and PCB area alone may ultimately result in savings. At very large volumes, the microcontroller\n  components might be purchased directly from the manufacturer, rather than through a distributor\n  like \u003Ca href=\"https:\u002F\u002Fwww.digikey.com\u002F\" target=\"_blank\" rel=\"noopener\">DigiKey\u003C\u002Fa> or \u003Ca\n  href=\"http:\u002F\u002Fwww.mouser.com\u002F\" target=\"_blank\" rel=\"noopener\">Mouser\u003C\u002Fa>. The price of a part will\n  vary with volume, and not necessarily at the same rate for each part. While one microcontroller\n  might be lower cost than another at quantity 1,000, the opposite might be true at quantity\n  10,000.\u003C\u002Fp>\n\u003Cp>One of the most exciting aspects of the electronics industry is how quickly devices like\n  microcontrollers are becoming more powerful, more efficient, and lower cost. There's an amazing\n  range of options available to us today, packing incredible performance into tiny, cheap packages.\n  As is the case with almost everything in embedded systems, the answer to what might seem like a\n  straightforward question like \"What microcontroller should we use?\" is \"It depends.\"\u003C\u002Fp>",1795194794258]