Embedded System
IS COMBINATION OF HARDWARE AND SOFTWARE
• “ An embedded system can be defined as those control
systems which are designed either by microprocessor or
microcontroller for a specific tasks. ”
• “ An embedded system is some combination of computer
hardware & software, either fixed in capability or
programmable, that is specifically designed for a particular
kind of application device. "
EMBEDDED SYSTEM
Embedded System In Daily Life
Moving message display
DVD player Traffic Light
Digital clock
Game
APPLICATION
.
INPUT OUTPUT
RAM ROM
MICROCONTROLLER
Microprocessor & Microcontroller
Microprocessor:
A silicon chip that contains a CPU. In the world of personal computers, the
terms microprocessor and CPU are used interchangeably. At the heart of all
personal computers and most of all automatic systems.
Microcontroller :
A microcontroller (sometimes abbreviated µC, uC or MCU) is a small
computer on a single integrated circuit containing a processor core, memory,
and programmable input/output peripherals.
Basic Block Diagram of Microcontroller
AVR
A: Advance
V: Virtual
R:Risc
AVR
ATMEGA 8
MICRO-CONTROLLER
It was developed by Atmel Corporation
‘8’ in Atmega8 means this microcontroller has 8Kb of flash
memory
ALL AVR MC Is 8 bit microcontroller.
It was developed in the year 1996 by Atmel Corporation.
What is RISC?
 RISC stands for “Reduced Instruction Set Computer”
It is a very fast architecture which executes one instruction per clock
cycle.
RISC contains very small instruction set.
Programming is easy, but code length increases.
.
Some xtra FEATURES
• Up to 16 MIPS Throughput at 16 MHz
• 32 x 8 General Purpose Working Registers
• Six ADC channels in PDIP package
• Internal Calibrated Oscillator of 2,4,8 MHz.
MEMORY SEGMENTS
• 8K Bytes of Flash program memory
• 512 Bytes EEPROM (Electrically Erasable
Programmable Read Only Memory)
• 1K Byte Internal RAM (Random Access Memory)
Atmega8
PORTB-8ch
PORTC-7ch
PORTD-8ch
total port pin:23
1.VCC
2.GND
3.GND
4.AVCC
5.AREF
PORT
PORT is use for input and out put communication.
PORT are 8 bit wide.
PORT are bidirectional data bus.
Every PORT has three registers associated with it each one with 8 bit.
PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
PORT IS 8 BIT REGISTERS.
PORT IS COMBINATION OF 8 FLIP FLOP
PORTB
PORTC
-------- PC6 PC5 PC4 PC3 PC2 PC1 PC0
PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0
PORTD
PORT Associated Registers
DDRx – Data Direction Register
PORTx – Pin Output Register
PINx – Pin Input Register
where x = GPIO port name ( B, C or D)
DDRx register
DDRx (Data Direction Register) configures data direction of port pins. Means its
setting determines whether port pins will be used for input or output. Writing 0
to a bit in DDRx makes corresponding port pin as input, while writing 1 to a bit in
DDRx makes corresponding port pin as output.
0 0 0 0 0 0 0 0DDRB=
PORTB is become input. DDRB=0b00000000
1 1 1 1 1 1 1 1DDRB=
PORTB is become OUTPUT DDRB=0b11111111
PORTx register
 PORT give output voltage to external hardware.
 PORT is similar as printf .
PORTB=0b00000000
0 0 0 0 0 0 0 0
PORTB provide low (0) voltage to blub.
PORTx register
 PORT give output voltage to external hardware.
 PORT is similar as printf .
PORTB=0b11111111
1 1 1 1 1 1 1 1
PORTB provide high (5) voltage to blub.
PORTx register
 PORT give output voltage to external hardware.
 PORT is similar as printf .
PORTB=0b11000011
1 1 0 0 0 0 1 1
PORTB provide high (5) voltage to blub.
INTERFACING LED WITH ATMEGAX
LED stands for "Light Emmiting Diode", It has 2 PINs one for +ve Source and the other one for Ground
Basically 5mm LEDs work at 20mA and 3V
current. Now the question comes, How to get the
same Value of source from the MCU. Well,
actually Micro Controller can provide constant 5V
with 20mA Current through its PORTs(A to D)
Lets calculate the Resistance Value, Our Requirements : 20mA , 3V
We Have : 20mA, 5V.So, we need to Decrese the Voltage by 2V.
The Current Flowing in the Cct is 20mA.
V = I X R .
V = 2V.
I = 20mA.
R= ?
2= 0.020 X R
=> R = 2 / 0.020
= 100 Ohm.
LED BLINKING
STEP1:
Make Portb as output
DDRB=0b11111111
STEP2:
Provide +5v to LED.
PORTB=0b11111111
LED BLINKING
shifting
PORTB=0b00000001
PORTB=0b00000010
PORTB=0b00000100
PORTB=0b00001000
PORTB=0b00010000
PORTB=00100000
STEP1: WRITING CODE.
STEP2: COMPILE CODE.
STEP3: FLASH HEX FILE INTO AVR MICROCONTROLLER
COMPUTER
.hex file
Thanks........

