Sunteți pe pagina 1din 5

Microcontroller

From Wikipedia, the free encyclopedia


Jump to navigationJump to search

The die from an Intel 8742, an 8-bit microcontroller that includes a CPU running at
12 MHz, 128 bytes of RAM, 2048 bytes of EPROM, and I/O in the same chip

Two ATmega microcontrollers


A microcontroller (MCU for microcontroller unit, or UC for �-controller) is a small
computer on a single integrated circuit. In modern terminology, it is similar to,
but less sophisticated than, a system on a chip (SoC); an SoC may include a
microcontroller as one of its components. A microcontroller contains one or more
CPUs (processor cores) along with memory and programmable input/output peripherals.
Program memory in the form of ferroelectric RAM, NOR flash or OTP ROM is also often
included on chip, as well as a small amount of RAM. Microcontrollers are designed
for embedded applications, in contrast to the microprocessors used in personal
computers or other general purpose applications consisting of various discrete
chips.

Microcontrollers are used in 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 systems. By
reducing the size and cost compared to a design that uses a separate
microprocessor, memory, and input/output devices, microcontrollers make it
economical to digitally control even more devices and processes. 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, sensing
and actuating the physical world as edge devices.

Some microcontrollers may use four-bit words and operate at frequencies as low as 4
kHz, for low power consumption (single-digit milliwatts or microwatts). They
generally have the ability to retain functionality while waiting for an 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.

Contents
1 History
1.1 World's smallest computer
1.2 Volumes and cost
2 Embedded design
2.1 Interrupts
2.2 Programs
2.3 Other microcontroller features
3 Higher integration
4 Programming environments
5 Types
6 Interrupt latency
7 Memory technology
7.1 Data
7.2 Firmware
8 See also
9 References
10 External links
History
The first microprocessor is usually claimed to be[1] the 4-bit Intel 4004 released
in 1972. It was followed by the 4-bit 4040, the 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. MOS Technology introduced sub-$100
microprocessors, the 6501 and 6502, with the chief aim of addressing this economic
obstacle, but these microprocessors still required external support, memory, and
peripheral chips which kept the total system cost in the hundreds of dollars.

One book credits 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.[2]

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.[3]

Partly in response to the existence of the single-chip TMS 1000,[4] Intel developed
a computer system on a chip optimized for control applications, the Intel 8048,
with commercial parts first shipping in 1977.[4] It combined RAM and 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%.

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 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.

In 1993, the introduction of EEPROM memory allowed microcontrollers (beginning with


the Microchip PIC16C84)[5] 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,[6] 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.[7] Other companies
rapidly followed suit, with both memory types.

Nowadays microcontrollers are cheap and readily available for hobbyists, with large
online communities around certain processors.

World's smallest computer


On 21 June 2018, the "world's smallest computer" was announced by the University of
Michigan. The device is a "0.04mm3 16nW wireless and batteryless sensor system with
integrated Cortex-M0+ processor and optical communication for cellular temperature
measurement." It "measures just 0.3 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 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."[8] The device is 1/10th the size of IBM's previously claimed world-record-
sized computer from months back in March 2018,[9] which is "smaller than a grain of
salt",[10] has a million transistors, costs less than $0.10 to manufacture, and,
combined with blockchain technology, is intended for logistics and �crypto-
anchors���digital fingerprints� applications.[11]

Volumes and cost


In 2002, about 55% of all CPUs sold in the world were 8-bit microcontrollers and
microprocessors.[12]

Over two billion 8-bit microcontrollers were sold in 1997,[13] and according to
Semico, over four billion 8-bit microcontrollers were sold in 2006.[14] More
recently, Semico has claimed the MCU market grew 36.5% in 2010 and 12% in 2011.[15]

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.

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. 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[16]
Cost to manufacture can be under $0.10 per unit.

Cost has plummeted over time, with the cheapest 8-bit microcontrollers being
available for under 0.03 USD in 2018,[17] and some 32-bit microcontrollers around
US$1 for similar quantities.

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 ($0.69 for 4-/8-bit,
$0.59 for 16-bit, $1.76 for 32-bit).[16]

In 2012, worldwide sales of 8-bit microcontrollers were around $4 billion, while 4-


bit microcontrollers also saw significant sales.[18]

In 2015, 8-bit microcontrollers could be bought for $0.311 (1,000 units),[19] 16-
bit for $0.385 (1,000 units),[20] and 32-bit for $0.378 (1,000 units, but at $0.35
for 5,000).[21]
In 2018, 8-bit microcontrollers can be bought for $0.03,[17] 16-bit for $0.393
(1,000 units, but at $0.563 for 100 or $0.349 for full reel of 2,000),[22] and 32-
bit for $0.503 (1,000 units, but at $0.466 for 5,000).[23] A lower-priced 32-bit
microcontroller, in units of one, can be had for $0.891.[24]

In 2018, the low-priced microcontrollers above from 2015 are all more expensive
(with inflation calculated between 2018 and 2015 prices for those specific units)
at: the 8-bit microcontroller can be bought for $0.319 (1,000 units) or 2.6%
higher,[19] the 16-bit one for $0.464 (1,000 units) or 21% higher,[20] and the 32-
bit one for $0.503 (1,000 units, but at $0.466 for 5,000) or 33% higher.[21]

A PIC 18F8720 microcontroller in an 80-pin TQFP package


Embedded design
A microcontroller can be considered a self-contained system with a processor,
memory and peripherals and can be used as an embedded system.[25] The majority of
microcontrollers in use today are embedded in other machinery, such as automobiles,
telephones, appliances, and peripherals for computer systems.

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, relays, solenoids,
LED's, small or custom liquid-crystal displays, 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.

Interrupts
Microcontrollers must provide 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.

Programs
Typically micro-controller 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 and assembly language codes into
a compact machine code for storage in the micro-controller'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 or erasable read-only
memory.

Manufacturers have often produced special versions of their micro-controllers 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.

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.

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.

Where hundreds of thousands of identical devices are required, using parts


programmed at the time of manufacture can be economical. These "mask programmed"
parts have the program laid down in the same way as the logic of the chip, at the
same time.

A customized micro-controller incorporates a block of digital logic that can be


personalized for additional processing capability, peripherals and interfaces that
are adapted to the requirements of the application. One example is the AT91CAP from
Atmel.

Other microcontroller features


Microcontrollers usually contain from several to dozens of general purpose
input/output pins (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.

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.

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, the heater on, etc.

A dedicated pulse-width modulation (PWM) block makes it possible for the CPU to
control power converters, resistive loads, motors, etc., without using lots of CPU
resources in tight timer loops.

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 (SPI), Universal Serial Bus (USB), and Ethernet.[26]

S-ar putea să vă placă și