Sunday 30 July 2017

NEONATAL INTENSIVE CARE UNIT (NICU)

 

INTRODUCTION

                  Today, technology is advancing in all possible directions, especially in the field of health and care products especially where the requirements are supporting life. Additional care is taken when it comes to babies. Especially in case of premature (infants that come into the world earlier than full-term) babies / Low birth weight (less than 1Kg) babies, who wouldn’t have developed the thermo-regulatory mechanism (i.e. not able to adjust to the outside environmental temperature because of lack the body fat) the precaution is doubled.

The Neonatal Intensive Care Unit (NICU) is designed to provide an atmosphere that limits stress on the infant and meets basic needs of warmth, nutrition, care and protection to assure proper growth and development. In such cases babies have to be kept either naked / half-naked in an incubator (which has the capability to maintain the temperature inside it and comforts the baby).

 

SYSTEM REQUIREMENTS

SOFTWARE REQUIREMENTS

FLASH _MAGIC

      This is a Tool from Philips for Programming the controllers that are flash programmable and that supports serial programming of devices.

Flash microcontroller can be erased and re-written as many times as possible.

The Boot loader Inside the Chip understands the protocol received from computer through serial port.

Flash Magic identifies the hardware when the controller chip is inserted. Program for the target microcontroller can be now either read back or sent as Intel format HEX file.

Support locking of devices can be done to prevent reading back of programmed chip.

After locking the chip can still be erased and used again for loading new programs.

 

HARDWARE REQUIREMENTS

TEMPARECHAR SENSOR( LM35)

The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±1⁄4°C at room temperature and ±3⁄4°C over a full −55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level.

 

PIC CONTROLLER (PIC16F877A)

            PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, extensive collection of application notes, availability of low cost or free development tools, and serial programming (and re-programming with flash memory) capability.PIC16F877A is a latest Enhanced Flash Microcontrollers  From MicrochipPIC16F877A is very popular because of its affordable price. Apart from that it is also very easy to be assembled. Additional components that you need to make this IC work are just a 5V power supply adapter, a 20MHz crystal oscillator and 2 units of 22pF capacitors.

DC MOTER

          An adjustable speed drive is a device that controls speed, and direction of an AC or DC motor .Some high performance drives are able to run in torque regulation mode.

         Magnets are polarized, with a positive and a negative side. A DC motor uses the attraction between opposite poles and the repulsion of like poles to convert electric energy into kinetic energy. As the magnets within the DC motor attract and repel one another, the motor turns. The magnetic force on the armature works perpendicular to both wire and magnetic field. An electric switch called a commutator reverses the direction of the electric current in the armature twice every cycle. The poles of the electromagnet push and pull against the permanent magnets on the outside of the motor. As the poles of the armature electromagnet pass the poles of the permanent magnets, the commutator reverses the polarity of the armature electromagnet. During that instant of switching polarity, inertia keeps the motor going in the proper direction.

RELAY

          A  relay  is  an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations

LCD

Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose. The most common type of LCD controller is HITACHI 44780 which provides a simple interface between the controller & an LCD. These LCD's are very simple to interface with the controller as well as are cost effective .The most commonly used ALPHANUMERIC displays are 1x16 (Single Line & 16 characters), 2x16 (Double Line & 16 character per line) & 4x20 (four lines & Twenty characters per line). 

The LCD requires 3 control lines (RS, R/W & EN) & 8 (or 4) data lines. The number on data lines depends on the mode of operation. If operated in 8-bit mode then 8 data lines + 3 control lines i.e. total 11 lines are required. And if operated in 4-bit mode then 4 data lines + 3 control lines i.e. 7 lines are required. How do we decide which mode to use? It’s simple if you have sufficient data lines you can go for 8 bit mode & if there is a time constrain i.e. display should be faster then we have to use 8-bit mode because basically 4-bit mode takes twice as more time as compared to 8-bit mode.      

