<s>
A	O
microcontroller	B-Architecture
(	O
MCU	O
for	O
microcontroller	B-Architecture
unit	I-Architecture
,	O
also	O
MC	O
,	O
UC	O
,	O
or	O
μC	B-Architecture
)	O
is	O
a	O
small	O
computer	O
on	O
a	O
single	O
VLSI	O
integrated	O
circuit	O
(	O
IC	O
)	O
chip	O
.	O
</s>
<s>
A	O
microcontroller	B-Architecture
contains	O
one	O
or	O
more	O
CPUs	B-General_Concept
(	O
processor	O
cores	O
)	O
along	O
with	O
memory	B-General_Concept
and	O
programmable	O
input/output	B-General_Concept
peripherals	B-Device
.	O
</s>
<s>
Program	B-Device
memory	I-Device
in	O
the	O
form	O
of	O
ferroelectric	O
RAM	B-Architecture
,	O
NOR	O
flash	B-Device
or	O
OTP	B-General_Concept
ROM	I-General_Concept
is	O
also	O
often	O
included	O
on	O
chip	O
,	O
as	O
well	O
as	O
a	O
small	O
amount	O
of	O
RAM	B-Architecture
.	O
</s>
<s>
Microcontrollers	B-Architecture
are	O
designed	O
for	O
embedded	B-Architecture
applications	O
,	O
in	O
contrast	O
to	O
the	O
microprocessors	B-Architecture
used	O
in	O
personal	B-Device
computers	I-Device
or	O
other	O
general	O
purpose	O
applications	O
consisting	O
of	O
various	O
discrete	O
chips	O
.	O
</s>
<s>
In	O
modern	O
terminology	O
,	O
a	O
microcontroller	B-Architecture
is	O
similar	O
to	O
,	O
but	O
less	O
sophisticated	O
than	O
,	O
a	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
(	O
SoC	O
)	O
.	O
</s>
<s>
An	O
SoC	O
may	O
connect	O
the	O
external	O
microcontroller	B-Architecture
chips	O
as	O
the	O
motherboard	O
components	O
,	O
but	O
an	O
SoC	O
usually	O
integrates	O
the	O
advanced	O
peripherals	B-Device
like	O
graphics	B-Architecture
processing	I-Architecture
unit	I-Architecture
(	O
GPU	B-Architecture
)	O
and	O
Wi-Fi	O
interface	O
controller	O
as	O
its	O
internal	O
microcontroller	B-Architecture
unit	I-Architecture
circuits	O
.	O
</s>
<s>
Microcontrollers	B-Architecture
are	O
used	O
in	O
automatically	O
controlled	O
products	O
and	O
devices	O
,	O
such	O
as	O
automobile	O
engine	O
control	O
systems	O
,	O
implantable	O
medical	O
devices	O
,	O
remote	O
controls	O
,	O
office	O
machines	O
,	O
appliances	O
,	O
power	O
tools	O
,	O
toys	O
and	O
other	O
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
By	O
reducing	O
the	O
size	O
and	O
cost	O
compared	O
to	O
a	O
design	O
that	O
uses	O
a	O
separate	O
microprocessor	B-Architecture
,	O
memory	B-General_Concept
,	O
and	O
input/output	B-General_Concept
devices	I-General_Concept
,	O
microcontrollers	B-Architecture
make	O
it	O
economical	O
to	O
digitally	O
control	O
even	O
more	O
devices	O
and	O
processes	O
.	O
</s>
<s>
Mixed	O
signal	O
microcontrollers	B-Architecture
are	O
common	O
,	O
integrating	O
analog	O
components	O
needed	O
to	O
control	O
non-digital	O
electronic	O
systems	O
.	O
</s>
<s>
In	O
the	O
context	O
of	O
the	B-Operating_System
internet	I-Operating_System
of	I-Operating_System
things	I-Operating_System
,	O
microcontrollers	B-Architecture
are	O
an	O
economical	O
and	O
popular	O
means	O
of	O
data	O
collection	O
,	O
sensing	O
and	O
actuating	B-Algorithm
the	O
physical	O
world	O
as	O
edge	B-Device
devices	I-Device
.	O
</s>
<s>
Some	O
microcontrollers	B-Architecture
may	O
use	O
four-bit	O
words	O
and	O
operate	O
at	O
frequencies	O
as	O
low	O
as	O
for	O
low	O
power	O
consumption	O
(	O
single-digit	O
milliwatts	O
or	O
microwatts	O
)	O
.	O
</s>
<s>
They	O
generally	O
have	O
the	O
ability	O
to	O
retain	O
functionality	O
while	O
waiting	B-Device
for	O
an	O
event	B-Application
such	O
as	O
a	O
button	O
press	O
or	O
other	O
interrupt	B-Application
;	O
power	O
consumption	O
while	O
sleeping	O
(	O
CPU	B-General_Concept
clock	O
and	O
most	O
peripherals	B-Device
off	O
)	O
may	O
be	O
just	O
nanowatts	O
,	O
making	O
many	O
of	O
them	O
well	O
suited	O
for	O
long	O
lasting	O
battery	O
applications	O
.	O
</s>
<s>
Other	O
microcontrollers	B-Architecture
may	O
serve	O
performance-critical	O
roles	O
,	O
where	O
they	O
may	O
need	O
to	O
act	O
more	O
like	O
a	O
digital	B-Architecture
signal	I-Architecture
processor	I-Architecture
(	O
DSP	O
)	O
,	O
with	O
higher	O
clock	O
speeds	O
and	O
power	O
consumption	O
.	O
</s>
<s>
The	O
first	O
multi-chip	O
microprocessors	B-Architecture
,	O
the	O
Four-Phase	O
Systems	O
AL1	O
in	O
1969	O
and	O
the	O
Garrett	O
AiResearch	O
MP944	B-Device
in	O
1970	O
,	O
were	O
developed	O
with	O
multiple	O
MOS	O
LSI	O
chips	O
.	O
</s>
<s>
The	O
first	O
single-chip	O
microprocessor	B-Architecture
was	O
the	O
Intel	B-General_Concept
4004	I-General_Concept
,	O
released	O
on	O
a	O
single	O
MOS	O
LSI	O
chip	O
in	O
1971	O
.	O
</s>
<s>
It	O
was	O
developed	O
by	O
Federico	O
Faggin	O
,	O
using	O
his	O
silicon-gate	O
MOS	B-Architecture
technology	I-Architecture
,	O
along	O
with	O
Intel	O
engineers	O
Marcian	O
Hoff	O
and	O
Stan	O
Mazor	O
,	O
and	O
Busicom	O
engineer	O
Masatoshi	O
Shima	O
.	O
</s>
<s>
It	O
was	O
followed	O
by	O
the	O
4-bit	O
Intel	B-General_Concept
4040	I-General_Concept
,	O
the	O
8-bit	O
Intel	B-General_Concept
8008	I-General_Concept
,	O
and	O
the	O
8-bit	O
Intel	B-General_Concept
8080	I-General_Concept
.	O
</s>
<s>
All	O
of	O
these	O
processors	O
required	O
several	O
external	O
chips	O
to	O
implement	O
a	O
working	O
system	O
,	O
including	O
memory	B-General_Concept
and	O
peripheral	O
interface	O
chips	O
.	O
</s>
<s>
MOS	B-Architecture
Technology	I-Architecture
introduced	O
its	O
sub-	O
$100	O
microprocessors	B-Architecture
in	O
1975	O
,	O
the	O
6501	B-General_Concept
and	O
6502	B-General_Concept
.	O
</s>
<s>
Their	O
chief	O
aim	O
was	O
to	O
reduce	O
this	O
cost	O
barrier	O
but	O
these	O
microprocessors	B-Architecture
still	O
required	O
external	O
support	O
,	O
memory	B-General_Concept
,	O
and	O
peripheral	O
chips	O
which	O
kept	O
the	O
total	O
system	O
cost	O
in	O
the	O
hundreds	O
of	O
dollars	O
.	O
</s>
<s>
One	O
book	O
credits	O
TI	O
engineers	O
Gary	O
Boone	O
and	O
Michael	O
Cochran	O
with	O
the	O
successful	O
creation	O
of	O
the	O
first	O
microcontroller	B-Architecture
in	O
1971	O
.	O
</s>
<s>
The	O
result	O
of	O
their	O
work	O
was	O
the	O
TMS	B-Device
1000	I-Device
,	O
which	O
became	O
commercially	O
available	O
in	O
1974	O
.	O
</s>
<s>
It	O
combined	O
read-only	B-Device
memory	I-Device
,	O
read/write	O
memory	B-General_Concept
,	O
processor	O
and	O
clock	O
on	O
one	O
chip	O
and	O
was	O
targeted	O
at	O
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
During	O
the	O
early-to-mid-1970s	O
,	O
Japanese	O
electronics	O
manufacturers	O
began	O
producing	O
microcontrollers	B-Architecture
for	O
automobiles	O
,	O
including	O
4-bit	O
MCUs	B-General_Concept
for	O
in-car	O
entertainment	O
,	O
automatic	O
wipers	O
,	O
electronic	O
locks	O
,	O
and	O
dashboard	O
,	O
and	O
8-bit	O
MCUs	B-General_Concept
for	O
engine	O
control	O
.	O
</s>
<s>
Partly	O
in	O
response	O
to	O
the	O
existence	O
of	O
the	O
single-chip	O
TMS	B-Device
1000	I-Device
,	O
Intel	O
developed	O
a	O
computer	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
optimized	O
for	O
control	O
applications	O
,	O
the	O
Intel	B-Device
8048	I-Device
,	O
with	O
commercial	O
parts	O
first	O
shipping	O
in	O
1977	O
.	O
</s>
<s>
It	O
combined	O
RAM	B-Architecture
and	O
ROM	B-Device
on	O
the	O
same	O
chip	O
with	O
a	O
microprocessor	B-Architecture
.	O
</s>
<s>
At	O
that	O
time	O
Intel	O
's	O
President	O
,	O
Luke	O
J	O
.	O
Valenter	O
,	O
stated	O
that	O
the	O
microcontroller	B-Architecture
was	O
one	O
of	O
the	O
most	O
successful	O
products	O
in	O
the	O
company	O
's	O
history	O
,	O
and	O
he	O
expanded	O
the	O
microcontroller	B-Architecture
division	O
's	O
budget	O
by	O
over	O
25%	O
.	O
</s>
<s>
Most	O
microcontrollers	B-Architecture
at	O
this	O
time	O
had	O
concurrent	O
variants	O
.	O
</s>
<s>
One	O
had	O
EPROM	B-General_Concept
program	B-Device
memory	I-Device
,	O
with	O
a	O
transparent	O
quartz	O
window	O
in	O
the	O
lid	O
of	O
the	O
package	O
to	O
allow	O
it	O
to	O
be	O
erased	O
by	O
exposure	O
to	O
ultraviolet	B-Application
light	O
.	O
</s>
<s>
The	O
other	O
variant	O
was	O
either	O
a	O
mask	B-Device
programmed	I-Device
ROM	B-Device
or	O
a	O
PROM	B-General_Concept
variant	O
which	O
was	O
only	O
programmable	O
once	O
.	O
</s>
<s>
For	O
the	O
latter	O
,	O
sometimes	O
the	O
designation	O
OTP	O
was	O
used	O
,	O
standing	O
for	O
"	O
one-time	B-General_Concept
programmable	I-General_Concept
"	O
.	O
</s>
<s>
In	O
an	O
OTP	O
microcontroller	B-Architecture
,	O
the	O
PROM	B-General_Concept
was	O
usually	O
of	O
identical	O
type	O
as	O
the	O
EPROM	B-General_Concept
,	O
but	O
the	O
chip	O
package	O
had	O
no	O
quartz	O
window	O
;	O
because	O
there	O
was	O
no	O
way	O
to	O
expose	O
the	O
EPROM	B-General_Concept
to	O
ultraviolet	B-Application
light	O
,	O
it	O
could	O
not	O
be	O
erased	O
.	O
</s>
<s>
For	O
the	O
erasable	O
variants	O
,	O
quartz	O
was	O
required	O
,	O
instead	O
of	O
less	O
expensive	O
glass	O
,	O
for	O
its	O
transparency	O
to	O
ultraviolet	B-Application
light	O
—	O
to	O
which	O
glass	O
is	O
largely	O
opaque	O
—	O
but	O
the	O
main	O
cost	O
differentiator	O
was	O
the	O
ceramic	O
package	O
itself	O
.	O
</s>
<s>
In	O
1993	O
,	O
the	O
introduction	O
of	O
EEPROM	B-General_Concept
memory	B-General_Concept
allowed	O
microcontrollers	B-Architecture
(	O
beginning	O
with	O
the	O
Microchip	O
PIC16C84	B-Device
)	O
to	O
be	O
electrically	O
erased	O
quickly	O
without	O
an	O
expensive	O
package	O
as	O
required	O
for	O
EPROM	B-General_Concept
,	O
allowing	O
both	O
rapid	O
prototyping	O
,	O
and	O
in-system	B-Device
programming	I-Device
.	O
</s>
<s>
(	O
EEPROM	B-General_Concept
technology	O
had	O
been	O
available	O
prior	O
to	O
this	O
time	O
,	O
but	O
the	O
earlier	O
EEPROM	B-General_Concept
was	O
more	O
expensive	O
and	O
less	O
durable	O
,	O
making	O
it	O
unsuitable	O
for	O
low-cost	O
mass-produced	O
microcontrollers	B-Architecture
.	O
)	O
</s>
<s>
The	O
same	O
year	O
,	O
Atmel	O
introduced	O
the	O
first	O
microcontroller	B-Architecture
using	O
Flash	B-Device
memory	I-Device
,	O
a	O
special	O
type	O
of	O
EEPROM	B-General_Concept
.	O
</s>
<s>
Other	O
companies	O
rapidly	O
followed	O
suit	O
,	O
with	O
both	O
memory	B-General_Concept
types	O
.	O
</s>
<s>
Nowadays	O
microcontrollers	B-Architecture
are	O
cheap	O
and	O
readily	O
available	O
for	O
hobbyists	O
,	O
with	O
large	O
online	O
communities	O
around	O
certain	O
processors	O
.	O
</s>
<s>
In	O
2002	O
,	O
about	O
55%	O
of	O
all	O
CPUs	B-General_Concept
sold	O
in	O
the	O
world	O
were	O
8-bit	O
microcontrollers	B-Architecture
and	O
microprocessors	B-Architecture
.	O
</s>
<s>
Over	O
two	O
billion	O
8-bit	O
microcontrollers	B-Architecture
were	O
sold	O
in	O
1997	O
,	O
and	O
according	O
to	O
Semico	O
,	O
over	O
four	O
billion	O
8-bit	O
microcontrollers	B-Architecture
were	O
sold	O
in	O
2006	O
.	O
</s>
<s>
A	O
typical	O
home	O
in	O
a	O
developed	O
country	O
is	O
likely	O
to	O
have	O
only	O
four	O
general-purpose	O
microprocessors	B-Architecture
but	O
around	O
three	O
dozen	O
microcontrollers	B-Architecture
.	O
</s>
<s>
A	O
typical	O
mid-range	O
automobile	O
has	O
about	O
30	O
microcontrollers	B-Architecture
.	O
</s>
<s>
Cost	O
has	O
plummeted	O
over	O
time	O
,	O
with	O
the	O
cheapest	O
8-bit	O
microcontrollers	B-Architecture
being	O
available	O
for	O
under	O
in	O
2018	O
,	O
and	O
some	O
32-bit	O
microcontrollers	B-Architecture
around	O
for	O
similar	O
quantities	O
.	O
</s>
<s>
In	O
2012	O
,	O
following	O
a	O
global	O
crisis	O
—	O
a	O
worst	O
ever	O
annual	O
sales	O
decline	O
and	O
recovery	O
and	O
average	O
sales	O
price	O
year-over-year	O
plunging	O
17%	O
—	O
the	O
biggest	O
reduction	O
since	O
the	O
1980s	O
—	O
the	O
average	O
price	O
for	O
a	O
microcontroller	B-Architecture
was	O
(	O
for	O
4-/8	O
-bit	O
,	O
for	O
16-bit	O
,	O
for	O
32-bit	O
)	O
.	O
</s>
<s>
In	O
2012	O
,	O
worldwide	O
sales	O
of	O
8-bit	O
microcontrollers	B-Architecture
were	O
around	O
,	O
while	O
4-bit	O
microcontrollers	B-Architecture
also	O
saw	O
significant	O
sales	O
.	O
</s>
<s>
In	O
2015	O
,	O
8-bit	O
microcontrollers	B-Architecture
could	O
be	O
bought	O
for	O
(	O
1,000	O
units	O
)	O
,	O
16-bit	O
for	O
(	O
1,000	O
units	O
)	O
,	O
and	O
32-bit	O
for	O
(	O
1,000	O
units	O
,	O
but	O
at	O
for	O
5,000	O
)	O
.	O
</s>
<s>
In	O
2018	O
,	O
8-bit	O
microcontrollers	B-Architecture
could	O
be	O
bought	O
for	O
,	O
16-bit	O
for	O
(	O
1,000	O
units	O
,	O
but	O
at	O
for	O
100	O
or	O
for	O
full	O
reel	O
of	O
2,000	O
)	O
,	O
and	O
32-bit	O
for	O
(	O
1,000	O
units	O
,	O
but	O
at	O
for	O
5,000	O
)	O
.	O
</s>
<s>
In	O
2018	O
,	O
the	O
low-priced	O
microcontrollers	B-Architecture
above	O
from	O
2015	O
were	O
all	O
more	O
expensive	O
(	O
with	O
inflation	O
calculated	O
between	O
2018	O
and	O
2015	O
prices	O
for	O
those	O
specific	O
units	O
)	O
at	O
:	O
the	O
8-bit	O
microcontroller	B-Architecture
could	O
be	O
bought	O
for	O
(	O
1,000	O
units	O
)	O
or	O
2.6	O
%	O
higher	O
,	O
the	O
16-bit	O
one	O
for	O
(	O
1,000	O
units	O
)	O
or	O
21%	O
higher	O
,	O
and	O
the	O
32-bit	O
one	O
for	O
(	O
1,000	O
units	O
,	O
but	O
at	O
for	O
5,000	O
)	O
or	O
33%	O
higher	O
.	O
</s>
<s>
 [ ... ] 	O
