INTRODUCTION TO EMBEDDED SYSTEMS DESIGN (HARDWARE PROGRAMMING)
Hello everyone! I shall be taking series of tutorials on embedded systems, otherwise called hardware Programming. Most devices and gadgets we see around us (Televisions, phones, laptop computers) are not by-products of magic. They are outputs of embedded systems instead. At this juncture, let me begin by explaining what the term embedded system is all about before proceeding to the software part of the topic.
EMBEDDED SYSTEMS
This can be defined as any system that has a micro-controller completely packed in it. A micro-controller is a computer operated on a single chip. It has within it- an input, central processing unit (CPU) and an output unit.
Components of Embedded Systems
Micro-controller should not be confused with microprocessors. This difference between the duo was shown in the figure above. Microprocessor alongside the input and the output units constitutes a Micro-controller.
MANUFACTURERS OF MICRO-CONTROLLER
Below are the list of some of the companies and corporations that produce different species of micro-controllers.
- Microchip Corporation: This company produces Programmable Interface Controller(PIC).
- Atmel Corporation: This company produces ATMEG controllers (Arduino).
- Intel Corporation.
- Texas Instrument.
- Motorola.
For the sake of this tutorial series, I will be taking Programmable Interface Controller (PIC) as a case study. We shall build projects using PICs. This is because PICs are readily available, they have free and cheap resources. They also have free support resources.
TYPES OF PROGRAMMABLE INTERFACE CONTROLLER (PIC)
In increasing order of complexity and price, PICs are classified into three main groups namely: baseline microchip, midrange microchip and end-range microchip.
Baseline Microchips: They are classified by low pin count and low memory. Examples are: PIC10F, PIC12F and some PIC14Fs.
Midrange Microchips: They are classified by pin count and memory higher than that of the baseline microchips. Examples are: PIC14F, PIC16F and some PIC18Fs.
End-range Microchips: They are classified by multiple pin count and complex memory. Examples are: PIC18Fs and PIC32Fs.
ANALYSIS OF PICs
Given any of the types of PICs earlier discussed, it is very easy to analyze which is which. Let’s use PIC16F877A as a case study, we can analyze the controller as follows:
PIC (Programmable Interface Controller): Brand Name of the Manufacturer
16: This denotes the type of the controller (midrange family)
F": This denotes controllers with Flash memory. This type of micro-controller can be programmed, erased, reprogrammed, erased, and the trend continues like that. They are used when the designer is still at the level of prototyping. This is due to the fact that codes written on micro-controllers might not work as expected, once. If the codes work out, fine! If not, the hardware engineer would erase the code to reprogram.
877: This denotes the number of Integrated Circuits embedded together to form the micro-controller. It is otherwise called the device number.
A: This means “Enhanced Memory”. These are controllers that can run a maximum of twenty million instructions within one seconds.
Understood right?
SPECIAL PINS IN EVERY PROGRAMMABLE INTERFACE CONTROLLERS.
PIC micro-controllers are made up of several pins, the count of which depends on the controller’s family. Five of these are given some special considerations, and they are called special pins.
VDD PIN: This pin is given a logic level high (5V).
VSS PIN : This pin is given a logic level low (0V).
MCLR PIN: This is the Master Clear or RESET pin. This pin is triggered by simply connecting a switch to it. When the switch is closed, the operation of the controller is reset back to how it was at the time it was first powered.
OSC1 PIN: This is the first Oscillator Pin. The pin is connected to one terminal of a Crystal Oscillator (which gives the controller its instruction cycle).
OSC2 PIN: This is the second Oscillator pin that is connected to the connected to the second terminal of the Crystal Oscilator.
ACCESSORIES, INPUT AND OUTPUT ELEMENTS TO A PIC MICRO-CONTROLLER
ACCESSORIES
OSCILLATOR: This is device that gives the micro-controller a clock at certain frequency, when the voltage is made constant. Micro-controllers, like the conventional computers we know, can process millions of information in seconds. The number of instructions to be processed per second depends on the oscillator used together with the controller, and that’s why oscillating circuits are regarded as the heartbeat of a micro-controller.
Generally speaking, oscillators are classified into two main groups:
Those based on electronic phase-shift circuits:These are made up of resistor and capacitor arranged in a voltage divider network. The output from this arrangement is the time constant, the reciprocal of which gives the desired frequency value.
I used Proteus software to design this image.
Those based on mechanical resonant devices: Under this, we have oscillators such as ceramic resonators and crystals. We will be working with crystal oscillators in our subsequent projects. Crystal oscillators are capable of generating 4-16 million instructions per seconds (4MHz, 8MHz, 12MHz, and 16MHz).
The family of crystal oscillators that can generate maximum of 20 million instruction per seconds (20MHz) are called High standard (HS) oscillator. Ideally for any micro-controller, the terminals of these oscillators are connected to the terminals of a 22pF capacitor and to ground as shown in the figure below:
I used Proteus software to design this image.
INPUTS AND OUTPUTS
Micro-controller, like the conventional computer, can take in inputs to produce desired outputs. The inputs to a micro-controller are button, keypad, keyboard, sensors, camera, and analog inputs.
The outputs from a micro-controller are Light Emitting Diode (LED), array of LEDs, seven segment display, Liquid crystal display (LCD), Buzzer, speaker, motors, personal computer etc.
REFERENCES
- Emebeded system application -elprocus
- Definition of embedded system -echtarget
- Embeded systems -engineersgarage