ZIGBEE

          ZigBee is a new wireless technology developed by the igBee Alliance to overcome the limitations of BLUETOOTH and Wi-Fi. ZigBee is developed on the top of IEEE 802.15.4 standard. It is designed for low-power consumption allowing batteries to essentially last forever .Though we have couple of methods for multimedia applications, till now nothing has been developed for sensor at working and control machines which require longer battery life and continuous working without human intervention. ZigBee devices allow batteries to last up to ears using primary cells (low cost) without any chargers (low cost and easy installation).

POWER SUPPLY

 The power supply block consists of a Voltage Regulator, Bridge rectifier, Step-down Transformer and a capacitor. This series of fixed-voltage integrated circuit voltage regulators is designed for a wide range of applications these applications include on –card regulation for elimination of noise and distribution problem associated with single point regulation. Each of these regulators can deliver up to 1.5 amps of output current

 

BLOCK DIAGRAM

ADVANTAGES

1. By automation of the controlling system the errors will be very less compared     to manual.

2. More accurate measured injection of liquids into patient body during anesthesia.

DIS ADVANTAGES:

1. Sometimes system may fail to operate as it is designed to operate because of any major errors in the system.

2. All time we cannot depend upon machines or controllers to observe a patient

Who’s life is more valuable than machines.

APPLICATION:

1.      Mainly Used in Operation Theatres of hospitals.

2.       Baby care unit

 

CONCLUSION:

The Neonatal Intensive Care Unit (NICU) is designed to provide an atmosphere that limits stress on the infant and meets basic needs of warmth, nutrition, care and protection to assure proper growth and development. In such cases babies have to be kept either naked / half-naked in an incubator (which has the capability to maintain the temperature inside it and comforts the baby).

Here we propose to design NICU where all the things can be automated and can be monitored at regular basis.

Saturday 29 July 2017

Getting Started with Keil uVision

Introduction to Micro vision Keil (IDE)

Keil is a cross compiler. So first we have to understand the concept of compilers and cross compilers. After then we shall learn how to work with keil.

 

Concept of compiler: -

 

Compilers are programs used to convert a High Level Language to object code. Desktop compilers produce an output object code for the underlying microprocessor, but not for other microprocessors. I.E the programs written in one of the HLL like ‘C’ will compile the code to run on the system for a particular processor like x86 (underlying microprocessor in the computer). For example compilers for Dos platform is different from the Compilers for Unix platform

 

So if one wants to define a compiler then compiler is a program that translates source code into object code. The compiler derives its name from the way it works, looking at the entire piece of source code and collecting and reorganizing the instruction. See there is a bit little difference between compiler and an interpreter. Interpreter just interprets whole program at a time while compiler analyzes and execute each line of source code in succession, without looking at the entire program.

 

The advantage of interpreters is that they can execute a program immediately. Secondly programs produced by compilers run much faster than the same programs executed by an interpreter. However compilers require some time before an executable program emerges. Now as compilers translate source code into object code, which is unique for each type of computer, many compilers are available for the same language.

 

Concept of cross compiler: -

 

A cross compiler is similar to the compilers but we write a program for the target processor (like 8051 and its derivatives) on the host processors (like computer of x86)

It means being in one environment you are writing a code for another environment is called cross development. And the compiler used for cross development is called cross compiler

 

So the definition of cross compiler is a compiler that runs on one computer but produces object code for a different type of computer. Cross compilers are used to generate software that can run on computers with a new architecture or on special-purpose devices that cannot host their own compilers. Cross compilers are very popular for embedded development, where the target probably couldn't run a compiler. Typically an embedded platform has restricted RAM, no hard disk, and limited I/O capability. Code can be edited and compiled on a fast host machine (such as a PC or Unix workstation) and the resulting executable code can then be downloaded to the target to be tested. Cross compilers are beneficial whenever the host machine has more resources (memory, disk, I/O etc) than the target.  Keil C Compiler is one such compiler that supports a huge number of host and target combinations. It supports as a target to 8 bit microcontrollers like Atmel and Motorola etc.

 