In	O
addition	O
to	O
the	O
RAM	B-Architecture
and	O
photovoltaics	O
,	O
the	O
new	O
computing	O
devices	O
have	O
processors	O
and	O
wireless	B-General_Concept
transmitters	I-General_Concept
and	I-General_Concept
receivers	I-General_Concept
.	O
</s>
<s>
The	O
device	O
is	O
th	O
the	O
size	O
of	O
IBM	O
's	O
previously	O
claimed	O
world-record-sized	O
computer	O
from	O
months	O
back	O
in	O
March	O
2018	O
,	O
which	O
is	O
"	O
smaller	O
than	O
a	O
grain	O
of	O
salt	O
"	O
,	O
has	O
a	O
million	O
transistors	O
,	O
costs	O
less	O
than	O
to	O
manufacture	O
,	O
and	O
,	O
combined	O
with	O
blockchain	B-Application
technology	I-Application
,	O
is	O
intended	O
for	O
logistics	O
and	O
"	O
crypto-anchors	O
"	O
—	O
digital	B-Algorithm
fingerprint	I-Algorithm
applications	O
.	O
</s>
<s>
A	O
microcontroller	B-Architecture
can	O
be	O
considered	O
a	O
self-contained	O
system	O
with	O
a	O
processor	O
,	O
memory	B-General_Concept
and	O
peripherals	B-Device
and	O
can	O
be	O
used	O
as	O
an	O
embedded	B-Architecture
system	I-Architecture
.	O
</s>
<s>
The	O
majority	O
of	O
microcontrollers	B-Architecture
in	O
use	O
today	O
are	O
embedded	B-Architecture
in	O
other	O
machinery	O
,	O
such	O
as	O
automobiles	O
,	O
telephones	O
,	O
appliances	O
,	O
and	O
peripherals	B-Device
for	O
computer	O
systems	O
.	O
</s>
<s>
While	O
some	O
embedded	B-Architecture
systems	I-Architecture
are	O
very	O
sophisticated	O
,	O
many	O
have	O
minimal	O
requirements	O
for	O
memory	B-General_Concept
and	O
program	B-Application
length	O
,	O
with	O
no	O
operating	B-General_Concept
system	I-General_Concept
,	O
and	O
low	O
software	O
complexity	O
.	O
</s>
<s>
Typical	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
devices	O
include	O
switches	O
,	O
relays	O
,	O
solenoids	B-Algorithm
,	O
LED	O
's	O
,	O
small	O
or	O
custom	O
liquid-crystal	B-Device
displays	I-Device
,	O
radio	O
frequency	O
devices	O
,	O
and	O
sensors	O
for	O
data	O
such	O
as	O
temperature	O
,	O
humidity	O
,	O
light	O
level	O
etc	O
.	O
</s>
<s>
Embedded	B-Architecture
systems	I-Architecture
usually	O
have	O
no	O
keyboard	O
,	O
screen	O
,	O
disks	O
,	O
printers	O
,	O
or	O
other	O
recognizable	O
I/O	B-General_Concept
devices	I-General_Concept
of	O
a	O
personal	B-Device
computer	I-Device
,	O
and	O
may	O
lack	O
human	O
interaction	O
devices	O
of	O
any	O
kind	O
.	O
</s>
<s>
Microcontrollers	B-Architecture
must	O
provide	O
real-time	B-General_Concept
(	O
predictable	O
,	O
though	O
not	O
necessarily	O
fast	O
)	O
response	O
to	O
events	O
in	O
the	O
embedded	B-Architecture
system	I-Architecture
they	O
are	O
controlling	O
.	O
</s>
<s>
When	O
certain	O
events	O
occur	O
,	O
an	O
interrupt	B-Application
system	O
can	O
signal	O
the	O
processor	O
to	O
suspend	O
processing	O
the	O
current	O
instruction	O
sequence	O
and	O
to	O
begin	O
an	O
interrupt	B-General_Concept
service	I-General_Concept
routine	I-General_Concept
(	O
ISR	O
,	O
or	O
"	O
interrupt	B-General_Concept
handler	I-General_Concept
"	O
)	O
which	O
will	O
perform	O
any	O
processing	O
required	O
based	O
on	O
the	O
source	O
of	O
the	O
interrupt	B-Application
,	O
before	O
returning	O
to	O
the	O
original	O
instruction	O
sequence	O
.	O
</s>
<s>
Possible	O
interrupt	B-Application
sources	O
are	O
device	O
dependent	O
,	O
and	O
often	O
include	O
events	O
such	O
as	O
an	O
internal	O
timer	O
overflow	O
,	O
completing	O
an	O
analog	O
to	O
digital	O
conversion	O
,	O
a	O
logic	O
level	O
change	O
on	O
an	O
input	O
such	O
as	O
from	O
a	O
button	O
being	O
pressed	O
,	O
and	O
data	O
received	O
on	O
a	O
communication	O
link	O
.	O
</s>
<s>
Where	O
power	O
consumption	O
is	O
important	O
as	O
in	O
battery	O
devices	O
,	O
interrupts	B-Application
may	O
also	O
wake	O
a	O
microcontroller	B-Architecture
from	O
a	O
low-power	O
sleep	O
state	O
where	O
the	O
processor	O
is	O
halted	O
until	O
required	O
to	O
do	O
something	O
by	O
a	O
peripheral	O
event	B-Application
.	O
</s>
<s>
Typically	O
micro-controller	B-Architecture
programs	O
must	O
fit	O
in	O
the	O
available	O
on-chip	O
memory	B-General_Concept
,	O
since	O
it	O
would	O
be	O
costly	O
to	O
provide	O
a	O
system	O
with	O
external	O
,	O
expandable	O
memory	B-General_Concept
.	O
</s>
<s>
Compilers	B-Language
and	O
assemblers	B-Language
are	O
used	O
to	O
convert	O
both	O
high-level	B-Language
and	O
assembly	B-Language
language	I-Language
code	O
into	O
a	O
compact	O
machine	B-Language
code	I-Language
for	O
storage	O
in	O
the	O
micro-controller	B-Architecture
'	O
s	O
memory	B-General_Concept
.	O
</s>
<s>
Depending	O
on	O
the	O
device	O
,	O
the	O
program	B-Device
memory	I-Device
may	O
be	O
permanent	O
,	O
read-only	B-Device
memory	I-Device
that	O
can	O
only	O
be	O
programmed	O
at	O
the	O
factory	O
,	O
or	O
it	O
may	O
be	O
field-alterable	O
flash	B-Device
or	O
erasable	O
read-only	B-Device
memory	I-Device
.	O
</s>
<s>
Manufacturers	O
have	O
often	O
produced	O
special	O
versions	O
of	O
their	O
micro-controllers	B-Architecture
in	O
order	O
to	O
help	O
the	O
hardware	O
and	O
software	O
development	O
of	O
the	O
target	O
system	O
.	O
</s>
<s>
Originally	O
these	O
included	O
EPROM	B-General_Concept
versions	O
that	O
have	O
a	O
"	O
window	O
"	O
on	O
the	O
top	O
of	O
the	O
device	O
through	O
which	O
program	B-Device
memory	I-Device
can	O
be	O
erased	O
by	O
ultraviolet	B-Application
light	O
,	O
ready	O
for	O
reprogramming	O
after	O
a	O
programming	O
(	O
"	O
burn	O
"	O
)	O
and	O
test	O
cycle	O
.	O
</s>
<s>
Since	O
1998	O
,	O
EPROM	B-General_Concept
versions	O
are	O
rare	O
and	O
have	O
been	O
replaced	O
by	O
EEPROM	B-General_Concept
and	O
flash	B-Device
,	O
which	O
are	O
easier	O
to	O
use	O
(	O
can	O
be	O
erased	O
electronically	O
)	O
and	O
cheaper	O
to	O
manufacture	O
.	O
</s>
<s>
Other	O
versions	O
may	O
be	O
available	O
where	O
the	O
ROM	B-Device
is	O
accessed	O
as	O
an	O
external	B-Device
device	I-Device
rather	O
than	O
as	O
internal	O
memory	B-General_Concept
,	O
however	O
these	O
are	O
becoming	O
rare	O
due	O
to	O
the	O
widespread	O
availability	O
of	O
cheap	O
microcontroller	B-Architecture
programmers	O
.	O
</s>
<s>
The	O
use	O
of	O
field-programmable	O
devices	O
on	O
a	O
micro	B-Architecture
controller	I-Architecture
may	O
allow	O
field	O
update	O
of	O
the	O
firmware	B-Application
or	O
permit	O
late	O
factory	O
revisions	O
to	O
products	O
that	O
have	O
been	O
assembled	O
but	O
not	O
yet	O
shipped	O
.	O
</s>
<s>
Programmable	O
memory	B-General_Concept
also	O
reduces	O
the	O
lead	O
time	O
required	O
for	O
deployment	O
of	O
a	O
new	O
product	O
.	O
</s>
<s>
These	O
"	O
mask	B-Device
programmed	I-Device
"	O
parts	O
have	O
the	O
program	B-Application
laid	O
down	O
in	O
the	O
same	O
way	O
as	O
the	O
logic	O
of	O
the	O
chip	O
,	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
A	O
customized	O
micro-controller	B-Architecture
incorporates	O
a	O
block	O
of	O
digital	O
logic	O
that	O
can	O
be	O
personalized	O
for	O
additional	O
processing	O
capability	O
,	O
peripherals	B-Device
and	O
interfaces	B-Protocol
that	O
are	O
adapted	O
to	O
the	O
requirements	O
of	O
the	O
application	O
.	O
</s>
<s>
One	O
example	O
is	O
the	O
AT91CAP	B-Device
from	O
Atmel	O
.	O
</s>
<s>
Microcontrollers	B-Architecture
usually	O
contain	O
from	O
several	O
to	O
dozens	O
of	O
general	B-Architecture
purpose	I-Architecture
input/output	I-Architecture
pins	O
(	O
GPIO	B-Architecture
)	O
.	O
</s>
<s>
GPIO	B-Architecture
pins	O
are	O
software	O
configurable	O
to	O
either	O
an	O
input	O
or	O
an	O
output	O
state	O
.	O
</s>
<s>
When	O
GPIO	B-Architecture
pins	O
are	O
configured	O
to	O
an	O
input	O
state	O
,	O
they	O
are	O
often	O
used	O
to	O
read	O
sensors	O
or	O
external	O
signals	O
.	O
</s>
<s>
Configured	O
to	O
the	O
output	O
state	O
,	O
GPIO	B-Architecture
pins	O
can	O
drive	O
external	B-Device
devices	I-Device
such	O
as	O
LEDs	O
or	O
motors	O
,	O
often	O
indirectly	O
,	O
through	O
external	O
power	O
electronics	O
.	O
</s>
<s>
Many	O
embedded	B-Architecture
systems	I-Architecture
need	O
to	O
read	O
sensors	O
that	O
produce	O
analog	O
signals	O
.	O
</s>
<s>
A	O
less	O
common	O
feature	O
on	O
some	O
microcontrollers	B-Architecture
is	O
a	O
digital-to-analog	O
converter	O
(	O
DAC	O
)	O
that	O
allows	O
the	O
processor	O
to	O
output	O
analog	O
signals	O
or	O
voltage	O
levels	O
.	O
</s>
<s>
In	O
addition	O
to	O
the	O
converters	O
,	O
many	O
embedded	B-Architecture
microprocessors	I-Architecture
include	O
a	O
variety	O
of	O
timers	O
as	O
well	O
.	O
</s>
<s>
One	O
of	O
the	O
most	O
common	O
types	O
of	O
timers	O
is	O
the	O
programmable	B-Device
interval	I-Device
timer	I-Device
(	O
PIT	O
)	O
.	O
</s>
<s>
Once	O
it	O
reaches	O
zero	O
,	O
it	O
sends	O
an	O
interrupt	B-Application
to	O
the	O
processor	O
indicating	O
that	O
it	O
has	O
finished	O
counting	O
.	O
</s>
<s>
A	O
dedicated	O
pulse-width	B-Algorithm
modulation	I-Algorithm
(	O
PWM	O
)	O
block	O
makes	O
it	O
possible	O
for	O
the	O
CPU	B-General_Concept
to	O
control	O
power	O
converters	O
,	O
resistive	O
loads	O
,	O
motors	O
,	O
etc.	O
,	O
without	O
using	O
many	O
CPU	B-General_Concept
resources	O
in	O
tight	O
timer	O
loops	O
.	O
</s>
<s>
A	O
universal	O
asynchronous	O
receiver/transmitter	O
(	O
UART	O
)	O
block	O
makes	O
it	O
possible	O
to	O
receive	O
and	O
transmit	O
data	O
over	O
a	O
serial	B-Protocol
line	I-Protocol
with	O
very	O
little	O
load	O
on	O
the	O
CPU	B-General_Concept
.	O
</s>
<s>
Dedicated	O
on-chip	O
hardware	O
also	O
often	O
includes	O
capabilities	O
to	O
communicate	O
with	O
other	O
devices	O
(	O
chips	O
)	O
in	O
digital	O
formats	O
such	O
as	O
Inter-Integrated	O
Circuit	O
(	O
I²C	O
)	O
,	O
Serial	B-Architecture
Peripheral	I-Architecture
Interface	I-Architecture
(	O
SPI	B-Architecture
)	O
,	O
Universal	O
Serial	O
Bus	O
(	O
USB	B-Protocol
)	O
,	O
and	O
Ethernet	O
.	O
</s>
<s>
Micro-controllers	B-Architecture
may	O
not	O
implement	O
an	O
external	O
address	O
or	O
data	O
bus	O
as	O
they	O
integrate	O
RAM	B-Architecture
and	O
non-volatile	B-General_Concept
memory	I-General_Concept
on	O
the	O
same	O
chip	O
as	O
the	O
CPU	B-General_Concept
.	O
</s>
<s>
Integrating	O
the	O
memory	B-General_Concept
and	O
other	O
peripherals	B-Device
on	O
a	O
single	O
chip	O
and	O
testing	O
them	O
as	O
a	O
unit	O
increases	O
the	O
cost	O
of	O
that	O
chip	O
,	O
but	O
often	O
results	O
in	O
decreased	O
net	O
cost	O
of	O
the	O
embedded	B-Architecture
system	I-Architecture
as	O
a	O
whole	O
.	O
</s>
<s>
Even	O
if	O
the	O
cost	O
of	O
a	O
CPU	B-General_Concept
that	O
has	O
integrated	O
peripherals	B-Device
is	O
slightly	O
more	O
than	O
the	O
cost	O
of	O
a	O
CPU	B-General_Concept
and	O
external	O
peripherals	B-Device
,	O
having	O
fewer	O
chips	O
typically	O
allows	O
a	O
smaller	O
and	O
cheaper	O
circuit	O
board	O
,	O
and	O
reduces	O
the	O
labor	O
required	O
to	O
assemble	O
and	O
test	O
the	O
circuit	O
board	O
,	O
in	O
addition	O
to	O
tending	O
to	O
decrease	O
the	O
defect	O
rate	O
for	O
the	O
finished	O
assembly	O
.	O
</s>
<s>
A	O
micro-controller	B-Architecture
is	O
a	O
single	O
integrated	O
circuit	O
,	O
commonly	O
with	O
the	O
following	O
features	O
:	O
</s>
<s>
Furthermore	O
,	O
on	O
low	O
pin	O
count	O
devices	O
in	O
particular	O
,	O
each	O
pin	O
may	O
interface	O
to	O
several	O
internal	O
peripherals	B-Device
,	O
with	O
the	O
pin	O
function	O
selected	O
by	O
software	O
.	O
</s>
<s>
Micro-controllers	B-Architecture
have	O
proved	O
to	O
be	O
highly	O
popular	O
in	O
embedded	B-Architecture
systems	I-Architecture
since	O
their	O
introduction	O
in	O
the	O
1970s	O
.	O
</s>
<s>
Some	O
microcontrollers	B-Architecture
use	O
a	O
Harvard	B-Architecture
architecture	I-Architecture
:	O
separate	O
memory	B-General_Concept
buses	O
for	O
instructions	O
and	O
data	O
,	O
allowing	O
accesses	O
to	O
take	O
place	O
concurrently	O
.	O
</s>
<s>
Where	O
a	O
Harvard	B-Architecture
architecture	I-Architecture
is	O
used	O
,	O
instruction	O
words	O
for	O
the	O
processor	O
may	O
be	O
a	O
different	O
bit	O
size	O
than	O
the	O
length	O
of	O
internal	O
memory	B-General_Concept
and	O
registers	O
;	O
for	O
example	O
:	O
12-bit	O
instructions	O
used	O
with	O
8-bit	O
data	O
registers	O
.	O
</s>
<s>
The	O
microcontroller	B-Architecture
vendors	O
often	O
trade	O
operating	O
frequencies	O
and	O
system	O
design	O
flexibility	O
against	O
time-to-market	O
requirements	O
from	O
their	O
customers	O
and	O
overall	O
lower	O
system	O
cost	O
.	O
</s>
<s>
Microcontroller	B-Architecture
architectures	O
vary	O
widely	O
.	O
</s>
<s>
Some	O
designs	O
include	O
general-purpose	O
microprocessor	B-Architecture
cores	O
,	O
with	O
one	O
or	O
more	O
ROM	B-Device
,	O
RAM	B-Architecture
,	O
or	O
I/O	B-General_Concept
functions	O
integrated	O
onto	O
the	O
package	O
.	O
</s>
<s>
A	O
micro-controller	B-Architecture
instruction	O
set	O
usually	O
has	O
many	O
instructions	O
intended	O
for	O
bit	B-Algorithm
manipulation	I-Algorithm
(	O
bit-wise	O
operations	O
)	O
to	O
make	O
control	O
programs	O
more	O
compact	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
general	O
purpose	O
processor	O
might	O
require	O
several	O
instructions	O
to	O
test	O
a	O
bit	O
in	O
a	O
register	O
and	O
branch	O
if	O
the	O
bit	O
is	O
set	O
,	O
where	O
a	O
micro-controller	B-Architecture
could	O
have	O
a	O
single	O
instruction	O
to	O
provide	O
that	O
commonly	O
required	O
function	O
.	O
</s>
<s>
Microcontrollers	B-Architecture
traditionally	O
do	O
not	O
have	O
a	O
math	B-General_Concept
coprocessor	I-General_Concept
,	O
so	O
floating-point	B-Algorithm
arithmetic	I-Algorithm
is	O
performed	O
by	O
software	O
.	O
</s>
<s>
An	O
example	O
would	O
be	O
Microchip	O
's	O
PIC32	O
MIPS	B-Device
based	O
line	O
.	O
</s>
<s>
Microcontrollers	B-Architecture
were	O
originally	O
programmed	O
only	O
in	O
assembly	B-Language
language	I-Language
,	O
but	O
various	O
high-level	B-Language
programming	I-Language
languages	I-Language
,	O
such	O
as	O
C	B-Language
,	O
Python	B-Language
and	O
JavaScript	B-Language
,	O
are	O
now	O
also	O
in	O
common	O
use	O
to	O
target	O
microcontrollers	B-Architecture
and	O
embedded	B-Architecture
systems	I-Architecture
.	O
</s>
<s>
Compilers	B-Language
for	O
general	O
purpose	O
languages	O
will	O
typically	O
have	O
some	O
restrictions	O
as	O
well	O
as	O
enhancements	O
to	O
better	O
support	O
the	O
unique	O
characteristics	O
of	O
microcontrollers	B-Architecture
.	O
</s>
<s>
Some	O
microcontrollers	B-Architecture
have	O
environments	O
to	O
aid	O
developing	O
certain	O
types	O
of	O
applications	O
.	O
</s>
<s>
Microcontroller	B-Architecture
vendors	O
often	O
make	O
tools	O
freely	O
available	O
to	O
make	O
it	O
easier	O
to	O
adopt	O
their	O
hardware	O
.	O
</s>
<s>
Microcontrollers	B-Architecture
with	O
specialty	O
hardware	O
may	O
require	O
their	O
own	O
non-standard	O
dialects	O
of	O
C	B-Language
,	O
such	O
as	O
SDCC	B-Application
for	I-Application
the	I-Application
8051	I-Application
,	O
which	O
prevent	O
using	O
standard	O
tools	O
(	O
such	O
as	O
code	O
libraries	O
or	O
static	O
analysis	O
tools	O
)	O
even	O
for	O
code	O
unrelated	O
to	O
hardware	O
features	O
.	O
</s>
<s>
Interpreters	B-Application
may	O
also	O
contain	O
nonstandard	O
features	O
,	O
such	O
as	O
MicroPython	B-Language
,	O
although	O
a	O
fork	O
,	O
CircuitPython	B-Device
,	O
has	O
looked	O
to	O
move	O
hardware	O
dependencies	O
to	O
libraries	O
and	O
have	O
the	O
language	O
adhere	O
to	O
a	O
more	O
CPython	B-Language
standard	O
.	O
</s>
<s>
Interpreter	B-Application
firmware	B-Application
is	O
also	O
available	O
for	O
some	O
microcontrollers	B-Architecture
.	O
</s>
<s>
For	O
example	O
,	O
BASIC	B-Language
on	O
the	O
early	O
microcontrollers	B-Architecture
Intel	B-Architecture
8052	I-Architecture
;	O
BASIC	B-Language
and	O
FORTH	B-Application
on	O
the	O
Zilog	B-Device
Z8	I-Device
as	O
well	O
as	O
some	O
modern	O
devices	O
.	O
</s>
<s>
Typically	O
these	O
interpreters	B-Application
support	O
interactive	B-Application
programming	I-Application
.	O
</s>
<s>
Simulators	O
are	O
available	O
for	O
some	O
microcontrollers	B-Architecture
.	O
</s>
<s>
These	O
allow	O
a	O
developer	O
to	O
analyze	O
what	O
the	O
behavior	O
of	O
the	O
microcontroller	B-Architecture
and	O
their	O
program	B-Application
should	O
be	O
if	O
they	O
were	O
using	O
the	O
actual	O
part	O
.	O
</s>
<s>
While	O
on	O
the	O
one	O
hand	O
most	O
simulators	O
will	O
be	O
limited	O
from	O
being	O
unable	O
to	O
simulate	O
much	O
other	O
hardware	O
in	O
a	O
system	O
,	O
they	O
can	O
exercise	O
conditions	O
that	O
may	O
otherwise	O
be	O
hard	O
to	O
reproduce	O
at	O
will	O
in	O
the	O
physical	O
implementation	O
,	O
and	O
can	O
be	O
the	O
quickest	O
way	O
to	O
debug	B-Device
and	O
analyze	O
problems	O
.	O
</s>
<s>
Recent	O
microcontrollers	B-Architecture
are	O
often	O
integrated	O
with	O
on-chip	O
debug	B-Device
circuitry	O
that	O
when	O
accessed	O
by	O
an	O
in-circuit	B-Application
emulator	I-Application
(	O
ICE	O
)	O
via	O
JTAG	O
,	O
allow	O
debugging	O
of	O
the	O
firmware	B-Application
with	O
a	O
debugger	B-Application
.	O
</s>
<s>
A	O
real-time	B-General_Concept
ICE	O
may	O
allow	O
viewing	O
and/or	O
manipulating	O
of	O
internal	O
states	O
while	O
running	O
.	O
</s>
<s>
A	O
tracing	O
ICE	O
can	O
record	O
executed	O
program	B-Application
and	O
MCU	O
states	O
before/after	O
a	O
trigger	O
point	O
.	O
</s>
<s>
,	O
there	O
are	O
several	O
dozen	O
microcontroller	B-Architecture
architectures	O
and	O
vendors	O
including	O
:	O
</s>
<s>
Many	O
others	O
exist	O
,	O
some	O
of	O
which	O
are	O
used	O
in	O
very	O
narrow	O
range	O
of	O
applications	O
or	O
are	O
more	O
like	O
applications	O
processors	O
than	O
microcontrollers	B-Architecture
.	O
</s>
<s>
The	O
microcontroller	B-Architecture
market	O
is	O
extremely	O
fragmented	O
,	O
with	O
numerous	O
vendors	O
,	O
technologies	O
,	O
and	O
markets	O
.	O
</s>
<s>
In	O
contrast	O
to	O
general-purpose	O
computers	O
,	O
microcontrollers	B-Architecture
used	O
in	O
embedded	B-Architecture
systems	I-Architecture
often	O
seek	O
to	O
optimize	O
interrupt	B-General_Concept
latency	I-General_Concept
over	O
instruction	O
throughput	O
.	O
</s>
<s>
Issues	O
include	O
both	O
reducing	O
the	O
latency	O
,	O
and	O
making	O
it	O
be	O
more	O
predictable	O
(	O
to	O
support	O
real-time	B-General_Concept
control	I-General_Concept
)	O
.	O
</s>
<s>
When	O
an	O
electronic	O
device	O
causes	O
an	O
interrupt	B-Application
,	O
during	O
the	O
context	B-Operating_System
switch	I-Operating_System
the	O
intermediate	O
results	O
(	O
registers	O
)	O
have	O
to	O
be	O
saved	O
before	O
the	O
software	O
responsible	O
for	O
handling	O
the	O
interrupt	B-Application
can	O
run	O
.	O
</s>
<s>
They	O
must	O
also	O
be	O
restored	O
after	O
that	O
interrupt	B-General_Concept
handler	I-General_Concept
is	O
finished	O
.	O
</s>
<s>
If	O
there	O
are	O
more	O
processor	B-General_Concept
registers	I-General_Concept
,	O
this	O
saving	O
and	O
restoring	O
process	O
may	O
take	O
more	O
time	O
,	O
increasing	O
the	O
latency	O
.	O
</s>
<s>
Ways	O
to	O
reduce	O
such	O
context/restore	O
latency	O
include	O
having	O
relatively	O
few	O
registers	O
in	O
their	O
central	B-General_Concept
processing	I-General_Concept
units	I-General_Concept
(	O
undesirable	O
because	O
it	O
slows	O
down	O
most	O
non-interrupt	O
processing	O
substantially	O
)	O
,	O
or	O
at	O
least	O
having	O
the	O
hardware	O
not	O
save	O
them	O
all	O
(	O
this	O
fails	O
if	O
the	O
software	O
then	O
needs	O
to	O
compensate	O
by	O
saving	O
the	O
rest	O
"	O
manually	O
"	O
)	O
.	O
</s>
<s>
Another	O
technique	O
involves	O
spending	O
silicon	O
gates	O
on	O
"	O
shadow	O
registers	O
"	O
:	O
One	O
or	O
more	O
duplicate	O
registers	O
used	O
only	O
by	O
the	O
interrupt	B-Application
software	O
,	O
perhaps	O
supporting	O
a	O
dedicated	O
stack	O
.	O
</s>
<s>
Other	O
factors	O
affecting	O
interrupt	B-General_Concept
latency	I-General_Concept
include	O
:	O
</s>
<s>
Cycles	O
needed	O
to	O
complete	O
current	O
CPU	B-General_Concept
activities	O
.	O
</s>
<s>
To	O
minimize	O
those	O
costs	O
,	O
microcontrollers	B-Architecture
tend	O
to	O
have	O
short	O
pipelines	O
(	O
often	O
three	O
instructions	O
or	O
less	O
)	O
,	O
small	O
write	O
buffers	O
,	O
and	O
ensure	O
that	O
longer	O
instructions	O
are	O
continuable	O
or	O
restartable	O
.	O
</s>
<s>
RISC	B-Architecture
design	O
principles	O
ensure	O
that	O
most	O
instructions	O
take	O
the	O
same	O
number	O
of	O
cycles	O
,	O
helping	O
avoid	O
the	O
need	O
for	O
most	O
such	O
continuation/restart	O
logic	O
.	O
</s>
<s>
The	O
length	O
of	O
any	O
critical	B-Operating_System
section	I-Operating_System
that	O
needs	O
to	O
be	O
interrupted	O
.	O
</s>
<s>
Entry	O
to	O
a	O
critical	B-Operating_System
section	I-Operating_System
restricts	O
concurrent	O
data	O
structure	O
access	O
.	O
</s>
<s>
When	O
a	O
data	O
structure	O
must	O
be	O
accessed	O
by	O
an	O
interrupt	B-General_Concept
handler	I-General_Concept
,	O
the	O
critical	B-Operating_System
section	I-Operating_System
must	O
block	O
that	O
interrupt	B-Application
.	O
</s>
<s>
Accordingly	O
,	O
interrupt	B-General_Concept
latency	I-General_Concept
is	O
increased	O
by	O
however	O
long	O
that	O
interrupt	B-Application
is	O
blocked	O
.	O
</s>
<s>
When	O
there	O
are	O
hard	O
external	O
constraints	O
on	O
system	O
latency	O
,	O
developers	O
often	O
need	O
tools	O
to	O
measure	O
interrupt	B-General_Concept
latencies	I-General_Concept
and	O
track	O
down	O
which	O
critical	B-Operating_System
sections	I-Operating_System
cause	O
slowdowns	O
.	O
</s>
<s>
One	O
common	O
technique	O
just	O
blocks	O
all	O
interrupts	B-Application
for	O
the	O
duration	O
of	O
the	O
critical	B-Operating_System
section	I-Operating_System
.	O
</s>
<s>
This	O
is	O
easy	O
to	O
implement	O
,	O
but	O
sometimes	O
critical	B-Operating_System
sections	I-Operating_System
get	O
uncomfortably	O
long	O
.	O
</s>
<s>
A	O
more	O
complex	O
technique	O
just	O
blocks	O
the	O
interrupts	B-Application
that	O
may	O
trigger	O
access	O
to	O
that	O
data	O
structure	O
.	O
</s>
<s>
This	O
is	O
often	O
based	O
on	O
interrupt	B-Application
priorities	O
,	O
which	O
tend	O
to	O
not	O
correspond	O
well	O
to	O
the	O
relevant	O
system	O
data	O
structures	O
.	O
</s>
<s>
Processors	O
may	O
have	O
hardware	O
support	O
for	O
some	O
critical	B-Operating_System
sections	I-Operating_System
.	O
</s>
<s>
Examples	O
include	O
supporting	O
atomic	O
access	O
to	O
bits	O
or	O
bytes	O
within	O
a	O
word	O
,	O
or	O
other	O
atomic	O
access	O
primitives	O
like	O
the	O
LDREX/STREX	B-Operating_System
exclusive	O
access	O
primitives	O
introduced	O
in	O
the	O
ARMv6	B-Architecture
architecture	O
.	O
</s>
<s>
Interrupt	B-Application
nesting	O
.	O
</s>
<s>
Some	O
microcontrollers	B-Architecture
allow	O
higher	O
priority	O
interrupts	B-Application
to	O
interrupt	B-Application
lower	O
priority	O
ones	O
.	O
</s>
<s>
This	O
allows	O
software	O
to	O
manage	O
latency	O
by	O
giving	O
time-critical	O
interrupts	B-Application
higher	O
priority	O
(	O
and	O
thus	O
lower	O
and	O
more	O
predictable	O
latency	O
)	O
than	O
less-critical	O
ones	O
.	O
</s>
<s>
When	O
interrupts	B-Application
occur	O
back-to-back	O
,	O
microcontrollers	B-Architecture
may	O
avoid	O
an	O
extra	O
context	O
save/restore	O
cycle	O
by	O
a	O
form	O
of	O
tail	B-Language
call	I-Language
optimization	I-Language
.	O
</s>
<s>
Lower	O
end	O
microcontrollers	B-Architecture
tend	O
to	O
support	O
fewer	O
interrupt	B-General_Concept
latency	I-General_Concept
controls	O
than	O
higher	O
end	O
ones	O
.	O
</s>
<s>
Two	O
different	O
kinds	O
of	O
memory	B-General_Concept
are	O
commonly	O
used	O
with	O
microcontrollers	B-Architecture
,	O
a	O
non-volatile	B-General_Concept
memory	I-General_Concept
for	O
storing	O
firmware	B-Application
and	O
a	O
read-write	O
memory	B-General_Concept
for	O
temporary	O
data	O
.	O
</s>
<s>
From	O
the	O
earliest	O
microcontrollers	B-Architecture
to	O
today	O
,	O
six-transistor	O
SRAM	O
is	O
almost	O
always	O
used	O
as	O
the	O
read/write	O
working	O
memory	B-General_Concept
,	O
with	O
a	O
few	O
more	O
transistors	O
per	O
bit	O
used	O
in	O
the	O
register	B-General_Concept
file	I-General_Concept
.	O
</s>
<s>
In	O
addition	O
to	O
the	O
SRAM	O
,	O
some	O
microcontrollers	B-Architecture
also	O
have	O
internal	O
EEPROM	B-General_Concept
and/or	O
internal	O
NVRAM	O
for	O
data	O
storage	O
;	O
and	O
even	O
ones	O
that	O
do	O
not	O
have	O
any	O
(	O
or	O
not	O
enough	O
)	O
are	O
often	O
connected	O
to	O
external	O
EEPROM	B-General_Concept
chip	O
(	O
such	O
as	O
the	O
BASIC	B-Language
Stamp	I-Language
)	O
or	O
external	O
flash	B-Device
memory	I-Device
chip	O
.	O
</s>
<s>
A	O
few	O
microcontrollers	B-Architecture
beginning	O
in	O
2003	O
have	O
"	O
self-programmable	O
"	O
flash	B-Device
memory	I-Device
.	O
</s>
<s>
The	O
earliest	O
microcontrollers	B-Architecture
used	O
mask	B-Device
ROM	I-Device
to	O
store	O
firmware	B-Application
.	O
</s>
<s>
Later	O
microcontrollers	B-Architecture
(	O
such	O
as	O
the	O
early	O
versions	O
of	O
the	O
Freescale	B-Device
68HC11	I-Device
and	O
early	O
PIC	B-Architecture
microcontrollers	I-Architecture
)	O
had	O
EPROM	B-General_Concept
memory	B-General_Concept
,	O
which	O
used	O
a	O
translucent	O
window	O
to	O
allow	O
erasure	O
via	O
UV	O
light	O
,	O
while	O
production	O
versions	O
had	O
no	O
such	O
window	O
,	O
being	O
OTP	O
(	O
one-time-programmable	O
)	O
.	O
</s>
<s>
Firmware	B-Application
updates	O
were	O
equivalent	O
to	O
replacing	O
the	O
microcontroller	B-Architecture
itself	O
,	O
thus	O
many	O
products	O
were	O
not	O
upgradeable	O
.	O
</s>
<s>
Motorola	O
MC68HC805	B-Device
was	O
the	O
first	O
microcontroller	B-Architecture
to	O
use	O
EEPROM	B-General_Concept
to	O
store	O
the	O
firmware	B-Application
.	O
</s>
<s>
EEPROM	B-General_Concept
microcontrollers	B-Architecture
became	O
more	O
popular	O
in	O
1993	O
when	O
Microchip	O
introduced	O
PIC16C84	B-Device
and	O
Atmel	O
introduced	O
an	O
8051-core	B-Architecture
microcontroller	B-Architecture
that	O
was	O
first	O
one	O
to	O
use	O
NOR	B-Device
Flash	I-Device
memory	I-Device
to	O
store	O
the	O
firmware	B-Application
.	O
</s>
<s>
Today	O
's	O
microcontrollers	B-Architecture
almost	O
all	O
use	O
flash	B-Device
memory	I-Device
,	O
with	O
a	O
few	O
models	O
using	O
FRAM	O
and	O
some	O
ultra-low-cost	O
parts	O
still	O
using	O
OTP	O
or	O
Mask	B-Device
ROM	I-Device
.	O
</s>
