Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Microcontroller
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== 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]].<ref>{{cite book |last=Heath |first=Steve |title=Embedded systems design |publisher=Newnes |year=2003 |edition=2 |series=EDN series for design engineers |pages=[https://archive.org/details/embeddedsystemsd0000heat/page/11 11]β12 |url=https://archive.org/details/embeddedsystemsd0000heat |url-access=registration |isbn=9780750655460 }}</ref> 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, [[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. === Interrupts === 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. === Programs === 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. 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. 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 microcontroller 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 ROM|mask-programmed]]" parts have the program laid down in the same way as the logic of the chip, at the same time. 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]]. === Other microcontroller features === 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. Many embedded systems need to read sensors that produce analog signals. However, because they 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, an [[analog-to-digital converter]] (ADC) 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/off, the heater on/off, etc. 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]]. 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]].<ref>David Harris & Sarah Harris (2012). ''Digital Design and Computer Architecture, Second Edition'', p. 515. Morgan Kaufmann. {{ISBN|0123944244}}.</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)