Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
5 views30 pages

Lecture 1 Microcontroller

A microcontroller (MCU) is a compact computer system-on-a-chip that includes a processor, memory, and programmable I/O peripherals, often embedded in devices for specific control tasks. It differs from a microprocessor by integrating all components on a single chip, making it suitable for cost-sensitive and power-efficient applications. Key considerations for choosing a microcontroller include computing needs, software development tools, and availability from reliable sources.

Uploaded by

alamin.cse.61
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views30 pages

Lecture 1 Microcontroller

A microcontroller (MCU) is a compact computer system-on-a-chip that includes a processor, memory, and programmable I/O peripherals, often embedded in devices for specific control tasks. It differs from a microprocessor by integrating all components on a single chip, making it suitable for cost-sensitive and power-efficient applications. Key considerations for choosing a microcontroller include computing needs, software development tools, and availability from reliable sources.

Uploaded by

alamin.cse.61
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

WHAT ARE MICROCONTROLLERS ?

A micro-controller (also MCU or µC) is a functional computer system-on-a-


chip. It contains a processor core, memory and programmable input/output
peripherals.

Micro suggests that the device is small and controller tells you that the device
might be used to control objects, processes or events.

Another term to describe a microcontroller is embedded controller because


the microcontroller and its support circuits are often built into or embedded
in the devices they control.
WHERE WE USE THEM…???
Microprocessor vs. Microcontroller
Microprocessor Microcontroller
 CPU is stand-alone, RAM, • CPU, RAM, ROM, I/O and
ROM, I/O, timer are separate timer are all on a single chip
 designer can decide on the • fix amount of on-chip ROM,
amount of ROM, RAM and I/O RAM, I/O ports
ports. • for applications in which cost,
 expensive power and space are critical
 general-purpose • single-purpose
Embedded System

 Embedded system means the processor is embedded into that


application.
 An embedded product uses a microprocessor or microcontroller to do
one task only.
 In an embedded system, there is only one application software that is
typically burned into ROM.
 Example:printer, keyboard, video game player
Three criteria in Choosing a Microcontroller

1. meeting the computing needs of the task efficiently and cost


effectively
• speed, the amount of ROM and RAM, the number of I/O ports
and timers, size, packaging, power consumption
• easy to upgrade
• cost per unit
2. availability of software development tools
• assemblers, debuggers, C compilers, emulator, simulator,
technical support
3. wide availability and reliable sources of the microcontrollers.
TYPES OF MICROCONTROLLER
Types based on
architecture

1. Havard architecture

2. Von Neuman
architecture
TYPES OF MICROCONTROLLER
Types based on vendor or provider

AVR
PIC
Hitachi,
Motorolla etc
Working with microcontroller
Working with microcontroller
can be divided into three steps:-

programming the
1 microcontroller

2 Burning it inside the IC.

Connect to the external


3 network
Basic block diagram of a microcontroller
CPU :
 CPU does all the arithmetic and logic operations.
 It controls the flow of execution of instructions.
RAM ( Random Access Memory) :
 RAM holds the set of instructions (program), i.e. being
executed by the CPU.
 It holds important data required by the program.
 It holds some important data structures like ‘stack’.
 It is volatile in nature.
ROM ( Read Only Memory) :
 ROM holds very important data and initialization
about the microcontroller.
 It holds the monitor program.
Flash Memory :

 Flash memory is basically EEPROM.


 It holds the program written by the user.
 The program can be erased or written here many
times. ( Specified by the manufacturer)
I/0 Ports :
 Every microcontroller has I/O ports.
 Each port is made up of n-pins ( mostly 8 pins).
 Each pin can be configured as either input pin or
output pin.
 If a pin is input pin, it accepts data from the device it is
connected to.
 If a pin is output pin, it sends the data to the device it
is connected to.
 Thus these pins form the input/output medium for the
microcontrollers.
ADC :
 Most of the real world signals are analog in nature.
 But a microcontroller is a digital device, thus it cannot
process analog signals.
 Thus all microcontrollers have built in A-D converters.
 ADC digitizes an analog signal and gives it to the
microcontroller for further processing.
TIMERS :
 In many applications, time keeping is a must. Eg. If
you heating a meal in an oven.
 Thus microcontrollers have timers to measure time.
WATCHDOG :
 A watchdog is a device used to protect a system from
specific software or hardware failures that may cause
the system to stop responding. The application is first
registered with the watchdog device. Once the
watchdog is running on your system the application
must periodically send information to the watchdog
device. If the device doesn't receive this signal within
the set period of time it would execute the proper
keystrokes to reboot the machine or restart the
application.
SOME COMMON MICROCONTROLLERS

 Intel - 8051
 Atmel – Atmega 16
 PIC
 ARM
 Question: How a microcontroller works ???

 Answer: Microcontroller consists of a


Microprocessor (CPU i.e. Central processing Unit)
which is interfaced to RAM (Random Access
Memory) and Flash Memory (EEPROM). You feed
your program in the Flash Memory on the
microcontroller. Now when you turn on the
microcontroller, CPU accesses the instructions
from RAM which access your code from Flash. It
sets the configuration of the pins and then start
performing according to your program.
 Question: How to make the code ?

 Answer: You basically write the program on your


computer in any of the high level languages like C,
C++, JAVA etc. Then you compile the code to generate
the machine file.
All the machines understand only one language, 0 & 1
that is on and off. Now this 0 & 1 both corresponds to 2
different voltage levels for example 0 volt for 0 logic
and +5 volt for 1 logic. Actually the code has to be
written in this 0, 1 language and then saved in the
memory of the microcontroller. But this will be very
difficult task. So we write the code in the language we
understand (eg. C) and then compile and make the
machine file “.hex”. After we make this machine file we
feed this to the memory of the microcontroller.
 Question: How to feed the code in the flash of Microcontroller ?

 Answer: Assuming you have the machine file (.hex) ready and now you
want to feed that to the flash of the microcontroller. Basically you want
to make communication between your computer and microcontroller.
Now computer has many communication ports such as Serial Port,
Parallel Port and USB (Universal Serial Bus).
Let’s take Serial Port, it has its own definition that is voltage level to define 0 &
1. Serial Port's protocol is called as UART (Universal Asynchronous Receiver &
Transmitter). Its voltage levels are : +12 volt for 0 logic and -12 volt for 1 logic.
Now the voltage levels of our microcontroller are based on CMOS
(Complementary Metal Oxide Semiconductor) technology which has 0 volt for
0 logic and +5 volt for 1 logic. Two different machines with 2 different ways to
define 0 & 1 and we want to exchange information between them. Consider
microcontroller as a French and Computer's Serial Port as an Indian person. If
they want to exchange information they basically need a mediator who knows
both the language. He will listen one person and then translate to other
person. Similarly we need a circuit which converts CMOS (microcontroller) to
UART (serial port) and vice versa. This circuit is called as programmer. Using
this circuit we can connect computer to the microcontroller and feed the
machine file to the flash.
Manufacturer : ATMEL CORPORATION,
USA.

http://www.atmel.com/
PIN CONFIGURATION :
Microcontroller – part and parcel
of AI
Part and parcel of robotic projects
Uses in automobile engine control
system

Microcontrollers in medical devices
Microcontrollers in power system

THE END

You might also like