Advanced Embedded Systems
Total Page:16
File Type:pdf, Size:1020Kb
Advanced Embedded Systems | Punit Narang | Manoj Gulati | Sourabh Sankule | P a g e | i Contents Chapter 1 - Introduction to Embedded Electronics ........................................................................... 1 1.1 Embedded System .................................................................................................................. 1 1.1.1 Example of Embedded System ........................................................................................ 2 1.1.2 Characteristics ................................................................................................................. 3 1.1.3 User interface .................................................................................................................. 3 1.1.4 Processors in embedded systems ................................................................................... 4 1.1.5 Peripherals ...................................................................................................................... 4 1.2 Microcontrollers...................................................................................................................... 4 1.2.1 What is a Microcontroller? ............................................................................................. 4 1.2.2 Microcontrollers vs. Microprocessors ............................................................................ 5 1.2.3 Development/Classification of microcontrollers (Invisible) ........................................... 5 1.2.4 Development of microprocessors (Visible) ..................................................................... 5 1.2.5 Internal Structure of a Microcontroller .......................................................................... 7 1.2.6 Harvard vs. Princeton Architecture ................................................................................. 7 1.2.7 Princeton Architecture (Single memory interface) ......................................................... 8 1.2.8 Harvard Architecture (Separate Program and Data Memory interfaces) ....................... 9 1.3 Data Memory Organization .................................................................................................. 10 1.3.1 I/O Registers space in Harvard Architecture ................................................................. 11 1.4 CISC (Complex Instruction Set Computer) Processor Architecture ...................................... 12 1.5 RISC (Reduced Instruction Set Computer) Architecture Design ........................................... 12 1.6 RISC & CISC Architecture in Today's Computer Systems ...................................................... 13 1.7 Atmel AVR ............................................................................................................................. 14 1.7.1 Device architecture ....................................................................................................... 14 1.7.2 Program memory .......................................................................................................... 15 1.7.3 Internal data memory ................................................................................................... 15 1.7.4 Internal registers ........................................................................................................... 15 1.7.5 Program execution ........................................................................................................ 15 Chapter 2 - Introduction to Atmega128A Microcontroller .............................................................. 16 2.1 Features ................................................................................................................................ 16 2.2 Pin Configuration .................................................................................................................. 17 2.3 Block Diagram ....................................................................................................................... 18 2.4 Block Diagram of the AVR Architecture ................................................................................ 19 2.5 Program Memory Map ......................................................................................................... 20 Advanced Embedded | Punit Narang | Manoj Gulati | Sourabh Sankule| June 2011 P a g e | ii 2.6 Data Memory Map ................................................................................................................ 20 2.7 Clock System ......................................................................................................................... 21 2.7.1 Clock Options ................................................................................................................ 21 2.7.2 Default Clock Source ..................................................................................................... 21 Chapter 3 - JTAG Description and Installing FTDI Driver .................................................................. 22 3.1 JTAG Pin out .......................................................................................................................... 22 3.2 JTAG Schematic ..................................................................................................................... 22 3.3 JTAG Image ............................................................................................................................ 22 3.4 How to install FTDI drivers (USB-UART chip) ........................................................................ 23 Chapter 4 - WiNet (Wireless-Networking) Board Description ......................................................... 27 4.1 Peripherals ............................................................................................................................ 27 4.2 Powering the Board .............................................................................................................. 30 4.2.1 Using DC Adapter .......................................................................................................... 30 4.2.2 Using USB ...................................................................................................................... 30 4.2.3 Powering Ethernet Section ........................................................................................... 31 4.3 Microcontroller ..................................................................................................................... 31 4.4 LEDs ....................................................................................................................................... 31 4.5 Switches ................................................................................................................................ 31 4.6 USB to UART interface .......................................................................................................... 31 4.7 CC2500 Module ..................................................................................................................... 32 4.8 Temperature Sensor ............................................................................................................. 33 4.9 Light Sensor ........................................................................................................................... 33 4.10 Ethernet Interface ................................................................................................................. 34 4.11 Programming WiNet Board ................................................................................................... 34 4.12 Connecting AVR JTAG ICE to WiNet Board ........................................................................... 35 Chapter 5 - Embedded Development Tools ..................................................................................... 36 5.1 Cross Compiler ...................................................................................................................... 36 5.1.1 AVR Toolchain ............................................................................................................... 36 5.2 Installing Toolchain ............................................................................................................... 36 5.3 Building the executable ........................................................................................................ 37 5.3.1 Compiling the first program .......................................................................................... 37 5.4 Programming the Micro-controller ....................................................................................... 38 5.5 The Make Utility .................................................................................................................... 38 5.5.1 Building makefile ........................................................................................................... 38 Advanced Embedded | Punit Narang | Manoj Gulati | Sourabh Sankule| June 2011 P a g e | iii 5.5.2 Compiling programs using make ................................................................................... 39 5.6 IDE – Integrated Development Environment ........................................................................ 40 5.7 Introduction to AVR Studio ................................................................................................... 40 5.8 Creating new Project ............................................................................................................