We have different types of microcontrollers from different manufacturers characterized by different architectures and capabilities. Some may suit a specific application while others may be totally inappropriate for the same application.
Some of the common features of most microcontrollers are discussed as follows:
Contents
- 1 The Supply Voltage
- 2 The Clock
- 3 Interrupts
- 4 Timers
- 5 Watchdog Timer
- 6 Reset Input
- 7 Brown-out Detector
- 8 Analog-to-Digital Converter
- 9 EEPROM Data Memory
- 10 Serial Input-Output
- 11 USB interface
- 12 Motor Control Interface
- 13 CAN Interface
- 14 ZigBee Interface
- 15 Ethernet Interface
- 16 Power-on-Reset
- 17 Current Sink/Source Capability
- 18 LCD Drivers
The Supply Voltage
Most of the microcontrollers you will encounter operate with the standard logic voltage of +5 V. Some microcontrollers can operate at as low as +2.7 V, and some will tolerate +6V without any issue. For example, PIC18F452 microcontrollers can operate with a power supply of +2V to +5V. Always check the manufacturerโs data sheet which contains the information about the allowed limits of the power supply voltage.
In a practical setting, a voltage regulator is typically used to obtain the required power supply voltage when the device is operated from a mains adapter or batteries. For instance, a 5V regulator is needed if the microcontroller is operated from a 5V supply using a 9V battery.
The Clock
All microcontrollers require a clock (or an oscillator) to function; this is usually provided by external timing devices connected to the microcontroller. Generally, these external timing devices are a crystal plus two small capacitors. In some cases, they are resonators or an external resistor-capacitor pair. We have some microcontrollers that have built-in timing circuits and donโt need external timing components. If your application is not time-sensitive, then external or internal resistor-capacitor timing components are the best option since they are simple and inexpensive.
In a microcontroller, an instruction is executed by fetching it from the memory and then decoding it. This normally takes several clock cycles and is known as the instruction cycle. In PIC microcontrollers, an instruction cycle takes four clock periods. Hence, the microcontroller operates at a clock rate that is one-quarter of the actual oscillator frequency. The PIC18F series of microcontrollers can operate with clock frequencies up to 40 MHz.
Interrupts
An interrupt causes the microcontroller to respond to external and internal such as timer events very fast. When an interrupt occurs, the microcontroller leaves its normal flow of program execution and jumps to a special part of the program referred to as the interrupt service routine (ISR). The program code inside the ISR is executed, and upon return from the ISR the program resumes its normal flow of execution.
Timers
Timers play an important role in any microcontroller. A timer is primarily a counter which is driven from either an external clock pulse or the microcontrollerโs internal oscillator. A timer can be 8 bits or 16 bits wide. Data can be loaded into a timer under a program control and the timer can be stopped or started by program control.
Most timers can be configured to generate an interrupt when they reach a certain count (typically when there is an overflow). The user program can use an interrupt to carry out accurate timing-related operations inside the microcontroller. The PIC18F series of microcontrollers have at least 3 timers.
An illustration of the application of timers in some microcontrollers is where there is capture and compare feature, in this case, a timer value can be read when an external event occurs, or the timer value can be compared to a preset value and an interrupt is generated when this value is reached. A number of PIC18F microcontrollers have at least two, capture and compare modules.
Watchdog Timer
Most microcontrollers have at least one watchdog feature. The watchdog is basically a time that is refreshed by the user program. When the program fails to refresh the watchdog, a reset occurs. The watchdog timer is used to detect a system problem, such as the program being in an endless loop. This safety facility prevents runaway software and stops the microcontroller from executing meaningless and unwanted code.
Reset Input
A reset input is used to reset a microcontroller externally. Resetting puts the microcontroller into a known state such that the program execution starts from address 0 of the program memory. An external reset action is usually achieved by connecting a push-button switch to the reset input. When the switch is pressed, the microcontroller is reset.
Brown-out Detector
Brown-out detector, which is common in most microcontrollers, reset the microcontroller if the supply voltage falls below a nominal value. This safety facility can be utilized to prevent unpredictable operation of low voltages, especially to protect the contents of EEPROM-type memories.
Analog-to-Digital Converter
An analog-to-digital converter (A/D) is used to convert an analog signal like voltage, to digital form so that a microcontroller can read and process it. Some microcontrollers have built-in A/D converters. External A/D converter can also be connected to any type of microcontroller. A/D converters are typically 8 to 10 bits, having 256 to 1024 quantization levels. Most PIC microcontrollers with A/D features have multiplexed A/D converters which provide more than one analog input channel. For instance, the PIC18F452 microcontroller has 10-bit 8-channel A/D converters.
The A/D conversion process must be started by the user program and may take several hundred microseconds to complete.
A/D converters are particular of use in instrumentation, control and monitoring applications, since most sensors such as temperature sensors, pressure sensors, force sensors, produce analog output voltages.
EEPROM Data Memory
This feature is very common in most microcontrollers. EEPROM memory enables the programmer to store non-volatile data and change this data whenever it is needed.
Serial Input-Output
Serial communication enables a microcontroller to be connected to another microcontroller or to a PC using a serial cable. Some microcontrollers have in-built hardware referred to as universal synchronous-asynchronous receiver-transmitter (USART) to implement a serial communication interface. The PIC18F series of microcontrollers have in-built USART modules.
Some microcontrollers e.g. PIC18F incorporate serial peripheral interface (SPI) or integrated interconnect (I2C) hardware bus interfaces. This feature enables a microcontroller to interface with other compatible devices easily.
USB interface
This is a common computer interface specification that is used to connect various peripheral devices to computers and microcontrollers. Some PIC microcontrollers provide built-in USB modules for instance PIC18F2x50.
Motor Control Interface
Some PIC microcontrollers for instance the PIC18F2x31 provide motor control interface capability.
CAN Interface
CAN bus is a bus system used in automation applications. Some PIC18F-series microcontrollers such as PIC18F4680 provide CAN interface capability.
ZigBee Interface
ZigBee is usually used in wireless home automation applications. Some PIC18F series microcontrollers provide ZigBee interface capabilities, making the design of such systems very easy.
Ethernet Interface
We have some PIC microcontrollers such as PIC18F97J60 that provide Ethernet interface capabilities and therefore can be employed in network-based applications.
Related Resource: Beginning C for Microcontrollers: Making Electronics Dance with Softwareย
Power-on-Reset
Some microcontrollers have in-built power-on-reset circuits which keep the microcontrollers in the reset state until all the circuitry has been initialized. This feature is helpful as it starts the microcontroller from a known state on power-up. An external reset can also be provided, where the microcontroller is reset when an external button is pressed.
Current Sink/Source Capability
This feature is important especially if the microcontroller is to be connected to an external device that might draw a large amount of current to operate. PIC microcontrollers can source and sink 25 mA current from each output port pin. This current is normally enough to drive buzzers, LEDs, small lamps, small relays, etc. The current capability can be increased by connecting external transistor switching circuits or relays to the output port pins.
LCD Drivers
LCD driver enable a microcontroller to be connected to an external LCD display directly. Nonetheless, these drivers arenโt commonly used as most of the functions they provide can be implemented in software. For instance, the PIC18F6490 microcontroller has an in-built LCD driver module.
Related articles:
- PIC Microcontroller Input-Output Ports Programming in C
- The Basic Structure of Intel 8051 Microcontroller
- The Intel 8085 Microprocessor
- Interfacing LEDs & Electromechanical Relays to Microcontrollers
Leave a Reply