Why do we need cross compiler?

 

Ø  There are several advantages of using cross compiler. Some of them are described as follows

 

Ø  By using this compilers not only can development of complex embedded systems be completed in a fraction of the time, but reliability is improved, and maintenance is easy.

 

Ø  Knowledge of the processor instruction set is not required. A rudimentary knowledge of the 8051’s memory architecture is desirable but not necessary.

 

Ø  Register allocation and addressing mode details are managed by the compiler.

 

Ø  The ability to combine variable selection with specific operations improves program readability.

 

Ø  Keywords and operational functions that more nearly resemble the human thought process can be used.

 

Ø  Program development and debugging times are dramatically reduced when compared to assembly language programming.

 

Ø  The library files that are supplied provide many standard routines (such as formatted output, data conversions, and floating-point arithmetic) that may be incorporated into your application.

 

Ø  Existing routine can be reused in new programs by utilizing the modular programming techniques available with C.

 

Ø  The C language is very portable and very popular. C compilers are available for almost all target systems. Existing software investments can be quickly and easily converted from or adapted to other processors or environments.

 

Ø  Now after going through the concept of compiler and cross compilers lets we start with Keil C cross compiler.

 

Keil C cross compiler: -

 

Keil is a German based Software development company. It provides several development tools like

Ø  IDE (Integrated Development environment)

Ø  Project Manager

Ø  Simulator

Ø  Debugger

Ø  C Cross Compiler , Cross Assembler, Locator/Linker

 

Keil Software provides you with software development tools for the 8051 family of microcontrollers. With these tools, you can generate embedded applications for the multitude of 8051 derivatives. Keil provides following tools for 8051 development

Ø  C51 Optimizing C Cross Compiler,

Ø  A51 Macro Assembler,

Ø  8051 Utilities (linker, object file converter, library manager),

Ø  Source-Level Debugger/Simulator,

Ø  µVision for Windows Integrated Development Environment.

 

The keil 8051 tool kit includes three main tools, assembler, compiler and linker.

An assembler is used to assemble your 8051 assembly program

A compiler is used to compile your C source code into an object file

A linker is used to create an absolute object module suitable for your in-circuit emulator.

 

8051 project development cycle: - these are the steps to develop 8051 project using keil

Ø  Create source files in C or assembly.

Ø  Compile or assemble source files.

Ø  Correct errors in source files.

Ø  Link object files from compiler and assembler.

Ø  Test linked application.

now let us start how to work with keil.

 

working with keil: -

 

To open keil software click on start menu then program and then select keil2 (or any other version keil3 etc. here the discussion is on keil2 only). Following window will appear on your screen

     

you can see three different windows in this screen.

1) project work space window

2) editing window

3) output window.

 

Project workspace window is for showing all the related files connected with your project. Editing window is the place where you will edit the code. Output window will show the output when you compile or build or run your project. Now to start with new project follow the steps.

Ø  click on project menu and select new project

Ø  you will be asked to create new project in specific directory

Ø  just move to your desired directory and there create a new folder for your project named "first". Here I am creating new project in d:\keil2\myprojects\first as shown in figure 

Ø   give the name of project as "test". By default it will be saved as *.v2 extension.

Ø  now you will be asked to chose your target device for which you want to write the program.

Ø  scroll down the cursor and select generic from list. expand the list and select 8051 (all variants)

Ø  when you click OK, you will be asked to add startup code and file to your project folder. click yes. Now on your screen expand target1 list fully. You will see following window.

Ø  now click on file menu and select new file. editor window will open. Now you can start writing your code.

Ø  as you start writing program in C, same way here also you have to first include the header file. Because our target is 8051 our header file will be "reg51.h"

Ø  after including this file. just right click on the file and select open document <reg51.h>. The following window will appear

Ø  if you scroll down cursor you will see that all the SFRs like P0-P3, TCON, TMOD, ACC, bit registers and byte registers are already defined in this header file. so one can directly use these register names in coding

