تبلیغات
برق قدرت
برق قدرت
پیام مدیریت وبلاگ :
با سلام خدمت شما بازدیدكننده گرامی ، به این وبلاگ خوش آمدید . لطفا برای هرچه بهتر شدن مطالب این وبلاگ ، ما را از نظرات و پیشنهادات خود آگاه سازید و به ما در بهتر شدن كیفیت مطالب وبلاگ یاری رسانید .

rss

درباره ما
اطلاعات کلی نویسنده وبلاگ:

مسعود کرانی پسند - 29 ساله -دانشجوی کارشناسی ارشد برق قدرت -تبریز


هدف از راه اندازی وبلاگ:
تبادل اطلاعات و انتقال تجربه و دانش در صنعت برق، گردآوری مطالب علمی، ترویج فرهنگ مطالعه و پژوهش، بهره گیری از نقاط ضعف و قوت تجارب گذشته جهت بهره مندی در اقدامات آتی
ایمیل مدیر وبلاگ
آرشیو مطالب
نظرسنجی
نظر شما در باره این وبلاگ چیست





نویسندگان
صفحات اضافی
ابر برچسب ها
آمار و امكانات
آخرین بروزرسانی :
تعداد كل مطالب :
تعداد کل نویسندگان :
بازدید امروز :
بازدید دیروز :
بازدید این ماه :
بازدید ماه قبل :
بازدید کل :
آخرین بازید از وبلاگ :
  

Basics of Microcontrollers
ارسال شده توسط مسعود کرانی پسند در ساعت 04:11 ب.ظ
In this article we will be discussing an important aspect of electronic systems. Many of us use CD/DVD players, TVs, cellphones, microwave ovens, etc. Have your thought of the electronics behind these systems. All of them have one thing in common. A microcontroller. An electrical engineer needs to know about basics of microcontrollers as all of the consumer electronic products use microcontrollers.

So, let’s come to the topic. What is a microcontroller?

Most of you would have heard of a processor or a microprocessor used in computers. For eg. Intel core processors, Pentium, etc. Microprocessors are basically used to process data. It accepts data in digital form, processes it according to the user’s instruction and gives an output. Many people think that microcontroller and microprocessor represent the same thing. However, both are completely different. To illustrate what a microcontroller is let us take the example of a computer. Most of you may be reading this article on your computer. Does your computer only contain a microprocessor? No. It contains many other things. It has external memory components like RAM, ROM, a hard disk drive, etc. What’s so amazing about a microcontroller? It contains a CPU and the additional memory components. You don’t need to add these extra components as in the case of a microprocessor. In simple words, a microcontroller is a single chip computer. But there is a compromise on the performance of CPU and memory in the case of a microcontroller In this article we will be discussing an important aspect of electronic systems. Many of us use CD/DVD players, TVs, cellphones, microwave ovens, etc. Have your thought of the electronics behind these systems. All of them have one thing in common. A microcontroller. An electrical engineer needs to know about basics of microcontrollers as all of the consumer electronic products use microcontrollers.

So, let’s come to the topic. What is a microcontroller?

Most of you would have heard of a processor or a microprocessor used in computers. For eg. Intel core processors, Pentium, etc. Microprocessors are basically used to process data. It accepts data in digital form, processes it according to the user’s instruction and gives an output. Many people think that microcontroller and microprocessor represent the same thing. However, both are completely different. To illustrate what a microcontroller is let us take the example of a computer. Most of you may be reading this article on your computer. Does your computer only contain a microprocessor? No. It contains many other things. It has external memory components like RAM, ROM, a hard disk drive, etc. What’s so amazing about a microcontroller? It contains a CPU and the additional memory components. You don’t need to add these extra components as in the case of a microprocessor. In simple words, a microcontroller is a single chip computer. But there is a compromise on the performance of CPU and memory in the case of a microcontroller.

To understand the basics of microcontroller let’s discuss the components in it:

Central Processing Unit (CPU):
It acts as the brain of the microcontroller. It is used to process data as instructed by the use. The main functions include arithmetic operations like addition, subtraction, multiplication, division, etc. and also for copying or moving data from one address to another.

Microcontroller

Microcontroller


ROM or Read Only Memory:
ROM is used to store the user instructions or program code. Every time the microcontroller is powered the instructions in the ROM is executed. This type of memory is non-volatile i.e. the contents of the memory are retained even if the power is lost. There are many types of ROMs. They are:-

i) EPROM (Erasable Programmable Read Only Memory):- This type of ROM can be erased and programmed again. UV(Ultraviolet)rays are used to erase this kind of memory.This type of ROM is mostly not because costly equipment is needed to reprogram the memory.

ii) EEPROM(Electrically erasable Programmable Read Only Memory):- It is similar to EPROM but the memory can be erased electrically without the use of UV rays. One disadvantage is that it takes a large amount of time to reprogram this kind of memory.

iii) FLASH:- It is similar to EEPROM but it is faster than EEPROM. But it has a smaller lifetime compared to EEPROM.

3) RAM(Random Access Memory):- This memory is used during the execution of program. It is for storing variables and other program data.

4) I/O PORTS:- These ports are used to receive data from the external environment or the user and also to send data. There are two types of I/O ports:-

i) Digital:-These ports are used to send or receive digital data. Digital means discrete data i.e 0V or 5V.

ii) Analog:- Since most of the sensors give analog data analog input pins are commonly used to read sensor data. You can also write analog voltage values to these ports.

The number of analog and digital ports depend on the microcontroller.

5) Timers :- Timers are used to keep track of the time that has passed. Timers are extremely useful in many cases where outputs are to be maintained for a sufficient amount of time.

These are some of the basic components present in a microcontroller. Microcontrollers also contain ADCs ( Analog to Digital Converters ), DAC ( Digital to Analog Converters ) and many other peripherals.

So, is that it? Can the microcontroller be used just like that? Give it a power supply and will it start working? No. It needs instructions on how to operate in a particular situation. These instructions form the software. The user writes the software according to his needs. Previously, assembly language was used for microcontroller programming. This was tedious and took a lot of time. But these days it is a lot more easier due to higher level languages like c. Most companies manufacturing microcontrollers also provide compilers for compiling the c code that you write. Microchip provides MPLAB IDE(Integrated Development Environment) for developing applications with its microcontrollers. You can write your code, generate a hex file and burn it into your microcontroller and it is ready for use.

Simple, isn’t it? Let me just give you a small example of a working application for better understanding basics of microcontroller. Most of you would have gone in lifts. The lift door automatically opens if a person is about to enter while it is closing. You would have also noticed automatic opening of glass doors in various stores. These applications can be easily developed with PIR sensors and microcontrollers. Most PIR sensors give an output of 5V a person is near it and 0V if there is no object near it. The PIR sensor can be connected to one of the digital pins of the microcontroller and the microcontroller can be programmed in such a way that the actuating unit ( motors attached to the door ) rotates in a particular direction the digital pin receives a 5v(a person is standing near it) and in another direction if the digital pin receives a 0V. There are a lot of other factors to be considered if you are going to develop a real world application and you also need separate circuitry for driving the motors but this is just to give a simple idea of most basics of microcontrollers and how these systems work.

There are a lot of applications that you can think of and implement using a microcontroller. In addition to this you can also attach a LCD display and various other types of displays to display data. The main advantage of microcontroller based systems is that microcontrollers are cheap and a working prototype can be easily built. A lot of companies are manufacturing microcontrollers. Some companies include Microchip, Atmel, Texas Instruments.