EMBEDDED SYSTEMS
Eng : Hatem Abd El-Salam
INTRODUCTION 2
MEMORY
• Volatile Data Memory (RAM)
 SRAM
 DRAM
• Non-Volatile Program Memory
 Masked Rom
 OTPROM
 EPROM
 EEPROM
 Flash
Processor
IO Memory
VOLATILE DATA MEMORY
• This is memory used by the microcontroller for temporary data storage, system
setup and peripherals configuration registers. Memory in this category
includes SRAM and DRAM. AVR microcontrollers utilize SRAM.
DRAM SRAM
Based on Capacitors flip flops
Cost Cheaper Costly
Size Bigger Smaller
Speed Slower Faster
Refreshing circuit Need Not need
NON-VOLATILE PROGRAM MEMORY
• This is memory used by the microcontroller to store programs. Data can also
be stored in this memory but the access time is much slower than that of RAM.
Memory in this category includes:
 MROM
 OTPROM
 EPROM
 EEPROM
 FLASH
• The AVR microcontrollers utilize Flash for program storage, some AVR
controllers contains a bit of EEPROM as well to store non volatile data.
NON-VOLATILE PROGRAM MEMORY
• MROM
 Masked ROM
 contents are programmed by the integrated circuit manufacturer (rather than by the user)
• OTPROM
 One-Time Programmable ROM
• EPROM
 Erasable Programmable ROM
 EPROM can be erased by exposing it to strong UV
• EEPROM
• Electrically Erasable Programmable ROM
• EEPROM can be programmed and erased in-circuit, by applying special programming signals
• FLASH
 The same as EEPROM
EEPROM VS FLASH
EEPROM FLASH
Access Byte access Block access
Life time 100 000- 1000 000 W/R 1000 W/R
Cost Costly Cheaper
INPUT / OUTPUT
• DIO
• ADC
• Timer
• Serial communication
Processor
IO Memory
HOW TO SELECT A MICRO-CONTROLLER
• Number of I/O ports.
• Peripherals required (Timers, ADC, USART,SPI and EEPROM).
• Memory requirements.
• Maximum clock speed.
• Real-Time considerations.
• Number of interrupts required
• Power Consumption / sleep modes.
• Availability and Cost.
• Vendor Support.
• Development Environment.
MICROCONTROLLER VENDORS
Vendor Families Derivative
AVR ATmega16
8051 AT83EB5114
PIC PIC16F877A
V850 V850ES
HC12 MC9S12XEP100
TM4C TM4C123GH6PM
AVR HISTORY
• AVR was developed in the year 1996 by Atmel Corporation.
• The architecture of AVR was developed by Alf-Egil Bogen and Vegard Wollan.
• AVR derives its name from its developers and stands for Alf-Egil Bogen &
Vegard Wollan RISC microcontroller.
• Also known as Advanced Virtual RISC.
• The first microcontroller to hit the commercial market was AT90S1200 in the year
1997.
AVR MICRO-CONTROLLERS CATEGORIES
1.TinyAVR
 Less memory
 small size
 suitable only for simpler applications.
2.MegaAVR
 These are the most popular ones.
 having good amount of memory (up to 256 KB) higher number of inbuilt peripherals.
 suitable for moderate to complex applications.
3.XmegaAVR
 Used commercially for complex applications, which require large program memory and