Ø  now you can write your program same as c language starting with void main()

Ø  after completing the code save the file in project folder with ".c" extension.

Ø  now right click on "source group 1" in project workspace window. select "add files to source gorup 1"

Ø  select the C file you have created and click add button 

Ø  you will see that the c file has been added in source group

Ø  now to compile the program from project menu select "build target". In the output window you will see the progress

Ø  if there is any compilation error then target will not be created. Remove all the errors and again build the target till you find "0 Error(s)"

Ø  now you are ready to run your program. from debug menu select "start/stop debug session"

Ø  you will see your project workspace window now shows most of the SFRs as well as GPRs r0-r7. also one more window is now opened named "watches". in this window you can see different variable values. 

Ø  to add variable in watch window goto "watch#1" tab. then type F2 to edit and type the name of your variable

Ø  if you want to see the output on ports go to peripheral menu and select I/O ports. select the desire port. you can give input to port pins by checking or unchecking any check box. here the check mark means digit 1 and no check mark means 0. the output on the pin will be shown in same manner

Ø  to run the program you can use any of the option provided "go", "step by step", "step forward", "step ove" etc.

Ø  now after testing your program you need to down load this program on your target board that is 8051. for this you have to create hax file

Ø  to create hex file first stop debug session. Again you will be diverted to project workspace window.

Ø  right click on "target 1" and select "option for target 1". Following window will appear. 

Ø  select output tag and check "create hex file" box

Ø  now when you again build your program you will see the message in output window "hex file is created".

Ø  in your project folder you can see the hex file with same name of your project as "test.hex".

Ø  this file you can directly load in 8051 target board and run the application on actual environment.

So here I have described the procedure to create a project in keil for 8051 micro controller. To see some sample programs for 8051 in keil just go through the link "sample programs in keil" so that you can get the idea how to write a program for 8051 in keil C.  

 

KEIL Development Tool

Keil software provides the ease of writing the code in either C or
ASSEMBLY. U-VISION 2, the new IDE from Keil Software combines Project
management, Source Code Editing and Program Debugging in one powerful

environment. It acts as a CROSS-COMPILER.

How to Create a New Project

  1. Select the Project from the menu bar.
  2. Select New Project.
  3. Give the File Name. A project with extension of .uv2 will be created

 

Selecting the Device
  1. After giving the file name the device list windows opens.
  2. Select the respective company’s microcontroller IC that is going to be implemented in hardware.
  3. From the drop down arrow, we get a list of all the chips from that particular manufacturer. Choose the appropriate one.
  4. Now the target is ready.
  5. The data sheets and user manuals are automatically added.

 

Configuring the essentials

 

  1. Right Click on Target to view the options for Target 1.
  2. The Target tab enables to give the Starting address and size of RAM and ROM. We also have to specify the frequency of the crystal used which in our case is 11.0592Hz.
  3. The Output tab has the option to create the HEX file. Confirm the check box given beside it.
  4. The A166 and C51 tabs shows the compiler options.

Addition of files in Source group

 

  1. After the Target is created the source group is added to it.
  2. Select the file menu and choose the ‘New’ option in it to get a page. Save the same with a .a51 or .asm extension. These assembler files are the ones recognized by the compiler.
  3. Right click on source group and select add files to include the program. Select the assembler files created earlier and confirm the action. The selected files appear in the left-hand side project window.
  4. These files will contain your actual program in assembly or in embedded C language
  5. Options for source group includes the compilers C51 and A51 paths.

 

Running the program

 

 

  1. Any number of sub programs can be added to source group.
  2. To run the program right click on it and select Build Target. When you

build an application with syntax errors, µVision2 will display errors and warning messages in the Output Window – Build page. A double click on a message line opens the source file on the correct location in a µVision2 editor window.

  1. Then select rebuild all  the target files too. With the Rebuild Target

command, all source files are translated, regardless of modifications.

  1. After the target is built, debugging is done.
  2. After all the debugging the file is built again which creates a hex file. This hex file is then used to download to the microcontroller using a programmer kit.

 

 Target Program Execution & Debugging

