Array ( [0] => {{Short description|Small computer on a single integrated circuit}} [1] => {{for|a [[wikt:micro-|small]] computer on a [[printed circuit board]] (PCB)|microcomputer}} [2] => [[File:Intel 8742 153056995.jpg|right|thumb|230px|The [[die (integrated circuit)|die]] from an [[Intel]] 8742, an 8-bit microcontroller that includes a [[Central processing unit|CPU]] running at {{nowrap|12 MHz,}} {{nowrap|128 bytes}} of [[Random-access memory|RAM]], {{nowrap|2048 bytes}} of [[EPROM]], and [[Input/output|I/O]] in the same chip]] [3] => [[Image:Microcontrollers Atmega32 Atmega8.jpg|thumbnail|Two ATmega microcontrollers]] [4] => [5] => A '''microcontroller''' ('''MC''', '''UC''', or '''μC''') or '''microcontroller unit''' ('''MCU''') is a small [[computer]] on a single [[integrated circuit]]. A microcontroller contains one or more [[Central processing unit|CPUs]] ([[processor core]]s) along with [[Computer memory|memory]] and programmable [[input/output]] peripherals. Program memory in the form of [[Flash memory#NOR flash|NOR flash]], [[Programmable read-only memory|OTP ROM]] or [[ferroelectric RAM]] is also often included on chip, as well as a small amount of [[random-access memory|RAM]]. Microcontrollers are designed for [[Embedded system|embedded]] applications, in contrast to the [[microprocessor]]s used in [[personal computer]]s or other general purpose applications consisting of various discrete chips. [6] => [7] => In modern terminology, a microcontroller is similar to, but less sophisticated than, a [[system on a chip]] (SoC). A SoC may include a microcontroller as one of its components, but usually integrates it with advanced peripherals like a [[graphics processing unit]] (GPU), a [[Wi-Fi]] module, or one or more [[coprocessor]]s. [8] => [9] => Microcontrollers are used in [[Control system|automatically controlled]] products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, toys and other [[embedded system]]s. By reducing the size and cost compared to a design that uses a separate [[microprocessor]], memory, and input/output devices, microcontrollers make digital control of more devices and processes practical. [[Mixed-signal integrated circuit|Mixed-signal]] microcontrollers are common, integrating analog components needed to control non-digital electronic systems. In the context of the [[internet of things]], microcontrollers are an economical and popular means of [[data collection]], [[Sensor|sensing]] and [[Actuator|actuating]] the physical world as [[edge device]]s. [10] => [11] => Some microcontrollers may use four-bit [[Word (computer architecture)|words]] and operate at frequencies as low as {{nowrap|4 kHz}} for low [[Electric energy consumption|power consumption]] (single-digit [[Watt|milliwatts]] or microwatts). They generally have the ability to retain functionality while [[Wait state|waiting]] for an [[Event-driven architecture|event]] such as a button press or other [[interrupt]]; power consumption while sleeping (CPU clock and most peripherals off) may be just nanowatts, making many of them well suited for long lasting battery applications. Other microcontrollers may serve performance-critical roles, where they may need to act more like a [[digital signal processor]] (DSP), with higher clock speeds and power consumption. [12] => [13] => == History == [14] => === Background === [15] => {{See|MOS integrated circuit|Microprocessor chronology}} [16] => [17] => The first multi-chip microprocessors, the [[Four-Phase Systems AL1]] in 1969 and the [[Garrett AiResearch]] [[MP944]] in 1970, were developed with multiple MOS LSI chips. The first single-chip microprocessor was the [[Intel 4004]], released on a single MOS LSI chip in 1971. It was developed by [[Federico Faggin]], using his [[silicon-gate]] MOS technology, along with [[Intel]] engineers [[Marcian Hoff]] and [[Stan Mazor]], and [[Busicom]] engineer [[Masatoshi Shima]].{{cite web |title=1971: Microprocessor Integrates CPU Function onto a Single Chip |website=The Silicon Engine |url=https://www.computerhistory.org/siliconengine/microprocessor-integrates-cpu-function-onto-a-single-chip/ |publisher=[[Computer History Museum]] |access-date=22 July 2019}} It was followed by the [[4-bit computing|4-bit]] [[Intel 4040]], the [[8-bit computing|8-bit]] [[Intel 8008]], and the 8-bit [[Intel 8080]]. All of these processors required several external chips to implement a working system, including memory and peripheral interface chips. As a result, the total system cost was several hundred (1970s US) dollars, making it impossible to economically computerize small appliances. [18] => [19] => [[MOS Technology]] introduced its sub-$100 microprocessors in 1975, the 6501 and [[MOS Technology 6502|6502]]. Their chief aim was to reduce this cost barrier but these microprocessors still required external support, memory, and peripheral chips which kept the total system cost in the hundreds of dollars. [20] => [21] => === Development === [22] => One book credits [[Texas Instruments|TI]] engineers Gary Boone and Michael Cochran with the successful creation of the first microcontroller in 1971. The result of their work was the [[TMS 1000]], which became commercially available in 1974. It combined read-only memory, read/write memory, processor and clock on one chip and was targeted at embedded systems.{{cite book [23] => |url=http://smithsonianchips.si.edu/augarten/p38.htm [24] => |title=The Most Widely Used Computer on a Chip: The TMS 1000 [25] => |work=State of the Art: A Photographic History of the Integrated Circuit [26] => |last=Augarten |first=Stan [27] => |publisher=Ticknor & Fields [28] => |location=New Haven and New York [29] => |year=1983 [30] => |isbn=978-0-89919-195-9 [31] => |access-date=2009-12-23 [32] => }} [33] => [34] => During the early-to-mid-1970s, Japanese electronics manufacturers began producing microcontrollers for automobiles, including 4-bit MCUs for [[in-car entertainment]], automatic wipers, electronic locks, and dashboard, and 8-bit MCUs for engine control.{{cite web |title=Trends in the Semiconductor Industry |url=http://www.shmj.or.jp/english/trends/trd70s.html |website=Semiconductor History Museum of Japan |access-date=2019-06-27 |archive-url=https://web.archive.org/web/20190627082830/http://www.shmj.or.jp/english/trends/trd70s.html |archive-date=2019-06-27 |url-status=dead }} [35] => [36] => Partly in response to the existence of the single-chip TMS 1000,{{cite web|url=http://archive.computerhistory.org/resources/access/text/2013/05/102658328-05-01-acc.pdf |title=Oral History Panel on the Development and Promotion of the Intel 8048 Microcontroller|work=Computer History Museum Oral History, 2008|access-date=2016-04-04|page=4}} Intel developed a computer system on a chip optimized for control applications, the [[Intel 8048]], with commercial parts first shipping in 1977. It combined [[random-access memory|RAM]] and [[read-only memory|ROM]] on the same chip with a microprocessor. Among numerous applications, this chip would eventually find its way into over one billion PC keyboards. At that time Intel's President, Luke J. Valenter, stated that the microcontroller was one of the most successful products in the company's history, and he expanded the microcontroller division's budget by over 25%. [37] => [38] => Most microcontrollers at this time had concurrent variants. One had [[EPROM]] program memory, with a transparent quartz window in the lid of the package to allow it to be erased by exposure to [[ultraviolet]] light. These erasable chips were often used for prototyping. The other variant was either a mask-programmed ROM or a [[Programmable read-only memory|PROM]] variant which was only programmable once. For the latter, sometimes the designation ''OTP'' was used, standing for "one-time programmable". In an OTP microcontroller, the PROM was usually of identical type as the EPROM, but the chip package had no quartz window; because there was no way to expose the EPROM to ultraviolet light, it could not be erased. Because the erasable versions required ceramic packages with quartz windows, they were significantly more expensive than the OTP versions, which could be made in lower-cost opaque plastic packages. For the erasable variants, quartz was required, instead of less expensive glass, for its transparency to ultraviolet light—to which glass is largely opaque—but the main cost differentiator was the ceramic package itself. [39] => [40] => In 1993, the introduction of [[EEPROM]] memory allowed microcontrollers (beginning with the Microchip [[PIC16x84|PIC16C84]]){{cite web [41] => |url=https://spectrum.ieee.org/tech-history/silicon-revolution/chip-hall-of-fame-microchip-technology-pic-16c84-microcontroller [42] => |title=Chip Hall of Fame: Microchip Technology PIC 16C84 Microcontroller [43] => |publisher=IEEE [44] => |access-date=September 16, 2018|date=2017-06-30 [45] => }} to be electrically erased quickly without an expensive package as required for [[EPROM]], allowing both rapid prototyping, and [[in-system programming]]. (EEPROM technology had been available prior to this time,{{cite book |author=Motorola |title=Advance Information, 8-Bit Microcomputers MC68HC05B6, MC68HC05B4, MC68HC805B6, Motorola Document EADI0054RI |publisher= Motorola Ltd., 1988}} but the earlier EEPROM was more expensive and less durable, making it unsuitable for low-cost mass-produced microcontrollers.) The same year, Atmel introduced the first microcontroller using [[Flash memory]], a special type of EEPROM.{{cite web|title=Atmel's Self-Programming Flash Microcontrollers |url=http://www.atmel.com/dyn/resources/prod_documents/doc2464.pdf |date=2012-01-24 |access-date=2008-10-25}} by Odd Jostein Svendsli 2003 Other companies rapidly followed suit, with both memory types. [46] => [47] => Nowadays microcontrollers are cheap and readily available for hobbyists, with large online communities around certain processors. [48] => [49] => === Volume and cost === [50] => In 2002, about 55% of all [[central processing unit|CPU]]s sold in the world were 8-bit microcontrollers and microprocessors.{{Cite news|url=https://www.embedded.com/electronics-blogs/significant-bits/4024488/The-Two-Percent-Solution|title=The Two Percent Solution|last=Turley|first=Jim|work=Embedded|year=2002|access-date=2018-07-11|language=en}} [51] => [52] => Over two billion 8-bit microcontrollers were sold in 1997,{{Cite web|url=https://www.circuitcellar.com/library/designforum/silicon_update/3/index.asp|archive-url=https://web.archive.org/web/20070927214629/https://www.circuitcellar.com/library/designforum/silicon_update/3/index.asp|archive-date=2007-09-27|title=Microchip on the March |year=1998|first=Tom |last=Cantrell|website=Circuit Cellar|access-date=2018-07-11}} and according to Semico, over four billion 8-bit microcontrollers were sold in 2006.{{Cite web | url=https://www.semico.com |title = Semico Research}} More recently, Semico has claimed the MCU market grew 36.5% in 2010 and 12% in 2011.{{Cite web|url=https://semico.com/content/momentum-carries-mcus-2011|title=Momentum Carries MCUs Into 2011 {{!}} Semico Research|website=semico.com|language=en|access-date=2018-07-11}} [53] => [54] => A typical home in a developed country is likely to have only four general-purpose microprocessors but around three dozen microcontrollers. A typical mid-range automobile has about 30 microcontrollers. They can also be found in many electrical devices such as washing machines, microwave ovens, and telephones. [55] => [56] => {{quotation|Historically, the 8-bit segment has dominated the MCU market [..] 16-bit microcontrollers became the largest volume MCU category in 2011, overtaking 8-bit devices for the first time that year [..] IC Insights believes the makeup of the MCU market will undergo substantial changes in the next five years with 32-bit devices steadily grabbing a greater share of sales and unit volumes. By 2017, 32-bit MCUs are expected to account for 55% of microcontroller sales [..] In terms of unit volumes, 32-bit MCUs are expected account for 38% of microcontroller shipments in 2017, while 16-bit devices will represent 34% of the total, and 4-/8-bit designs are forecast to be 28% of units sold that year. [57] => [58] => The 32-bit MCU market is expected to grow rapidly due to increasing demand for higher levels of precision in embedded-processing systems and the growth in connectivity using the Internet. [..] In the next few years, complex 32-bit MCUs are expected to account for over 25% of the processing power in vehicles.|IC Insights|MCU Market on Migration Path to 32-bit and ARM-based Devices{{cite web |url=http://www.icinsights.com/news/bulletins/MCU-Market-On-Migration-Path-To-32bit-And-ARMbased-Devices/ [59] => |date=April 25, 2013 [60] => |title=MCU Market on Migration Path to 32-bit and ARM-based Devices [61] => |quote=It typically takes a global economic recession to upset the diverse MCU marketplace, and that's exactly what occurred in 2009, when the microcontroller business suffered its worst-ever annual sales decline of 22% to $11.1 billion.}} [62] => }} [63] => [64] => Cost to manufacture can be under {{US$|0.10}} per unit. [65] => [66] => Cost has plummeted over time, with the cheapest [[8-bit computing|8-bit]] microcontrollers being available for under {{USD|0.03}} in 2018,{{Cite web|url=http://www.additude.se/bloggar/thomas-lovskog/the-really-low-cost-mcus/|title=The really low cost MCUs|website=www.additude.se|access-date=2019-01-16}} and some [[32-bit computing|32-bit]] microcontrollers around {{US$|1}} for similar quantities. [67] => [68] => In 2012, following a global crisis—a worst ever annual sales decline and recovery and average sales price year-over-year plunging 17%—the biggest reduction since the 1980s—the average price for a microcontroller was {{US$|0.88}} ({{US$|0.69}} for 4-/8-bit, {{US$|0.59}} for 16-bit, {{US$|1.76}} for 32-bit). [69] => [70] => In 2012, worldwide sales of 8-bit microcontrollers were around {{US$|4 billion}}, while [[4-bit computing|4-bit]] microcontrollers also saw significant sales.Bill Giovino. [https://microcontroller.com/news/Zilog_Buys_Samsung_Microcontrollers.asp "Zilog Buys Microcontroller Product Lines from Samsung"]. 2013. [71] => [72] => In 2015, 8-bit microcontrollers could be bought for {{US$|0.311}} (1,000 units),{{Cite web | url=https://www.mouser.com/ProductDetail/Silicon-Labs/EFM8BB10F2G-A-QFN20/?qs=sGAEpiMZZMu9ReDVvI6ax9sqO0qrXlDW4ZuhKcnb2c%252bQvyUXU1UbuQ%3d%3d | title=EFM8BB10F2G-A-QFN20 Silicon Labs | Mouser}} 16-bit for {{US$|0.385}} (1,000 units),{{Cite web | url=https://www.mouser.com/ProductDetail/Texas-Instruments/MSP430G2001IPW14R/?qs=sGAEpiMZZMvfhsTlJjecML5mLnp8Cec4esZ6%2f1aK7FQ%3d |title = MSP430G2001IPW14R Texas Instruments | Mouser}} and 32-bit for {{US$|0.378}} (1,000 units, but at {{US$|0.35}} for 5,000).{{Cite web|title=CY8C4013SXI-400 Cypress Semiconductor {{!}} Mouser|website=Mouser Electronics|url=https://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY8C4013SXI-400/?qs=sGAEpiMZZMuI9neUTtPr752e7iT1qQqS4inl2jxeWgxWqjKLOdzceQ==|archive-url=https://web.archive.org/web/20150218211453/https://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY8C4013SXI-400/?qs=sGAEpiMZZMuI9neUTtPr752e7iT1qQqS4inl2jxeWgxWqjKLOdzceQ==|archive-date=2015-02-18|language=en-US}} [73] => [74] => In 2018, 8-bit microcontrollers could be bought for {{US$|0.03}}, 16-bit for {{US$|0.393}} (1,000 units, but at {{US$|0.563}} for 100 or {{US$|0.349}} for full reel of 2,000),{{Cite web | url=https://eu.mouser.com/ProductDetail/Texas-Instruments/MSP430FR2000IPW16R?qs=sGAEpiMZZMs0L%252b%252bydDbPCjJ%2f9huEtS8nFliXsvF0PDUDt%252bi%2fs4FH9A%3d%3d |title = MSP430FR2000IPW16R Texas Instruments | Mouser}} and 32-bit for {{US$|0.503}} (1,000 units, but at {{US$|0.466}} for 5,000).{{Cite web|url=https://www.mouser.com/ProductDetail/Cypress-Semiconductor/CY8C4013SXI-400/?qs=sGAEpiMZZMuI9neUTtPr752e7iT1qQqS4inl2jxeWgxWqjKLOdzceQ==|title=CY8C4013SXI-400 Cypress Semiconductor {{!}} Mouser|website=Mouser Electronics|language=en-US|access-date=2018-07-11}} [75] => [76] => In 2018, the low-priced microcontrollers above from 2015 were all more expensive (with inflation calculated between 2018 and 2015 prices for those specific units) at: the 8-bit microcontroller could be bought for {{US$|0.319}} (1,000 units) or 2.6% higher, the 16-bit one for {{US$|0.464}} (1,000 units) or 21% higher, and the 32-bit one for {{US$|0.503}} (1,000 units, but at {{US$|0.466}} for 5,000) or 33% higher. [77] => [78] => [[Image:PIC18F8720.jpg|right|thumbnail|A [[PIC microcontroller|PIC]] 18F8720 microcontroller in an 80-pin [[Quad Flat Package|TQFP]] package]] [79] => [80] => === Smallest computer === [81] => On 21 June 2018, the "world's smallest computer" was announced by the [[University of Michigan]]. The device is a "{{val|0.04|ul=mm3}} {{val|16|ul=nW}} wireless and batteryless sensor system with integrated [[ARM Cortex-M#Cortex-M0+|Cortex-M0+]] processor and optical communication for cellular temperature measurement." It "measures just {{val|0.3|u=mm}} to a side—dwarfed by a grain of rice. [...] In addition to the RAM and [[photovoltaics]], the new computing devices have processors and [[wireless networking|wireless transmitters and receivers]]. Because they are too small to have conventional radio antennae, they receive and transmit data with visible light. A base station provides light for power and programming, and it receives the data."{{citation | url=https://news.umich.edu/u-m-researchers-create-worlds-smallest-computer/ | title=U-M researchers create world's smallest 'computer' | date=2018-06-21 | publisher=[[University of Michigan]]}} The device is {{frac|1|10}}th the size of IBM's previously claimed world-record-sized computer from months back in March 2018,{{citation | url=https://www.cnet.com/news/university-of-michigan-outdoes-ibm-with-worlds-smallest-computer/ | title=University of Michigan outdoes IBM with world's smallest 'computer' | date=2018-06-22 | publisher=[[CNET]]}} which is "smaller than a grain of salt",{{citation | url=https://www.cnet.com/news/ibm-fighting-counterfeiters-with-worlds-smallest-computer/ | title=IBM fighting counterfeiters with world's smallest computer | date=2018-03-19 | publisher=[[CNET]]}} has a million transistors, costs less than {{US$|long=no|0.10}} to manufacture, and, combined with [[blockchain]] technology, is intended for logistics and "crypto-anchors"—[[Fingerprint (computing)|digital fingerprint]] applications.{{citation | title=IBM Built a Computer the Size of a Grain of Salt. Here's What It's For. | date=2018-03-19 | publisher=[[Fortune (magazine)|Fortune]] | url=https://fortune.com/2018/03/19/ibm-computer-salt-grain-blockchain/}} [82] => [83] => == Embedded design == [84] => A microcontroller can be considered a self-contained system with a processor, memory and peripherals and can be used as an [[embedded system]].{{cite book [85] => |last=Heath |first=Steve [86] => |title=Embedded systems design [87] => |publisher=Newnes [88] => |year=2003 [89] => |edition=2 [90] => |series=EDN series for design engineers [91] => |pages=[https://archive.org/details/embeddedsystemsd0000heat/page/11 11]–12 [92] => |url=https://archive.org/details/embeddedsystemsd0000heat [93] => |url-access=registration |isbn=9780750655460 [94] => }} The majority of microcontrollers in use today are embedded in other machinery, such as automobiles, telephones, appliances, and peripherals for computer systems. [95] => [96] => While some embedded systems are very sophisticated, many have minimal requirements for memory and program length, with no [[operating system]], and low software complexity. Typical input and output devices include switches, [[relay]]s, [[solenoid]]s, [[Light-emitting diode|LED]]'s, small or custom [[liquid-crystal display]]s, radio frequency devices, and sensors for data such as temperature, humidity, light level etc. Embedded systems usually have no keyboard, screen, disks, printers, or other recognizable I/O devices of a [[personal computer]], and may lack human interaction devices of any kind. [97] => [98] => === Interrupts === [99] => Microcontrollers must provide [[Real-time computing|real-time]] (predictable, though not necessarily fast) response to events in the embedded system they are controlling. When certain events occur, an [[interrupt]] system can signal the processor to suspend processing the current instruction sequence and to begin an [[interrupt service routine]] (ISR, or "interrupt handler") which will perform any processing required based on the source of the interrupt, before returning to the original instruction sequence. Possible interrupt sources are device-dependent and often include events such as an internal timer overflow, completing an analog-to-digital conversion, a logic-level change on an input such as from a button being pressed, and data received on a communication link. Where power consumption is important as in battery devices, interrupts may also wake a microcontroller from a low-power sleep state where the processor is halted until required to do something by a peripheral event. [100] => [101] => === Programs === [102] => Typically microcontroller programs must fit in the available on-chip memory, since it would be costly to provide a system with external, expandable memory. Compilers and assemblers are used to convert both [[High-level programming language|high-level]] and [[assembly language]] code into a compact [[machine code]] for storage in the microcontroller's memory. Depending on the device, the program memory may be permanent, [[read-only memory]] that can only be programmed at the factory, or it may be field-alterable [[Flash memory|flash]] or erasable read-only memory. [103] => [104] => Manufacturers have often produced special versions of their microcontrollers in order to help the hardware and [[software development]] of the target system. Originally these included [[EPROM]] versions that have a "window" on the top of the device through which program memory can be erased by [[ultraviolet]] light, ready for reprogramming after a programming ("burn") and test cycle. Since 1998, EPROM versions are rare and have been replaced by [[EEPROM]] and flash, which are easier to use (can be erased electronically) and cheaper to manufacture. [105] => [106] => Other versions may be available where the ROM is accessed as an external device rather than as internal memory, however these are becoming rare due to the widespread availability of cheap microcontroller programmers. [107] => [108] => The use of field-programmable devices on a micro controller may allow field update of the [[firmware]] or permit late factory revisions to products that have been assembled but not yet shipped. Programmable memory also reduces the lead time required for deployment of a new product. [109] => [110] => Where hundreds of thousands of identical devices are required, using parts programmed at the time of manufacture can be economical. These "[[mask ROM|mask-programmed]]" parts have the program laid down in the same way as the logic of the chip, at the same time. [111] => [112] => A customized microcontroller incorporates a block of digital logic that can be personalized for additional processing capability, [[peripherals]] and [[Interface (computer science)|interfaces]] that are adapted to the requirements of the application. One example is the [[AT91CAP]] from [[Atmel]]. [113] => [114] => === Other microcontroller features === [115] => Microcontrollers usually contain from several to dozens of general purpose input/output pins ([[General-purpose input/output|GPIO]]). GPIO pins are software configurable to either an input or an output state. When GPIO pins are configured to an input state, they are often used to read sensors or external signals. Configured to the output state, GPIO pins can drive external devices such as LEDs or motors, often indirectly, through external power electronics. [116] => [117] => Many embedded systems need to read sensors that produce analog signals. This is the purpose of the [[analog-to-digital converter]] (ADC). Since processors are built to interpret and process digital data, i.e. 1s and 0s, they are not able to do anything with the analog signals that may be sent to it by a device. So the analog-to-digital converter is used to convert the incoming data into a form that the processor can recognize. A less common feature on some microcontrollers is a [[digital-to-analog converter]] (DAC) that allows the processor to output analog signals or voltage levels. [118] => [119] => In addition to the converters, many embedded microprocessors include a variety of timers as well. One of the most common types of timers is the [[programmable interval timer]] (PIT). A PIT may either count down from some value to zero, or up to the capacity of the count register, overflowing to zero. Once it reaches zero, it sends an interrupt to the processor indicating that it has finished counting. This is useful for devices such as thermostats, which periodically test the temperature around them to see if they need to turn the air conditioner on/off, the heater on/off, etc. [120] => [121] => A dedicated [[pulse-width modulation]] (PWM) block makes it possible for the CPU to control [[Switched-mode power supply|power converters]], [[Electrical resistance|resistive]] loads, [[Electric motor|motors]], etc., without using many CPU resources in tight timer [[Program loops|loops]]. [122] => [123] => A [[universal asynchronous receiver/transmitter]] (UART) block makes it possible to receive and transmit data over a serial line with very little load on the CPU. Dedicated on-chip hardware also often includes capabilities to communicate with other devices (chips) in digital formats such as Inter-Integrated Circuit ([[I²C]]), Serial Peripheral Interface ([[Serial Peripheral Interface|SPI]]), Universal Serial Bus ([[USB]]), and [[Ethernet]].David Harris & Sarah Harris (2012). ''Digital Design and Computer Architecture, Second Edition'', p. 515. Morgan Kaufmann. {{ISBN|0123944244}}. [124] => [125] => == Higher integration == [126] => [[Image:PIC12C508-HD.jpg|thumb|[[Die (integrated circuit)|Die]] of a PIC12C508 8-bit, fully static, [[EEPROM]]/[[EPROM]]/[[Mask ROM|ROM]]-based [[CMOS]] microcontroller manufactured by [[Microchip Technology]] using a 1200 [[nanometer]] process]] [127] => [[Image:STM32F100C4T6B-HD.jpg|thumb|[[Die (integrated circuit)|Die]] of a STM32F100C4T6B [[ARM Cortex-M]]3 microcontroller with 16 [[kilobyte]]s [[flash memory]], 24 [[hertz|MHz]] [[central processing unit]] (CPU), [[motor controller|motor control]] and [[Consumer Electronics Control]] (CEC) functions. Manufactured by [[STMicroelectronics]].]] [128] => Microcontrollers may not implement an external address or data bus as they integrate RAM and [[non-volatile memory]] on the same chip as the CPU. Using fewer pins, the chip can be placed in a much smaller, cheaper package. [129] => [130] => Integrating the memory and other peripherals on a single chip and testing them as a unit increases the cost of that chip, but often results in decreased net cost of the embedded system as a whole. Even if the cost of a CPU that has integrated peripherals is slightly more than the cost of a CPU and external peripherals, having fewer chips typically allows a smaller and cheaper circuit board, and reduces the labor required to assemble and test the circuit board, in addition to tending to decrease the defect rate for the finished assembly. [131] => [132] => A microcontroller is a single [[integrated circuit]], commonly with the following features: [133] => * [[central processing unit]]{{snd}} ranging from small and simple [[4-bit computing|4-bit]] processors to complex [[32-bit computing|32-bit]] or [[64-bit computing|64-bit]] processors [134] => * volatile memory ([[RAM]]) for data storage [135] => * [[Read-only memory|ROM]], [[EPROM]], [[EEPROM]] or [[Flash memory]] for [[Computer program|program]] and operating parameter storage [136] => * discrete input and output bits, allowing control or detection of the logic state of an individual package pin [137] => * serial [[input/output]] such as [[serial port]]s ([[UART]]s) [138] => * other [[serial communications]] [[Network interface controller|interfaces]] like [[I²C]], [[Serial Peripheral Interface]] and [[Controller Area Network]] for system interconnect [139] => * [[peripheral]]s such as [[timer]]s, event counters, [[Pulse-width modulation|PWM generators]], and [[Watchdog timer|watchdog]] [140] => * [[clock generator]]{{snd}} often an oscillator for a quartz timing crystal, resonator or [[RC circuit]] [141] => * many include analog-to-digital converters, some include digital-to-analog converters [142] => * [[in-circuit programming]] and [[in-circuit debugging]] support [143] => [144] => This integration drastically reduces the number of chips and the amount of wiring and [[Printed circuit board|circuit board]] space that would be needed to produce equivalent systems using separate chips. Furthermore, on low pin count devices in particular, each pin may interface to several internal peripherals, with the pin function selected by software. This allows a part to be used in a wider variety of applications than if pins had dedicated functions. [145] => [146] => Microcontrollers have proved to be highly popular in [[embedded system]]s since their introduction in the 1970s. [147] => [148] => Some microcontrollers use a [[Harvard architecture]]: separate memory buses for instructions and data, allowing accesses to take place concurrently. Where a Harvard architecture is used, instruction words for the processor may be a different bit size than the length of internal memory and registers; for example: 12-bit instructions used with 8-bit data registers. [149] => [150] => The decision of which peripheral to integrate is often difficult. The microcontroller vendors often trade operating frequencies and system design flexibility against time-to-market requirements from their customers and overall lower system cost. Manufacturers have to balance the need to minimize the chip size against additional functionality. [151] => [152] => Microcontroller architectures vary widely. Some designs include general-purpose microprocessor cores, with one or more ROM, RAM, or I/O functions integrated onto the package. Other designs are purpose-built for control applications. A microcontroller instruction set usually has many instructions intended for [[bit manipulation]] (bit-wise operations) to make control programs more compact.[http://www.popsci.com/diy/article/2009-01/dot-dot-programming Easy Way to build a microcontroller project] For example, a general-purpose processor might require several instructions to test a bit in a register and branch if the bit is set, where a microcontroller could have a single instruction to provide that commonly required function. [153] => [154] => Microcontrollers historically have not had [[math coprocessor]]s, so [[floating-point arithmetic]] has been performed by software. However, some recent designs do include FPUs and DSP-optimized features. An example would be Microchip's PIC32 MIPS-based line. [155] => [156] => == Programming environments == [157] => Microcontrollers were originally programmed only in [[assembly language]], but various [[high-level programming language]]s, such as [[C (programming language)|C]], [[Python (programming language)|Python]] and [[JavaScript]], are now also in common use to target microcontrollers and [[embedded systems]].{{cite conference |chapter= Changing the programming paradigm for the embedded in the IoT domain |last1= Mazzei |first1= Daniele |last2= Montelisciani |first2= Gabriele |last3= Baldi |first3= Giacomo |last4= Fantoni |first4= Gualtiero |title= 2015 IEEE 2nd World Forum on Internet of Things (WF-IoT) |date= 2015 |publisher= IEEE |pages= 239–244 |conference= Internet of Things (WF-IoT), 2015 IEEE 2nd World Forum on |location=Milan |doi= 10.1109/WF-IoT.2015.7389059|isbn= 978-1-5090-0366-2 }} [[Compiler]]s for general purpose languages will typically have some restrictions as well as enhancements to better support the unique characteristics of microcontrollers. Some microcontrollers have environments to aid developing certain types of applications. Microcontroller vendors often make tools freely available to make it easier to adopt their hardware. [158] => [159] => Microcontrollers with specialty hardware may require their own non-standard dialects of C, such as [[Small Device C Compiler|SDCC for the 8051]], which prevent using standard tools (such as code libraries or static analysis tools) even for code unrelated to hardware features. [[Interpreter (computing)|Interpreters]] may also contain nonstandard features, such as [[MicroPython]], although a fork, [[CircuitPython]], has looked to move hardware dependencies to libraries and have the language adhere to a more [[CPython]] standard. [160] => [161] => Interpreter firmware is also available for some microcontrollers. For example, [[BASIC programming language|BASIC]] on the early microcontroller [[Intel]] [[8052]];[http://www.lvr.com/microc.htm "8052-Basic Microcontrollers"] by Jan Axelson 1994 BASIC and [[Forth (programming language)|FORTH]] on the [[Zilog Z8]]{{cite journal |last1=Edwards |first1=Robert |year=1987 |title=Optimizing the Zilog Z8 Forth Microcontroller for Rapid Prototyping |page=3 |publisher=Martin Marietta |url=http://www.ornl.gov/info/reports/1987/3445602791343.pdf |access-date=9 December 2012}} as well as some modern devices. Typically these interpreters support [[interactive programming]]. [162] => [163] => [[Logic simulation|Simulators]] are available for some microcontrollers. These allow a developer to analyze what the behavior of the microcontroller and their program should be if they were using the actual part. A [[simulator]] will show the internal processor state and also that of the outputs, as well as allowing input signals to be generated. While on the one hand most simulators will be limited from being unable to simulate much other hardware in a system, they can exercise conditions that may otherwise be hard to reproduce at will in the physical implementation, and can be the quickest way to debug and analyze problems. [164] => [165] => Recent microcontrollers are often integrated with on-chip [[debug]] circuitry that when accessed by an [[in-circuit emulator]] (ICE) via [[JTAG]], allow debugging of the firmware with a [[debugger]]. A real-time ICE may allow viewing and/or manipulating of internal states while running. A tracing ICE can record executed program and MCU states before/after a trigger point. [166] => [167] => == Types == [168] => {{See also|List of common microcontrollers}} [169] => [170] => {{As of|2008}}, there are several dozen microcontroller architectures and vendors including: [171] => * [[ARM architecture|ARM]] core processors (many vendors) [172] => ** [[ARM Cortex-M]] cores are specifically targeted toward microcontroller applications [173] => * [[Microchip Technology]] [[Atmel AVR]] (8-bit), [[AVR32]] (32-bit), and [[AT91SAM]] (32-bit) [174] => * [[Cypress Semiconductor]]'s M8C core used in their [[Cypress PSoC]] [175] => * [[Freescale ColdFire]] (32-bit) and [[Freescale S08|S08]] (8-bit) [176] => * [[Freescale 68HC11]] (8-bit), and others [[List of Freescale products|based on the Motorola 6800 family]] [177] => * [[Intel 8051]], also manufactured by [[NXP Semiconductors]], Infineon and many others [178] => * [[List of common microcontrollers#Infineon|Infineon]]: [[XC800|8-bit XC800]], [[XE166 family|16-bit XE166]], [[Infineon XMC4000|32-bit XMC4000]] (ARM based Cortex M4F), [[TriCore|32-bit TriCore]] and, [[Aurix|32-bit Aurix]] Tricore Bit microcontrollers[http://www.infineon.com/mcu www.infineon.com/mcu] [179] => * [[Maxim Integrated]] MAX32600, MAX32620, MAX32625, MAX32630, MAX32650, MAX32640 [180] => * [[MIPS architecture|MIPS]] [181] => * [[Microchip Technology]] [[PIC microcontroller|PIC]], (8-bit PIC16, PIC18, 16-bit dsPIC33 / PIC24), (32-bit PIC32) [182] => * [[NXP Semiconductors]] LPC1000, LPC2000, LPC3000, LPC4000 (32-bit), LPC900, LPC700 (8-bit) [183] => * [[Parallax Propeller]] [184] => * [[PowerPC]] ISE [185] => * [[Rabbit 2000]] (8-bit) [186] => * [[Renesas Electronics]]: [[RL78|RL78 16-bit MCU]]; [[RX Microcontroller Family|RX 32-bit MCU]]; [[SuperH]]; [[V850|V850 32-bit MCU]]; [[H8 Family|H8]]; [[R8C|R8C 16-bit MCU]] [187] => * [[Silicon Laboratories]] Pipelined 8-bit 8051 microcontrollers and mixed-signal ARM-based 32-bit microcontrollers [188] => * [[STMicroelectronics]] [[STM8]] (8-bit), [[ST10]] (16-bit), [[STM32]] (32-bit), [http://www.st.com/en/automotive-microcontrollers/spc5-32-bit-automotive-mcus.html?querycriteria=productId=SC963 SPC5] (automotive 32-bit) [189] => * [[Texas Instruments#Microcontrollers|Texas Instruments]] [[MSP430|TI MSP430]] (16-bit), [http://www.ti.com/msp432 MSP432] (32-bit), [[TMS320|C2000]] (32-bit) [190] => * [[Toshiba TLCS|Toshiba TLCS-870]] (8-bit/16-bit) [191] => [192] => Many others exist, some of which are used in very narrow range of applications or are more like applications processors than microcontrollers. The microcontroller market is extremely fragmented, with numerous vendors, technologies, and markets. Note that many vendors sell or have sold multiple architectures. [193] => [194] => == Interrupt latency == [195] => In contrast to general-purpose computers, microcontrollers used in embedded systems often seek to optimize [[interrupt latency]] over instruction throughput. Issues include both reducing the latency, and making it be more predictable (to support real-time control). [196] => [197] => When an electronic device causes an interrupt, during the [[context switch]] the intermediate results (registers) have to be saved before the software responsible for handling the interrupt can run. They must also be restored after that [[interrupt handler]] is finished. If there are more [[processor register]]s, this saving and restoring process may take more time, increasing the latency. (If an ISR does not require the use of some registers, it may simply leave them alone rather than saving and restoring them, so in that case those registers are not involved with the latency.) Ways to reduce such context/restore latency include having relatively few registers in their central processing units (undesirable because it slows down most non-interrupt processing substantially), or at least having the hardware not save them all (this fails if the software then needs to compensate by saving the rest "manually"). Another technique involves spending silicon gates on "shadow registers": One or more duplicate registers used only by the interrupt software, perhaps supporting a dedicated stack. [198] => [199] => Other factors affecting interrupt latency include: [200] => * Cycles needed to complete current CPU activities. To minimize those costs, microcontrollers tend to have short pipelines (often three instructions or less), small write buffers, and ensure that longer instructions are continuable or restartable. [[Reduced instruction set computing|RISC]] design principles ensure that most instructions take the same number of cycles, helping avoid the need for most such continuation/restart logic. [201] => * The length of any [[critical section]] that needs to be interrupted. Entry to a critical section restricts concurrent data structure access. When a data structure must be accessed by an interrupt handler, the critical section must block that interrupt. Accordingly, interrupt latency is increased by however long that interrupt is blocked. When there are hard external constraints on system latency, developers often need tools to measure interrupt latencies and track down which critical sections cause slowdowns. [202] => ** One common technique just blocks all interrupts for the duration of the critical section. This is easy to implement, but sometimes critical sections get uncomfortably long. [203] => ** A more complex technique just blocks the interrupts that may trigger access to that data structure. This is often based on interrupt priorities, which tend to not correspond well to the relevant system data structures. Accordingly, this technique is used mostly in very constrained environments. [204] => ** Processors may have hardware support for some critical sections. Examples include supporting atomic access to bits or bytes within a word, or other atomic access primitives like the [[Load-link/store-conditional|LDREX/STREX]] exclusive access primitives introduced in the [[ARM architecture|ARMv6]] architecture. [205] => * Interrupt nesting. Some microcontrollers allow higher priority interrupts to interrupt lower priority ones. This allows software to manage latency by giving time-critical interrupts higher priority (and thus lower and more predictable latency) than less-critical ones. [206] => * Trigger rate. When interrupts occur back-to-back, microcontrollers may avoid an extra context save/restore cycle by a form of [[tail call]] optimization. [207] => [208] => Lower end microcontrollers tend to support fewer interrupt latency controls than higher end ones. [209] => [210] => == Memory technology == [211] => Two different kinds of memory are commonly used with microcontrollers, a non-volatile memory for storing firmware and a read-write memory for temporary data. [212] => [213] => === Data === [214] => From the earliest microcontrollers to today, six-transistor SRAM is almost always used as the read/write working memory, with a few more transistors per bit used in the [[register file]]. [215] => [216] => In addition to the SRAM, some microcontrollers also have internal EEPROM and/or NVRAM for data storage; and ones that do not have any (such as the [[BASIC Stamp]]), or where the internal memory is insufficient, are often connected to an external EEPROM or flash memory chip. [217] => [218] => A few microcontrollers beginning in 2003 have "self-programmable" flash memory. [219] => [220] => === Firmware === [221] => The earliest microcontrollers used mask ROM to store [[firmware]]. Later microcontrollers (such as the early versions of the [[Freescale 68HC11]] and early [[PIC microcontroller]]s) had [[EPROM]] memory, which used a translucent window to allow erasure via UV light, while production versions had no such window, being OTP (one-time-programmable). Firmware updates were equivalent to replacing the microcontroller itself, thus many products were not upgradeable. [222] => [223] => Motorola [[Motorola 68HC05|MC68HC805]] was the first microcontroller to use [[EEPROM]] to store the firmware. EEPROM microcontrollers became more popular in 1993 when Microchip introduced [[PIC16x84|PIC16C84]] and Atmel introduced an [[Intel MCS-51|8051-core]] microcontroller that was first one to use [[flash memory|NOR Flash memory]] to store the firmware. Today's microcontrollers almost all use flash memory, with a few models using FRAM and some ultra-low-cost parts still using OTP or Mask ROM. [224] => [225] => == See also == [226] => {{Portal|Electronics}} [227] => * [[Microprocessor]] [228] => * [[System on a chip]] [229] => * [[List of common microcontrollers]] [230] => * [[List of Wi-Fi microcontrollers]] [231] => * [[List of open-source hardware projects]] [232] => * [[Microbotics]] [233] => * [[Programmable logic controller]] [234] => * [[Single-board microcontroller]] [235] => [236] => == References == [237] => {{Reflist}} [238] => [239] => == External links == [240] => {{Sister project links|wikt=microcontroller|commons=Category:Microcontrollers|n=no|q=no|s=no|b=Embedded Systems}} [241] => {{Prone to spam|date=December 2012}} [242] => [257] => * {{curlie|Business/Electronics_and_Electrical/Control_Systems/Microcontroller}} [258] => [259] => {{Microcontrollers}} [260] => {{CPU technologies}} [261] => {{Computer sizes}} [262] => {{System on a chip}} [263] => [264] => {{Authority control}} [265] => [266] => [[Category:Microcontrollers| ]] [] => )
good wiki

Microcontroller

A microcontroller is a small computer on a single integrated circuit (IC) that contains a processor core, memory, and programmable input/output peripherals. It is designed for embedded systems and is widely used in various applications, such as consumer electronics, industrial automation, medical devices, and automotive systems.

More about us

About

It is designed for embedded systems and is widely used in various applications, such as consumer electronics, industrial automation, medical devices, and automotive systems. The Wikipedia page on microcontrollers provides an in-depth overview of their history, architecture, and applications. The article traces the development of microcontrollers from their early predecessors in the 1960s to the highly sophisticated devices of today. The page explains the key components of a microcontroller, including the central processing unit (CPU), memory, and various input/output peripherals. It also highlights the importance of low-cost and low-power consumption in microcontroller design, as well as the different types of microcontrollers available, such as 8-bit, 16-bit, and 32-bit architectures. Furthermore, the article explores the programming aspects of microcontrollers, discussing the various programming languages, development tools, and techniques used to program these devices. It also provides information on popular microcontroller families, such as the Arduino and Raspberry Pi, which have gained significant popularity among hobbyists and makers. The page also covers the wide-ranging applications of microcontrollers, including their use in home automation, robotics, Internet of Things (IoT) devices, and telecommunications. It provides examples of real-world applications, such as smart home systems, wearable technology, and autonomous vehicles. In addition, the article discusses the challenges and future trends in microcontroller technology, such as the integration of artificial intelligence, machine learning, and connectivity features into microcontroller systems. Overall, the Wikipedia page on microcontrollers serves as a comprehensive resource for anyone interested in understanding the technology, applications, and advancements in this field. It provides a detailed overview of microcontrollers and their significance in various industries, making it a valuable reference for students, professionals, and enthusiasts alike.

Expert Team

Vivamus eget neque lacus. Pellentesque egauris ex.

Award winning agency

Lorem ipsum, dolor sit amet consectetur elitorceat .

10 Year Exp.

Pellen tesque eget, mauris lorem iupsum neque lacus.