high speed.
AVR MICRO-CONTROLLERS CATEGORIES
Series Name Pins Flash Memory Special Feature
TinyAVR 6-32 0.5-8 KB Small in size
MegaAVR 28-100 4-256 KB Extended peripherals
XmegaAVR 44-100 16-384 KB
DMA, Event System
included
WHAT’S SPECIAL ABOUT AVR?
• AVR micro-controllers are fast executes most of the instructions in single execution cycle.
• AVRs are about 4 times faster than PICs.
• They consume less power and can be operated in different power saving modes.
• Free IDE.
• Available in Egyptian market.
8051 PIC AVR
Speed Slow Moderate Fast
Memory Small Large Large
Architecture CISC RISC RISC
ADC Not Present Inbuilt Inbuilt
Timers Inbuilt Inbuilt Inbuilt
PWM Channels Not Present Inbuilt Inbuilt
WHAT’S SPECIAL ABOUT AVR?
• 8-bit Micro-controllers
AVR ARCHITECTURE
• AVR follows Harvard Architecture
• the processor is equipped with separate memories and buses for Program and
the Data information. Here while an instruction is being executed, the next
instruction is pre-fetched from the program memory.
NAMING CONVENTION
FLAVORS OF ATMEGA16
There are two flavors for ATmega16 microcontroller:
• ATmega16: Operating frequency range is 0 – 16 MHz.
• ATmega16L: Operating frequency range is 0 – 8 MHz.
• If we are using a crystal of 8 MHz = 8 x 106 Hertz = 8 Million cycles, then
AVR can execute 8 million add instructions per second.
ATMEGA16 ARCHITECTURE
ATMEGA16 ARCHITECTURE
• I/O Ports
ATmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit input-output ports.
• Timers/Counters
ATmega16 consists of two 8-bit and one 16-bit timer/counter.
• Watchdog Timer
Present with internal oscillator. Watchdog timer continuously monitors and resets the controller if
the code gets stuck at any execution action for more than a defined time interval.
• ADC Interface
ATmega16 is equipped with an 8 channel ADC with a resolution of 10-bits.
• Analog Comparator
The Analog Comparator compares the input values of two analog signals.
ATMEGA16 ARCHITECTURE
• Interrupt Unit
Consists of 21 interrupt sources out of which four are external. The remaining are internal
interrupts which support the peripherals like USART, ADC, Timers etc.
• USART
Universal Synchronous and Asynchronous Receiver and Transmitter interface is available
for interfacing with external device capable of communicating serially (data transmission bit by
bit).
• TWI (Two Wire Interface )
Also called Inter-integrated Circuits can be used to set up a network of devices, many devices
can be connected over TWI interface forming a network, the devices can simultaneously transmit
and receive and have their own unique address.
• SPI (Serial Peripheral Interface)
Used for serial communication between two devices on a common clock source.
ATMEGA16 ARCHITECTURE
• ISP (In System Programmable )
Flash Memory which can be programmed without removing the IC from the circuit.
• Internal Calibrated Oscillator
 ATmega16 is equipped with an internal oscillator for driving its clock. By default
ATmega16 is set to operate at internal calibrated oscillator of 1 Mhz.
 The maximum frequency of internal oscillator is 8Mhz.
 ATmega16 can be operated using an external crystal oscillator with a maximum
frequency of 16MHz
introduction to embedded systems part 2
introduction to embedded systems part 2

