Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
SOFCON TRAINING
PRESENTATION
Embedded system
Report By: URVASHI KHANDELWAL
CONTENT
• Embedded system
Introduction
Applications
• AVR microcontroller
Introduction
Features
PIN and port Description
E...
DEPARTMENT OF EMBEDDED SYSTEM
• An Embedded system is a combination of computer hardware and software which is designed to...
APPLICATION
AVR (ADVANCED VIRTUAL RISC)
ATMEGA 8
MICRO-CONTROLLER
INTRODUCTION
• ATmega8 is a 8-bit microcontroller based on the AVR RISC
architecture
• By executing powerful instructions ...
FEATURES
• High-performance 8 bit Microcontroller
• 32 x 8 General Purpose Working Registers
• Six ADC channels in PDIP pa...
MEMORY SEGMENTS
• 8K Bytes of Flash program memory
• 512 Bytes EEPROM (Electrically Erasable Programmable Read
Only Memory...
TYPES OF PACKAGES
• 28-pin PDIP (Plastic Dual In-line Package)
opaque molded plastic pressed around a tin-,
silver-, or go...
PIN OUT
PLASTIC DUAL IN-LINE PACKAGE
PIN DESCRIPTION
• VCC Digital supply voltage
• GND Ground
• RESET A low level on this pin for longer than the minimum
puls...
• Three ports i.e PortB, PortC, PortD -General Purpose 8 Bit
bidirectional I/O
• Three registers associated with every por...
PORT B (PB7..PB0)
• Port B is an 8-bit bi-directional I/O port
• Can be used either as a input port or as output port ( di...
REGISTER DESCRIPTION OF I/O PORTS
USING EMBEDDED C
• Embedded C is nothing but a subset of C language which is
compatible with certain microcontrollers.
• S...
SOFTWARE’S USED:
AVR STUDIO 4.0
AVR studio is an Integrated Development Environment (IDE) by ATMEL for
developing applicat...
HOW TO WORK AT AVR STUDIO
Step1. Start AVR Studio on your
workstation. Select "New Project".
Type is "AVR-GCC". Project na...
CONTD…
Step3. Debug platform
should be "AVR
Simulator". Device Is
"ATMEGA 8".
Step4. Click Finish.
You will now be in the
...
CONTD…
CONTD…
.
Step5.Write the following
code into the window in the
middle of the screen (the
window for My FirstProject.c):
Th...
Step 6.Compile the code with "Build -> Build" from the menu, or
the F7 shortcut for "Build". The bottom window will show t...
CONTD….
Step 7. Now let's debug the code in the simulator to get a feel for
how it works.
Use "Build -> Build and Run" fro...
CONTD…
Step 8. Step through the program line by line with "STEP INTO
(F11)" button.
Notice DDRB (direction of pins for POR...
SOME EXAMPLES USING
EMBEDDED C
1. Blinking of even no. lights at port
HARDWARE INTERFACING'S AND CODING:
Seven Segment Interfacing with Microcontroller
 LCD interfacing with Microcontroller
7 SEGMENT
DISPLAY
CONTD…
LCD(4-BITS) INTERFACING
PB0/ICP1
14
PB1/OC1A
15
PB2/SS/OC1B
16
PB3/MOSI/OC2
17
PB4/MISO
18
PB5/SCK
19
PB6/TOSC1/XTAL1
9
PB...
LCD(8-BITS) INTERFACING
D7
14
D6
13
D5
12
D4
11
D3
10
D2
9
D1
8
D0
7
E
6
RW
5
RS
4
VSS
1
VDD
2
VEE
3
LCD1
LM016L
PB0/ICP1
...
THANK YOU…
embedded system and AVR
Upcoming SlideShare
Loading in …5
×

embedded system and AVR

2,163 views

Published on

containing basics of embedded system and avr with its description , programming with embedded c and hardware interfacing

Published in: Engineering
  • Be the first to comment

embedded system and AVR

  1. 1. SOFCON TRAINING PRESENTATION Embedded system Report By: URVASHI KHANDELWAL
  2. 2. CONTENT • Embedded system Introduction Applications • AVR microcontroller Introduction Features PIN and port Description Embedded C Hardware Interfacing and Coding
  3. 3. DEPARTMENT OF EMBEDDED SYSTEM • An Embedded system is a combination of computer hardware and software which is designed to perform many operations such as to access the data, process the data, store the data and also control the data in electronics based systems. In embedded systems, software commonly known as firmware Basically embedded systems are task specific devices • Embedded system is defined as a way of working, organizing, performing single or multiple tasks according to a set of rules • Hence it covers all the industries like - BIOTECHNOLOGY -TELECOME - MILTARY - AUTOMOBIEL - CONSUMER ELECTRONICS
  4. 4. APPLICATION
  5. 5. AVR (ADVANCED VIRTUAL RISC) ATMEGA 8 MICRO-CONTROLLER
  6. 6. INTRODUCTION • ATmega8 is a 8-bit microcontroller based on the AVR RISC architecture • By executing powerful instructions in a single clock cycle, the ATmega8 achieves throughput approaching 1 MIPS per MHz • Instruction in program memory are executed with single level pipelining • This concept enables instructions to be executed in every clock cycle
  7. 7. FEATURES • High-performance 8 bit Microcontroller • 32 x 8 General Purpose Working Registers • Six ADC channels in PDIP package • Internal Calibrated Oscillator
  8. 8. MEMORY SEGMENTS • 8K Bytes of Flash program memory • 512 Bytes EEPROM (Electrically Erasable Programmable Read Only Memory) • 1K Byte Internal RAM (Random Access Memory) • Write/Erase Cycles: 10,000 Flash/100,000 EEPROM • Data retention: 20 years at 85°C/100 years at 25°C
  9. 9. TYPES OF PACKAGES • 28-pin PDIP (Plastic Dual In-line Package) opaque molded plastic pressed around a tin-, silver-, or gold-plated lead frame that supports the device die and provides connection pins. • 32-pin TQFP (Thin Quad film Package) For easy soldering
  10. 10. PIN OUT PLASTIC DUAL IN-LINE PACKAGE
  11. 11. PIN DESCRIPTION • VCC Digital supply voltage • GND Ground • RESET A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running • AREF The analog reference pin for the A/D Converter • AVCC The supply voltage pin for the A/D Converter
  12. 12. • Three ports i.e PortB, PortC, PortD -General Purpose 8 Bit bidirectional I/O • Three registers associated with every port DDRx – Data Direction Register PINx – Port input PORTx- Port output *Note – ‘x’ is subscript and could be either of B, C, D PORTS
  13. 13. PORT B (PB7..PB0) • Port B is an 8-bit bi-directional I/O port • Can be used either as a input port or as output port ( direction must be specified in programming)
  14. 14. REGISTER DESCRIPTION OF I/O PORTS
  15. 15. USING EMBEDDED C • Embedded C is nothing but a subset of C language which is compatible with certain microcontrollers. • Some features are added using header files like <avr/io.h>, <util/delay.h>. • scanf() and printf() are removed as the inputs are scanned from the sensors and outputs are given to the ports. • Control structures remain the same like if-statement, for loop, do-while etc. Programming Microcontroller
  16. 16. SOFTWARE’S USED: AVR STUDIO 4.0 AVR studio is an Integrated Development Environment (IDE) by ATMEL for developing applications based on 8-bit AVR microcontroller PROTEUS 7 DESIGN SUITE • this software helps programmers in hardware implementations. • It provides a huge number of electronic components and • REAL TIME ANOMATONS of the hardware designs. • This is the perfect tool for engineers to test their microcontroller designs Before constructing a physical prototype in real time
  17. 17. HOW TO WORK AT AVR STUDIO Step1. Start AVR Studio on your workstation. Select "New Project". Type is "AVR-GCC". Project name: "MyFirstProject". Check off the "create folder" box. Modify the location if desired. Step2. Click "Next".
  18. 18. CONTD… Step3. Debug platform should be "AVR Simulator". Device Is "ATMEGA 8". Step4. Click Finish. You will now be in the IDE.
  19. 19. CONTD…
  20. 20. CONTD… . Step5.Write the following code into the window in the middle of the screen (the window for My FirstProject.c): This is a quick and dirty way to turn both LEDs on. This code tells all of Port B to become outputs by writing 0xFF (binary 1111 1111) to DDRB which is the data direction register for port B.
  21. 21. Step 6.Compile the code with "Build -> Build" from the menu, or the F7 shortcut for "Build". The bottom window will show the progress and results. You should see "Build succeeded with 0 warnings. If there is an error, check your code for typos. The error message should give you the offending line number A successful compile will result in a .hex file being generated. This is the binary code in a format ready to be burned into your AVR chip by the programmer. (Think of the .hex file as a program that the target AVR chip can run once we put it on there, sort of like writing to a memory card.) You should be able to locate MyFirstProject.hex in your project dir. For me, it was in "AVRsrcMyFirstProjectdefault".
  22. 22. CONTD…. Step 7. Now let's debug the code in the simulator to get a feel for how it works. Use "Build -> Build and Run" from the menu, or use the CTRL-F7 shortcut. Note the following: We have a yellow arrow at the current execution. We have some debugging keys at the top (we want STOP and STEP INTO now). We have "AVR SIMULATOR" at the bottom which is no longer greyed out. Now click on the right pane on PORTB so we can look at it in the "I/O View". The bottom right window will populate with DDRB, PINB, and PORTB. These represent some states of the simulator's virtual ATTINY45 hardware.
  23. 23. CONTD… Step 8. Step through the program line by line with "STEP INTO (F11)" button. Notice DDRB (direction of pins for PORTB: input or output) changes on the bottom right after "DDRB = 0xff" is executed. Step 9. Step again and notice that PORTB becomes set to 0xff (all logical 1 output) when "PORTB = 0xff" is executed. We are now at the end of the program. Click "STOP DEBUGGING" (the blue square button on the menu bar ) or CTRL-SHIFT-F5 to stop the debugger and chip simulator and return to the coding view.
  24. 24. SOME EXAMPLES USING EMBEDDED C 1. Blinking of even no. lights at port
  25. 25. HARDWARE INTERFACING'S AND CODING: Seven Segment Interfacing with Microcontroller  LCD interfacing with Microcontroller
  26. 26. 7 SEGMENT DISPLAY
  27. 27. CONTD…
  28. 28. LCD(4-BITS) INTERFACING PB0/ICP1 14 PB1/OC1A 15 PB2/SS/OC1B 16 PB3/MOSI/OC2 17 PB4/MISO 18 PB5/SCK 19 PB6/TOSC1/XTAL1 9 PB7/TOSC2/XTAL2 10 PC6/RESET 1 PD0/RXD 2 PD1/TXD 3 PD2/INT0 4 PD3/INT1 5 PD4/T0/XCK 6 PD5/T1 11 PD6/AIN0 12 PD7/AIN1 13 PC0/ADC0 23 PC1/ADC1 24 PC2/ADC2 25 PC3/ADC3 26 PC4/ADC4/SDA 27 PC5/ADC5/SCL 28 AREF 21 AVCC 20 U1 ATMEGA8 D7 14 D6 13 D5 12 D4 11 D3 10 D2 9 D1 8 D0 7 E 6 RW 5 RS 4 VSS 1 VDD 2 VEE 3 LCD1 LM016L
  29. 29. LCD(8-BITS) INTERFACING D7 14 D6 13 D5 12 D4 11 D3 10 D2 9 D1 8 D0 7 E 6 RW 5 RS 4 VSS 1 VDD 2 VEE 3 LCD1 LM016L PB0/ICP1 14 PB1/OC1A 15 PB2/SS/OC1B 16 PB3/MOSI/OC2 17 PB4/MISO 18 PB5/SCK 19 PB6/TOSC1/XTAL1 9 PB7/TOSC2/XTAL2 10 PC6/RESET 1 PD0/RXD 2 PD1/TXD 3 PD2/INT0 4 PD3/INT1 5 PD4/T0/XCK 6 PD5/T1 11 PD6/AIN0 12 PD7/AIN1 13 PC0/ADC0 23 PC1/ADC1 24 PC2/ADC2 25 PC3/ADC3 26 PC4/ADC4/SDA 27 PC5/ADC5/SCL 28 AREF 21 AVCC 20 U1 ATMEGA8
  30. 30. THANK YOU…

×