Introduction To Microcontrollers: Sistemas Embebidos Oscar Acevedo, PHD
Introduction To Microcontrollers: Sistemas Embebidos Oscar Acevedo, PHD
Sistemas Embebidos
Oscar Acevedo, PhD
What is a Microcontroller?
• A microcontroller contains:
• A “simple” microprocessor
• Memory (RAM and ROM)
• Ports
• Support hardware (clock, interrupts, etc)
• Application-oriented Hardware (AD converter)
TEXAS
ATMEL MICROCHIP
INSTRUMENT
MOTOROLA
FREESCALE INTEL
About Microcontrollers
• Advantage: • Disadvantage:
• Easy to use • Limited resources
• Small • Low clock speed
• Low power
• Good for portable devices
Integrated Development Environment
• In order to perform any task, a program must be developed and deployed to the µC
C language
Microcontroller Programming
• You should keep in mind that you are working directly with hardware
• Think in BINARY!!!
Program Structure
Reset / Power On
Configuration
Main
Code
Microcontroller Internal Structure
• CISC • RISC
• Complex instruction set computer • Reduced instruction set computer
• Large number of instructions • Low number of instructions
• Specialized instructions • Basic instructions
• Many addressing modes • Few addressing modes
• Variable length instruction format • Fixed length instruction
The Microprocessor – ATMega328p (AVR)
• Data Memory
• Organized as follows:
• 32 registers
• 64 I/O registers
• 160 I/O registers (ext)
• 2048 Bytes SRAM
• The 64 basic I/O registers can
be accessed from both IN-
OUT instructions and memory
instructions
Memory – Access Time