introduction to embedded systems part 2

  • 1.
    EMBEDDED SYSTEMS Eng :Hatem Abd El-Salam INTRODUCTION 2
  • 2.
    MEMORY • Volatile DataMemory (RAM)  SRAM  DRAM • Non-Volatile Program Memory  Masked Rom  OTPROM  EPROM  EEPROM  Flash Processor IO Memory
  • 3.
    VOLATILE DATA MEMORY •This is memory used by the microcontroller for temporary data storage, system setup and peripherals configuration registers. Memory in this category includes SRAM and DRAM. AVR microcontrollers utilize SRAM. DRAM SRAM Based on Capacitors flip flops Cost Cheaper Costly Size Bigger Smaller Speed Slower Faster Refreshing circuit Need Not need
  • 4.
    NON-VOLATILE PROGRAM MEMORY •This is memory used by the microcontroller to store programs. Data can also be stored in this memory but the access time is much slower than that of RAM. Memory in this category includes:  MROM  OTPROM  EPROM  EEPROM  FLASH • The AVR microcontrollers utilize Flash for program storage, some AVR controllers contains a bit of EEPROM as well to store non volatile data.
  • 5.
    NON-VOLATILE PROGRAM MEMORY •MROM  Masked ROM  contents are programmed by the integrated circuit manufacturer (rather than by the user) • OTPROM  One-Time Programmable ROM • EPROM  Erasable Programmable ROM  EPROM can be erased by exposing it to strong UV • EEPROM • Electrically Erasable Programmable ROM • EEPROM can be programmed and erased in-circuit, by applying special programming signals • FLASH  The same as EEPROM
  • 7.
    EEPROM VS FLASH EEPROMFLASH Access Byte access Block access Life time 100 000- 1000 000 W/R 1000 W/R Cost Costly Cheaper
  • 8.
    INPUT / OUTPUT •DIO • ADC • Timer • Serial communication Processor IO Memory
  • 9.
    HOW TO SELECTA MICRO-CONTROLLER • Number of I/O ports. • Peripherals required (Timers, ADC, USART,SPI and EEPROM). • Memory requirements. • Maximum clock speed. • Real-Time considerations. • Number of interrupts required • Power Consumption / sleep modes. • Availability and Cost. • Vendor Support. • Development Environment.
  • 10.
    MICROCONTROLLER VENDORS Vendor FamiliesDerivative AVR ATmega16 8051 AT83EB5114 PIC PIC16F877A V850 V850ES HC12 MC9S12XEP100 TM4C TM4C123GH6PM
  • 11.
    AVR HISTORY • AVRwas developed in the year 1996 by Atmel Corporation. • The architecture of AVR was developed by Alf-Egil Bogen and Vegard Wollan. • AVR derives its name from its developers and stands for Alf-Egil Bogen & Vegard Wollan RISC microcontroller. • Also known as Advanced Virtual RISC. • The first microcontroller to hit the commercial market was AT90S1200 in the year 1997.
  • 12.
    AVR MICRO-CONTROLLERS CATEGORIES 1.TinyAVR Less memory  small size  suitable only for simpler applications. 2.MegaAVR  These are the most popular ones.  having good amount of memory (up to 256 KB) higher number of inbuilt peripherals.  suitable for moderate to complex applications. 3.XmegaAVR  Used commercially for complex applications, which require large program memory and high speed.
  • 13.
    AVR MICRO-CONTROLLERS CATEGORIES SeriesName Pins Flash Memory Special Feature TinyAVR 6-32 0.5-8 KB Small in size MegaAVR 28-100 4-256 KB Extended peripherals XmegaAVR 44-100 16-384 KB DMA, Event System included
  • 14.
    WHAT’S SPECIAL ABOUTAVR? • AVR micro-controllers are fast executes most of the instructions in single execution cycle. • AVRs are about 4 times faster than PICs. • They consume less power and can be operated in different power saving modes. • Free IDE. • Available in Egyptian market. 8051 PIC AVR Speed Slow Moderate Fast Memory Small Large Large Architecture CISC RISC RISC ADC Not Present Inbuilt Inbuilt Timers Inbuilt Inbuilt Inbuilt PWM Channels Not Present Inbuilt Inbuilt
  • 16.
    WHAT’S SPECIAL ABOUTAVR? • 8-bit Micro-controllers
  • 17.
    AVR ARCHITECTURE • AVRfollows Harvard Architecture • the processor is equipped with separate memories and buses for Program and the Data information. Here while an instruction is being executed, the next instruction is pre-fetched from the program memory.
  • 18.
  • 19.
    FLAVORS OF ATMEGA16 Thereare two flavors for ATmega16 microcontroller: • ATmega16: Operating frequency range is 0 – 16 MHz. • ATmega16L: Operating frequency range is 0 – 8 MHz. • If we are using a crystal of 8 MHz = 8 x 106 Hertz = 8 Million cycles, then AVR can execute 8 million add instructions per second.
  • 20.
  • 21.
    ATMEGA16 ARCHITECTURE • I/OPorts ATmega16 has four (PORTA, PORTB, PORTC and PORTD) 8-bit input-output ports. • Timers/Counters ATmega16 consists of two 8-bit and one 16-bit timer/counter. • Watchdog Timer Present with internal oscillator. Watchdog timer continuously monitors and resets the controller if the code gets stuck at any execution action for more than a defined time interval. • ADC Interface ATmega16 is equipped with an 8 channel ADC with a resolution of 10-bits. • Analog Comparator The Analog Comparator compares the input values of two analog signals.
  • 22.
    ATMEGA16 ARCHITECTURE • InterruptUnit Consists of 21 interrupt sources out of which four are external. The remaining are internal interrupts which support the peripherals like USART, ADC, Timers etc. • USART Universal Synchronous and Asynchronous Receiver and Transmitter interface is available for interfacing with external device capable of communicating serially (data transmission bit by bit). • TWI (Two Wire Interface ) Also called Inter-integrated Circuits can be used to set up a network of devices, many devices can be connected over TWI interface forming a network, the devices can simultaneously transmit and receive and have their own unique address. • SPI (Serial Peripheral Interface) Used for serial communication between two devices on a common clock source.
  • 23.
    ATMEGA16 ARCHITECTURE • ISP(In System Programmable ) Flash Memory which can be programmed without removing the IC from the circuit. • Internal Calibrated Oscillator  ATmega16 is equipped with an internal oscillator for driving its clock. By default ATmega16 is set to operate at internal calibrated oscillator of 1 Mhz.  The maximum frequency of internal oscillator is 8Mhz.  ATmega16 can be operated using an external crystal oscillator with a maximum frequency of 16MHz