µVision2 lets execute your application program in several different ways:

Ø  With the Debug Toolbar buttons and the “Debug Menu and Debug Commands”.

Ø  With the Run till Cursor line command in the local menu. The local menu opens with a right mouse click on the code line in the Editor or Disassembly window.

Ø  In the Output Window – Command page you can use the Go, Ostep, Pstep, and Tstep commands.

 

 Watch Window

     The Watch window lets you to view and modify program variables and lists the current function call nesting. The contents of the Watch Window are automatically updated whenever program execution stops. You can enable View Periodic Window Update to update variable values while a target program is running.  The Locals page shows all local function variables of the current function. The Watch pages display user-specify program variables. You add variables in three different ways:

Ø  Select the text <enter here> with a mouse click and wait a second. Another mouse click enters edit mode that allows you to add variables. In the same way you can modify variable values.

Ø  In an editor window open the context menu with a right mouse click and use Add to Watch Window. µVision2 automatically selects the variable name under the cursor position, alternatively you may mark an expression before using that command.

Ø  In the Output Window – Command page you can use the Watch Set command to enter variable names.

 

To remove a variable, click on the line and press the Delete key. The current function call nesting is shown in the Call Stack page. Double clicking on a line shows the invocation an editor window.

 

Introduction to Embedded Systems

What is an Embedded System?

An embedded system can be defined as a computing device that does a specific focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting that specific requirement. The embedded software is also called “firm ware”. The desktop/laptop computer is a general purpose computer. You can use it for a variety of applications such as playing games, word processing, accounting, software development and so on. In contrast, the software in the embedded systems is always fixed.

History:

In the earliest years of computers in the 1940s, computers were sometimes dedicated to a single task, but were too large to be considered "embedded". Over time however, the concept of programmable controllers developed from a mix of computer technology, solid state devices, and traditional electromechanical sequences.

The first recognizably modern embedded system was the Apollo Guidance Computer, developed by Charles Stark Draper at the MIT Instrumentation Laboratory. At the project's inception, the Apollo guidance computer was considered the riskiest item in the Apollo project. The use of the then new monolithic integrated circuits, to reduce the size and weight, increased this risk.

The first mass-produced embedded system was the Autonetics D-17 guidance computer for the Minuteman (missile), released in 1961. It was built from transistorlogic and had a hard disk for main memory. When the Minuteman II went into production in 1966, the D-17 was replaced with a new computer that was the first high-volume use of integrated circuits. This program alone reduced prices on quad nand gate ICs from $1000/each to $3/each, permitting their use in commercial products.

Since these early applications in the 1960s, embedded systems have come down in price. There has also been an enormous rise in processing power and functionality. For example the first microprocessor was the Intel 4004, which found its way into calculators and other small systems, but required external memory and support chips.

In 1978 National Engineering Manufacturers Association released the standard for a programmable microcontroller. The definition was an almost any computer-based controller. They included single board computers, numerical controllers, and sequential controllers in order to perform event-based instructions.

By the mid-1980s, many of the previously external system components had been integrated into the same chip as the processor, resulting in integrated circuits called microcontrollers, and widespread use of embedded systems became feasible.

As the cost of a microcontroller fell below $1, it became feasible to replace expensive knob-based analog components such as potentiometers and variable capacitors with digital electronics controlled by a small microcontroller with up/down buttons or knobs. By the end of the 80s, embedded systems were the norm rather than the exception for almost all electronics devices, a trend which has continued since.

 

 Embedded systems are characterized by some special features listed below:

Ø  Embedded systems do a very specific task; they cannot be programmed to do different things. . Embedded systems have very limited resources, particularly the memory. Generally, they do not have secondary storage devices such as the C DROM or the floppy disk.  Embedded systems have to work against some deadlines. A specific job has to be completed within a specific time. In some embedded systems, called real-time systems, the deadlines are stringent. Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded systems are constrained for power. As many embedded systems operate through a battery, the power consumption has to be very low.

