8051 Based Embedded System Design
Transcript of 8051 Based Embedded System Design
Product: NASA's Mars Sojourner Rover.
Microprocessor: 8-bit Intel 80C85.
Introduction To Embedded systems
“An embedded system is a combination of Computer Hardware and software designed to control the additional Hardware attached to it”.
More.., An embedded system is a specialized computer
system that is part of a larger system or machine.
Embedded systems can also be thought of as information processing subsystems integrated in a larger system.
As part of a larger system it largely determines its functionality.
Desktop vs Embedded Systems.
Embedded systems are dedicated to specific tasks, whereas PC’s are generic computing platforms.
The implications of software failure is much more severe in embedded systems than in desktop systems.
How Embedded Systems are Different ? They are application specific. Supported by wide array of processor and
processor architectures. Cost sensitive Real time constraints. Power constraints. Demand for special tools for their complete design.
Embedded Product Life Cycle 1. Exploring the components. 2. Selecting the components 3. Programming. 4. Detailed Development. 5. Unit testing. 6. Integration 7. System Under Test.
A Typical Embedded System
CPU
SOFTWARE
MEMORY
D/A ConversionA/D Conversion
AuxiliarySystems(PowerCooling)
DIAGNOSTICPORT
HumanInterface
ELECTROMECHANICALBACKUP & SAFETY
EXTERNAL ENVIRONMENT
FPGA/ASIC
Actuators
Significance With an Example.
Automobile emissions have decreased by 90% over the last 20 years, primarily due to the use of micro processors in the embedded systems.
The open loop fuel control systems, characterized by carburetor is now a fuel injected, closed loop system using sensors to provide control under wide range of operating conditions.
Sensors & Actuators in Embedded Systems
Categories of Embedded
Communication devices modems, cellular phones Home Appliances CD player, VCR, microwave oven Control Systems Automobile anti-lock braking systems, robotics,
satellite control
Characteristics of Embedded Systems Application Specific Systems. Reactive Systems. Distributed Systems. Heterogeneous Architectures. Harsh environment. System safety and reliability. Small and low weight. Cost sensitivity. Power management.
Requirements for Embedded Systems Functional Requirements. Temporal Requirements (Timeliness). Dependability Requirements
Compilation Tools
Native Compilers. Cross Compilers.
GNU Auto tools
Used to configure software for different compilation environments
Contains many ready made tests for testing compiler tool-chain ,C-library etc. features
Composed of Autoconf, Automake, Libtool, m4 tools
Produce ’configure’ script which is shipped with the software
Embedded Applications
The first Embedded System: Apollo Guidance Computer.
MK 57 Advanced Vertical Launching System (AVLS) is the next-generation naval missile launching system for future surface combatants of the U.S. Navy
Shipboard Self-Defense System (SSDS) is a family of systems designed for use in future Navy ship combat systems such as DD(X) destroyers
IDM (improved data modem) is a communications and targeting system that can interface between the different communications formats in use by the U.S. Army and the U.S. Air Force. A real-time operating system resides inside the IDM
Automated Radar Terminal Systems (ARTS) manage air-traffic control at USA airport locations such as New York, Dallas/Fort Worth, Chicago, Southern California, and Atlanta
Real-Time System
Definition: Any system in which the time at which output is produced is significant.
This is usually because the input corresponds to some movement in the physical world, and the output has to relate to the same movement.
The lag from input time to output time needs to be sufficiently small for acceptable timeliness.
Classifications Of Real Time Systems Hard Real time Systems
Soft Real Time Systems
Firm Real Time
An RTOS Kernel provides an Abstraction Layer between Application Software and Embedded Hardware
Design Flow
The Embedded System Design Life Cycle
Product Specifications
•Product requirements
•Customer needs
•Development tools required to develop the
product.
•Concentrating on the performance to cost ratio.
PartitionDeciding on the things to be implemented in hardware and software
Hardware: cost increases speed increases
Software: low cost
Example:Implementing FPU.
Developing software and hardware for microcontroller based systems involves the use of a range of tools that can include editors, assemblers, compilers, debuggers ,simulators, emulators and flash/ OTP programmer.
IntegrationLoading the software into the hardware
Demand for debugging circuitry.
The following are the debug requirements
Run control: The ability to start, stop, peak and poke processor and the memory.
Memory substitution: Replacing RAM based memory with RAM for rapid and easy code download, debug and repair cycles.
Real time analysis: Following code flow in real time with real time.
Writing The Code
Software Code for a microcontroller is written in a programming language of choice.
This source code is written with a standard ASCII text editor and saved as an ASCII text file.
A higher level language like C is for the most part independent of a microcontroller's specific architecture, but still requires some controller specific extensions of the standard language to be able to control all of a chip's peripherals and functionality.
Translating the code
The source code needs to be translated into instructions the microcontroller can actually execute.
A microcontrollers instruction set is represented by "op codes". Op codes are a unique sequence of bits ("0" and "1") that are decoded by the controller's instruction decode logic and then executed.
Instead of writing opcodes in bits, they are commonly represented as hexadecimal numbers, whereby one hex number represents 4 bits within a byte, so it takes two hex numbers to represent 8 bits or 1 byte.
Debugging Tools
Simulators
Simulators try to model the behavior of
the complete microcontroller in software
Debugging
A Debugger allows you to download your code to the emulator's memory and then control all of the functions of the emulator from a PC.
Common debugging features include the capability to examine and modify the microcontroller's on-chip registers, data- and program-memory;
pausing or stopping program executing at defined program locations by setting breakpoints;
Single-Stepping (execute one instruction at a time) through the code; and looking at a history of executed code (trace).
Starter kits
Starter Kits, commonly bundle a hardware board and in-system programmer with some software components
(assembler, linker, debugger, sometimes an IDE and a code-size limited "evaluation" version of a compiler)
To allow for very basic emulation and debugging functions.
Emulator
An emulator is a piece of hardware that ideally behaves exactly like the real microcontroller chip with all its integrated functionality. It is the most powerful debugging tool of all.
A microcontroller's functions are emulated in real-time and non-intrusively.
All emulators contain 3 essential functions in different implementation forms:
The Emulator Control Logic, including Emulation Memory .
The actual Emulation Device
A Pin Adapter that gives the emulator's target connector the same "package" and pin out as the microcontroller to be emulated
Design of Embedded Systems
system specification – emphasis on integrated design
Programming languages and language requirements,
Operating Systems (including real-time kernels),
Architecture and Hardware.
Laboratory projects in data acquisition, instrumentation, embedded control, including Real-Time Kernel Enhancement, Embedded Systems software Development, Hardware/Software Co-Design
Design of Embedded Systems --Outcomes
comprehend organization of various components of an embedded system.
Develop embedded applications using off-the-shelf software and hardware components and production tools.
Assess the cost effectiveness of various design alternatives.
Embedded Systems Engineering - Outcomes
Understand and address (within a software
architecture) the critical issues most often associated with embedded software including high availability, performance, integrity, survivability, reliability safety, and predictability.
model and analyze a system in order to observe system characteristics and the system architecture level.
to develop systems utilizing both hardware and software components.
to perform testing at different levels such as the component, integration, and system levels.
Future
Continue to examine requirements motivated by next generation of embedded communications systems lightning-fast and intelligent network
infrastructure. Must be able to analyze and develop
software and hardware solutions for these infrastructures
Device Driver For 8051
Pin Description Of ADC
VccCSRDWRClkin
D0 – D7
INTR
Clkr
Vin+Vin-
AGnd
DGndVref\2
1
2
3
4
5
6
7
8
9
10
15
1112
13
14
16
17
18
19
Interfacing With Microcontroller
CS : Used to activate the adc0804. active low.
RD: This is an input signal and active low.The ADC converts the data to binary and holds it in the internal register. This pin is used to get the converted data out of the chip.
WR: converter pin. This initiates the DAC to start the conversion process.
The conversion rates depends on the clock in values.
When data conversion is complete INTR pin is forced low.
F=1/rc Vref/2: pin is open then the volatage ranges
is between 0 to 5volts.
Clr a Mov p1,#0ffh ; making port1 as an input
port. Setb intr Clr wr Setb wr Here:jb intr here Clr rd ;conversation finished enable
rd Mov a,p1 Setb rd
Driver for ADC in assembly
Char value x;main(){ p1 = 0xffIntr =1;Wr=1;Rd=1;While(1){Wr=0;wr=1;While(intr==1)Rd=0; X=p1Rd=1.}}
In C Version
Role Of Sensors
A sensor is a type of Transducer. Sensors are used in everyday life. Applications
include automobiles, machines, aerospace, medicine, industry and robotics
Types Of Sensors
Thermal Electromagnetic Mechanical Chemical Optical and radiation Acoustic
Thermal sensors
Temperature sensors: thermometers, thermocouples.
Temperature sensitive resistors Thermistors and resistance temperature detectors
Bi-Metal : Thermometers and thermostats Heat sensors: bolometer, calorimeter
Mechanical sensors
Pressure sensors Mechanical sensors: Acceleration sensor
Chemical sensors
Chemical sensors detect the presence of specific chemicals or classes of chemicals. Examples include oxygen sensors
Optical and radiation sensors
Electromagnetic time-of-flight. Generate an electromagnetic impulse, broadcast it, then measure the time a reflected pulse takes to return
Commonly known as – RADAR (Radio Detection And Ranging)
Infra red sensors
PIN DESCRIPTION OF LM 35
Features Of LM 35
Calibrated directly in ß Celsius (Centigrade)
Suitable for remote applications Low cost due to wafer-level trimming Operates from 4 to 30 volts Less than 60 mA current drain Low impedance output, 0.1 X for 1 mA
load
PIN DESCRIPTION OF LM 336
FEATURES OF LM 336
Low temperature coefficient . Wide operating current of 400ma to10ma 0.2w dynamic impedance . Guaranteed temperature stability . Fast turn-on