Avr microcontroller

  • 2.
    Embedded System IS COMBINATIONOF HARDWARE AND SOFTWARE
  • 3.
    • “ Anembedded system can be defined as those control systems which are designed either by microprocessor or microcontroller for a specific tasks. ” • “ An embedded system is some combination of computer hardware & software, either fixed in capability or programmable, that is specifically designed for a particular kind of application device. " EMBEDDED SYSTEM
  • 4.
    Embedded System InDaily Life Moving message display DVD player Traffic Light Digital clock Game
  • 5.
  • 6.
  • 7.
    Microprocessor & Microcontroller Microprocessor: Asilicon chip that contains a CPU. In the world of personal computers, the terms microprocessor and CPU are used interchangeably. At the heart of all personal computers and most of all automatic systems. Microcontroller : A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals.
  • 8.
    Basic Block Diagramof Microcontroller
  • 9.
  • 10.
  • 11.
    It was developedby Atmel Corporation ‘8’ in Atmega8 means this microcontroller has 8Kb of flash memory ALL AVR MC Is 8 bit microcontroller. It was developed in the year 1996 by Atmel Corporation.
  • 12.
    What is RISC? RISC stands for “Reduced Instruction Set Computer” It is a very fast architecture which executes one instruction per clock cycle. RISC contains very small instruction set. Programming is easy, but code length increases. .
  • 13.
    Some xtra FEATURES •Up to 16 MIPS Throughput at 16 MHz • 32 x 8 General Purpose Working Registers • Six ADC channels in PDIP package • Internal Calibrated Oscillator of 2,4,8 MHz.
  • 14.
    MEMORY SEGMENTS • 8KBytes of Flash program memory • 512 Bytes EEPROM (Electrically Erasable Programmable Read Only Memory) • 1K Byte Internal RAM (Random Access Memory)
  • 16.
  • 17.
    PORT PORT is usefor input and out put communication. PORT are 8 bit wide. PORT are bidirectional data bus. Every PORT has three registers associated with it each one with 8 bit.
  • 18.
    PB7 PB6 PB5PB4 PB3 PB2 PB1 PB0 PORT IS 8 BIT REGISTERS. PORT IS COMBINATION OF 8 FLIP FLOP PORTB PORTC -------- PC6 PC5 PC4 PC3 PC2 PC1 PC0 PD7 PD6 PD5 PD4 PD3 PD2 PD1 PD0 PORTD
  • 19.
    PORT Associated Registers DDRx– Data Direction Register PORTx – Pin Output Register PINx – Pin Input Register where x = GPIO port name ( B, C or D)
  • 20.
    DDRx register DDRx (DataDirection Register) configures data direction of port pins. Means its setting determines whether port pins will be used for input or output. Writing 0 to a bit in DDRx makes corresponding port pin as input, while writing 1 to a bit in DDRx makes corresponding port pin as output. 0 0 0 0 0 0 0 0DDRB= PORTB is become input. DDRB=0b00000000 1 1 1 1 1 1 1 1DDRB= PORTB is become OUTPUT DDRB=0b11111111
  • 21.
    PORTx register  PORTgive output voltage to external hardware.  PORT is similar as printf . PORTB=0b00000000 0 0 0 0 0 0 0 0 PORTB provide low (0) voltage to blub.
  • 22.
    PORTx register  PORTgive output voltage to external hardware.  PORT is similar as printf . PORTB=0b11111111 1 1 1 1 1 1 1 1 PORTB provide high (5) voltage to blub.
  • 23.
    PORTx register  PORTgive output voltage to external hardware.  PORT is similar as printf . PORTB=0b11000011 1 1 0 0 0 0 1 1 PORTB provide high (5) voltage to blub.
  • 24.
    INTERFACING LED WITHATMEGAX LED stands for "Light Emmiting Diode", It has 2 PINs one for +ve Source and the other one for Ground Basically 5mm LEDs work at 20mA and 3V current. Now the question comes, How to get the same Value of source from the MCU. Well, actually Micro Controller can provide constant 5V with 20mA Current through its PORTs(A to D) Lets calculate the Resistance Value, Our Requirements : 20mA , 3V We Have : 20mA, 5V.So, we need to Decrese the Voltage by 2V. The Current Flowing in the Cct is 20mA. V = I X R . V = 2V. I = 20mA. R= ? 2= 0.020 X R => R = 2 / 0.020 = 100 Ohm.
  • 25.
    LED BLINKING STEP1: Make Portbas output DDRB=0b11111111 STEP2: Provide +5v to LED. PORTB=0b11111111
  • 26.
  • 27.
  • 28.
    STEP1: WRITING CODE. STEP2:COMPILE CODE. STEP3: FLASH HEX FILE INTO AVR MICROCONTROLLER COMPUTER .hex file
  • 29.