Ø  Embedded systems need to be highly reliable. Once in a while, pressing ALT-CTRL-OEL is OK on your desktop, but you cannot afford to reset your embedded system.

Ø  Some embedded systems have to operate in extreme environmental conditions such as very high temperatures and humidity.

Ø  Embedded systems that address the consumer market (for exam-ple, electronic toys) are very cost-sensitive: Even a reduction of $0.1 is lot of cost saving, because thousands or millions systems may be sold.

Ø  Unlike desktop computers in which the hardware platform is dominated by Intel and the operating system is dominated by Microsoft, there is a wide variety of processors and operating systems for the embedded systems. So, choosing the right plat-form is the most complex task.

 

 APPLICATION AREAS

       Nearly 99 per cent of the processors manufactured end up in embedded systems. The embedded system market is one of the highest growth areas as these systems are used in very market segment- consumer electronics, office automation, industrial automation, biomedical engineering, wireless communication, data communication, telecommunications, transportation, military and so on.

 

Consumer appliances: At home we use a number of embedded systems which include digital camera, digital diary, DVD player, electronic toys, microwave oven, remote controls for TV and air-conditioner, VCO player, video game consoles, video recorders etc. Today’s high-tech car has about 20 embedded systems for transmission control, engine spark control, air-conditioning, navigation etc. Even wristwatches are now becoming embedded systems. The palmtops are powerful embedded systems using which we can carry out many general-purpose tasks such as playing games and word processing.

 

Office automation: The office automation products using embedded systems are copying machine, fax machine, key telephone, modem, printer, scanner etc. Industrial automation: Today a lot of industries use embedded systems for process control. These include pharmaceutical, cement, sugar, oil exploration, nuclear energy, electricity generation and transmission. The embedded systems for industrial use are designed to carry out specific tasks such as monitoring the temperature, pressure, humidity, voltage, current etc., and then take appropriate action based on the monitored levels to control other devices or to send information to a centralized monitoring station. In hazardous industrial environment, where human presence has to be avoided, robots are used, which are programmed to do specific jobs. The robots are now becoming very powerful and carry out many interesting and complicated tasks such as hardware assembly.

 

 CATEGORIES OF EMBEDDED SYSTEMS

 

Based on functionality and performance requirements, embedded systems can be categorized as:

•           Stand-alone embedded systems

•           Real-time systems

•           Networked information appliances

•           Mobile devices

 Stand alone Embedded Systems:

As the name implies, stand-alone systems work in stand-alone mode. They take inputs, process them and produce the desired output. The input can be electrical signals from transducers or commands from a human being such as the pressing of a button. The output can be electrical signals to drive another system, an LED display or LCD display for displaying of information to the users. Embedded systems used in process co~1’rol, automobiles, consumer electronic items etc. fall into this category. In a process control system, the inputs are from sensors that convert a physical entity such as temperature or pressure into its equivalent electrical signal. These electrical signals are processed by the system and the appropriate electrical signals are produced using which an action is taken such as opening a valve. A few embedded systems used at home are shown in fig

REAL TIME SYSTEMS

Embedded systems in which some specific work has to be done in a specific time period are called real-time systems. For example, consider a system that has to open a valve within 30milliseconds when the humidity crosses a particular threshold. If the valve is not opened within 30 milliseconds, a catastrophe may occur. Such systems with strict deadlines are called hard real-time’ systems. In some embedded systems, deadlines are imposed, but not adhering to them once in a while may not lead to a catastrophe. For example, consider a DVD player. Suppose, you give a command to the DVD player from remote control, and there is a delay of a few milliseconds in executing that command. But, this delay won’t lead to a serious implication. Such systems are called soft real-time systems.

NETWORKED INFORMATION APPLIANCES

