460 likes | 870 Views
Embedded System Programming. Andrew Ho. Agenda. Embedded System Overview Embedded System Developing Programming on Embedded System Q&A. Products with Embedded Systems?. Of 4 billions microprocessors/microcontrollers sold (2002), 95% are for embedded products: – VCRs, DVD players
E N D
Embedded System Programming Andrew Ho
Agenda • Embedded System Overview • Embedded System Developing • Programming on Embedded System • Q&A
Products with Embedded Systems? • Of 4 billions microprocessors/microcontrollers • sold (2002), 95% are for embedded products: • – VCRs, DVD players • – Cell phone • – Microwave • – Washer • – Camera • – Cars • – Printers, copiers • –….
Why are Embedded Systems Different? • Dedicated to a specific task or tasks • Rich variety of microprocessors (over 300 types) • Designs are cost-sensitive • May have real-time performance constraints • Often used with Real-Time Operating Systems (RTOS) • Software failure can be life-threatening • May have constraints on power consumption • Operate over a wide-range of environmental conditions • Fewer system resources than a desktop system • All code might be stored in ROM • Require specialized design tools • May need on-chip debugging resources
What’s an Embedded System? • From Wikipedia : An embedded system is a special-purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass-produced, benefiting from economies of scale. • Simple : “A programmable component of subsystem providing some intelligence functions to the system of which it is a part.”
What’s an Embedded System? • This can include: – Any device, or collection of devices, that contain one or more dedicated computers, microprocessors, or microcontrollers. • Microprocessor chips • Programmable logic elements (FPGA, ASIC etc.) • Device(s) may be local - Printer, automobile, etc. • Devices may be distributed - Aircraft, ship, internet appliance. • A PC or workstation may be an embedded system.
What’s an Embedded System? • Embedded systems are designed to do some specific task, rather than be a general-purpose computer for multiple tasks. Some also have real-time performance constraints that must be met, for reason such as safety and usability; others may have low or no performance requirements, allowing the system hardware to be simplified to reduce costs. • An embedded system is not always a separate block - very often it is physically built-in to the device it is controlling • The software written for embedded systems is often called firmware, and is stored in read-only memory or Flash memory chips rather than a disk drive. It often runs with limited computer hardware resources: small or no keyboard, screen, and little memory.
Example : ADSL modem router 1. Telephone decoupling electronics (for ADSL). 2. Multicolour LED (displaying network status). 3. Single colour LED (displaying USB status). 4. Main processor, a TNETD7300GDU, a member of Texas Instruments' AR7 product line. 5. JTAG (Joint Test Action Group) test and programming port. 6. RAM, a single ESMT M12L64164A 8 MB chip. 7. Flash memory, obscured by sticker. 8. Power supply regulator. 9. Main power supply fuse. 10. Power connector. 11. Reset button. 12. Quartz crystal. 13. Ethernet port. 14. Ethernet transformer, Delta LF8505. 15. KS8721B ethernet PHY transmitter receiver. 16. USB port. 17. Telephone (RJ11) port. 18. Telephone connector fuses.
Characteristics • No Architectural Link to Standard Platforms • Real-time Constraints • Time sensitive • Time critical • May or May Not have OS services available • Power Constraints • Low Fault Tolerance • Often engineered for the highest possible performance at the lowest cost
Microprocessor V.S. Microcontroller • Microprocessor • An integrated circuit which forms the central processing unit for a computer or embedded controller, but required additional support circuitry to function • MC68000, 80486, Pentium, K6, MicroChip PIC, etc. • Microcontroller • A microprocessor plus additional peripheral support devices integrated into a single package • Peripheral support devices may include : Serial ports (COM ), Parallel (Ports ), Ethernet ports, A/D&D/A, Interval timers, watchdog timers, event counter/timers, real time clock (RTC) • Other local processors (DSP, numeric coprocessor, peripheral controller)
Embedded System Developing • Target system • The embedded system under development • Host computer • The standard platform being used to develop the software and link to the target system for debugging • Cross-development • Using host-based tools to create a code image running on a different instruction set architecture
Development Environment • Where to store executable image on target system ? • ROM or FLASH • Good for final product • Hold the bits permanently after power is turned off • Impractical during the development stage • Reprogramming the ROM or the FLASH memory is time • consuming • RAM • Cannot used in final product • Lose data almost immediately after power is turned off • Good in development stage • Processor writes to memory simply and quickly
Development Environment • How to transfer the image onto the target? • Image Download • To transfer an executable image from host onto the target system. • Possible Approaches • Download the image through either a JTAG or BDM interface • Downloading the image over a serial (RS-232) or network connection • Write the image to EEPROM or Flash
Design Trade-offs • Target Driven – For special purpose • Consider : • Implement by H/W or S/W? • Soc ? • Resources? • OS-based? • Cost : Performance ?
Considerations • Must be dependable: • Reliability • Maintainability • Availability • Safety • Security • Must be efficient: • Energy efficient • Code-size efficient (especially for systems on a chip) • Run-time efficient • Weight efficient • Cost efficient
Considerations • Many ES must meet real-time constraints: • A real-time constraint is called hard, if not meeting that constraint could result in a catastrophe • All other time-constraints are called soft
Programming on Embedded System • Difference of programming on ES • Maybe no OS • Handle all HW by programmer. • Programming and Operating on different platform • Host/Target • Cross-compiler • Upload and Debug • I/O interface • Limited Resources • Highly H/W Dependence
Programming on Embedded System • There are MANY architectures of programming an embedded system. • Simple control loop • Interrupt controlled system • Cooperative multitasking (nonpreemptive multitasking system) • Preemptive multitasking : OS based • Microkernels and exokernels(MIT) : Step up from RTOS (Real Time OS) • Monolithic kernels (Embedded Linux or Windows CE)
Programming on Embedded System • What kinds of program should be handled? • Boot loader • Operation system • Device drivers • System services • Applications • User Interface • Communication • ………
System Developing Steps • Survey market and requirements • Define the system scale and functions • Define the design specifications • Review and refine the design spec • Division of labor with H/W and S/W
System Developing Steps • For S/W : • Architecture developing • Module design • Implementation • Module testing/verifying • Integration • System testing • System debugging • For H/W • H/W design (IC design, system design) • H/W simulation • H/W emulation • H/W verification
System Developing Steps • Whole System • System testing/verifying • System debugging • Mass production • System customization • Developing new features/applications