Embedded systems that are provided with network interfaces and accessed by networks such as Local Area Network or the Internet are called networked information appliances. Such embedded systems are connected to a network, typically a network running TCP/IP (Transmission Control Protocol! Internet Protocol) protocol suite, such as the Internet or a company’s Intranet. These systems have emerged in recent years These systems run the protocol TCP/IP stack and get connected either through PPP or Ethernet to a network and communicate with other nodes in the network. Here are some examples of such systems:

MOBILE DEVICES

Mobile devices such as mobile phones, Personal Digital Assistants (PDAs), smart phones etc. are a special category of embedded systems. Though the PDAs do many general purpose tasks, they need to be designed just like the ‘conventional’ embedded systems. The limitations of –the mobile devices- memory constraints, small size, lack of good user interfaces such as full-fledged keyboard and display etc.-are same as those found in the embedded systems discussed above. Hence, mobile devices are considered as embedded systems. However, the PDAs are now capable of supporting general-purpose application software such as word processors, games, etc.

User interfaces

Embedded systems range from no user interface at all - dedicated only to one task - to full user interfaces similar to desktop operating systems in devices such as PDAs.

Simple systems

Simple embedded devices use buttons, LEDs, and small character- or digit-only displays, often with a simple menu system.

In more complex systems

A full graphical screen, with touch sensing or screen-edge buttons provides flexibility while minimizing space used: the meaning of the buttons can change with the screen, and selection involves the natural behavior of pointing at what's desired. Handheld systems often have a screen with a "joystick button" for a pointing device.  The rise of the World Wide Web has given embedded designers another quite different option: providing a web page interface over a network connection. This avoids the cost of a sophisticated display, yet provides complex input and display capabilities when needed, on another computer. This is successful for remote, permanently installed equipment. In particular, routers take advantage of this ability.

CPU platform

Embedded processors can be broken into two distinct categories: microprocessors (μP) and micro controllers (μC). Micro controllers have built-in peripherals on the chip, reducing size of the system.  There are many different CPU architectures used in embedded designs such as ARM, MIPS, Cold fire/68k, PowerPC, x86, PIC, 8051, Atmel AVR, Renesas H8, SH, V850, FR-V, M32R, Z80, Z8, etc. This in contrast to the desktop computer market, which is currently limited to just a few competing architectures.  PC/104 and PC/104+ are a typical base for small, low-volume embedded and rugged system design. These often use DOS, Linux, NetBSD, or an embedded real-time operating system such as QNX or VxWorks.  A common configuration for very-high-volume embedded systems is the system on a chip (SoC), an application-specific integrated circuit (ASIC), for which the CPU core was purchased and added as part of the chip design. A related scheme is to use a field-programmable gate array (FPGA), and program it with all the logic, including the CPU.

Peripherals

Embedded Systems talk with the outside world via peripherals, such as:

Ø  Serial Communication Interfaces (SCI): RS-232, RS-422, RS-485 etc

Ø  Synchronous Serial Communication Interface: I2C, JTAG, SPI, SSC and ESSI

Ø  Universal Serial Bus (USB)

Ø  Networks: Controller Area Network, LonWorks, etc

Ø  Timers: PLL(s), Capture/Compare and Time Processing Units

Ø  Discrete IO: aka General Purpose Input Output (GPIO)

Tools

As for other software, embedded system designers use compilers, assemblers, and debuggers to develop embedded system software. However, they may also use some more specific tools:

Ø  An in-circuit emulator (ICE) is a hardware device that replaces or plugs into the microprocessor, and provides facilities to quickly load and debug experimental code in the system.

Ø  Utilities to add a checksum or CRC to a program, so the embedded system can check if the program is valid.

Ø  For systems using digital signal processing, developers may use a math workbench such as MathCAD or Mathematic to simulate the mathematics.

Ø  Custom compilers and linkers may be used to improve optimization for the particular hardware.

Ø  An embedded system may have its own special language or design tool, or add enhancements to an existing language.

Software tools can come from several sources:

Ø  Software companies that specialize in the embedded market

Ø  Ported from the GNU software development tools

Ø  Sometimes, development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor

Debugging

Embedded Debugging may be performed at different levels, depending on the facilities available, ranging from assembly- or source-level debugging with an in-circuit emulator or in-circuit debugger, to output from serial debug ports or JTAG/Nexus interfaces, to an emulated environment running on a personal computer.As the complexity of embedded systems grows, higher level tools and operating systems are migrating into machinery where it makes sense. For example, cell phones, personal digital assistants and other consumer computers often need significant software that is purchased or provided by a person other than the manufacturer of the electronics. In these systems, an open programming environment such as Linux, NetBSD, OSGi or Embedded Java is required so that the third-party software provider can sell to a large market.

Reliability

Embedded systems often reside in machines that are expected to run continuously for years without errors, and in some cases recover by themselves if an error occurs. Therefore the software is usually developed and tested more carefully than that for personal computers, and unreliable mechanical moving parts such as disk drives, switches or buttons are avoided.Recovery from errors may be achieved with techniques such as a watchdog timer that resets the computer unless the software periodically notifies the watchdog.

Specific reliability issues may include:

Ø  The system cannot safely be shut down for repair, or it is too inaccessible to repair. Solutions may involve subsystems with redundant spares that can be switched over to, or software "limp modes" that provide partial function. Examples include space systems, undersea cables, navigational beacons, bore-hole systems, and automobiles.

Ø  The system must be kept running for safety reasons. "Limp modes" are less tolerable. Often backups are selected by an operator. Examples include aircraft navigation, reactor control systems, safety-critical chemical factory controls, train signals, engines on single-engine aircraft.

Ø  The system will lose large amounts of money when shut down: Telephone switches, factory controls, bridge and elevator controls, funds transfer and market making, automated sales and service.

High vs Low Volume

For high volume systems such as portable music players or mobile phones, minimizing cost is usually the primary design consideration. Engineers typically select hardware that is just “good enough” to implement the necessary functions. For low-volume or prototype embedded systems, general purpose computers may be adapted by limiting the programs or by replacing the operating system with a real-time operating system.

Embedded software architectures

There are several different types of software architecture in common use.

Simple control loop

In this design, the software simply has a loop. The loop calls subroutines, each of which manages a part of the hardware or software.

Interrupt controlled system

Some embedded systems are predominantly interrupt controlled. This means that tasks performed by the system are triggered by different kinds of events. An interrupt could be generated for example by a timer in a predefined frequency, or by a serial port controller receiving a byte.  These kinds of systems are used if event handlers need low latency and the event handlers are short and simple. Usually these kinds of systems run a simple task in a main loop also, but this task is not very sensitive to unexpected delays. The tasks performed in the interrupt handlers should be kept short to keep the interrupt latency to a minimum. Some times longer tasks are added to a queue structure in the interrupt handler to be processed in the main loop later. This method brings the system close to a multitasking kernel with discrete processes. Cooperative multitasking

       A no preemptive multitasking system is very similar to the simple control loop scheme, except that the loop is hidden in an API. The programmer defines a series of tasks, and each task gets its own environment to "run" in. Then, when a task is idle, it calls an idle routine (usually called "pause", "wait", "yield", etc.). The advantages and disadvantages are very similar to the control loop, except that adding new software is easier, by simply writing a new task, or adding to the queue-interpreter.

Preemptive multitasking

In this type of system, a low-level piece of code switches between tasks based on a timer. This is the level at which the system is generally considered to have an "operating system", and introduces all the complexities of managing multiple tasks running seemingly at the same time.  Any piece of task code can damage the data of another task; they must be precisely separated. Access to shared data must be controlled by some synchronization strategy, such as message queues, semaphores or a non-blocking synchronization scheme.   Because of these complexities, it is common for organizations to buy a real-time operating system, allowing the application programmers to concentrate on device functionality rather than operating system services.

1N4148 Diode

1N4148 Diode 1N4148 Diode 1N4148 Diode Pinout 1N4148 Pin Configuration Pin No. Pin Name Description 1 Anode ...