1 / 21

An Introduction To Embedded System

An Introduction To Embedded System. Outlines. Overview of Embedded System: Purpose and Category Component of a basic Embedded System: Hardware and Software A demo of how to develop embedded system with C8051F005 MCU development kit.

tdickerson
Download Presentation

An Introduction To Embedded System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Introduction To Embedded System

  2. Outlines • Overview of Embedded System: Purpose and Category • Component of a basic Embedded System: Hardware and Software • A demo of how to develop embedded system with C8051F005 MCU development kit.

  3. By name, an embedded system is a special-purpose computing device designed to perform dedicated functions. An embedded system consists of its hardware and software. The hardware includes microprocessor or microcontroller with additional attached external memory, I/O, and other components such as sensors, keypad, LEDs, LCDs, and any kind of actuators. • The on chip embedded software is the driving force of an embedded system. And is loaded to ROM, EPROM, or Flash memory. once it is loaded, it will never be changed unless it needs to be reloaded for replacement. • The desktop side embedded software could be monitor, controller or analyzer of the embedded system.

  4. For a general-purpose computer you can install any software to do all kinds of jobs such as word processing, book keeping, database management, and others depending on your purposes. The embedded systems are only used to repeatedly carry particular designated function or controlled by external interrupt to determine which function it’ll use.

  5. Categories of Embedded Systems • Stand-alone embedded systems A stand-alone embedded system works alone itself. It is a self-contained device. It takes either digital or analog inputs from its input ports, calibrates, converts, and processes the data, and outputs the result data to its attached output device either displays data or controls and drives the attached devices. The entertainment devices of video game console and MP3, digital camera, and microwave are such typical systems that fall into this category.

  6. 2. Real-time embedded systems • A system is said to be real-time if the response time is critical. In other word, some particular work must be done in a specified time period. In addition to functional correctness, the time constraint must be satisfied. • There are two type real-time embedded systems: hard real-time and soft real-time embedded systems.

  7. 3. Networked embedded systems The networked embedded systems are connected to network with network interfaces to be accessed or to access other resources. The connected network can be Local Area Network (LAN), Wide Area Network(WAN), or Internet. A home security system is an example of LAN networked embedded system where all sensors (e.g. motion detectors, press sensors, light sensors, or smoke sensors) are wired and running on the TCP/IP protocol.

  8. Constraints of Embedded Systems • Resource constraint: Embedded systems are constrained for their size, power, capacity (may be battery operated), limited memory capacity(especially RAM size), CPU speed and function capacity • Time constraints: Real-time system has response time deadline to meet. • Environment constraint: extreme operation condition such as high or low temperature, high pressure, high humidity, under water, under collision, etc. • Cost Constraint: Cost reduction of products has huge impact on the market competition because the large volume of products for high volume systems such as MP3 players or PDAs, minimizing cost is usually the primary design consideration. The selected hardware should be just “good enough” to cover the necessary functions. • Time to market constraint: Design and development cycle is very limited in order to beat the competent in the market.

  9. Features of Embedded Systems • Wide variety of chips for selection • Language selections on high level or assembly • Many I/O accessories components selections • Programming on direct port operations • Programming with multi-tasking and multi-threading execution • Must use cross compiler and development tools • Need emulator to provide simulation of all aspects of the hardware and • Allow debugging on a normal PC. • Need special emulation tools to debug • Testing on Multitasking and scheduling execution • Testing on the real world environment because embedded software is • embedded into devices.

  10. Introduction to C8051F005 The Intel 80C51(CMOS) microcontroller has a 8 bit microprocessor running at 1MIPS/12MHz with small on-chip RAM of 128 bytes for data and 4K on-chip ROM for code. It is integrated with 4 bi-directional I/O ports, two counter/timers, and Universal Asynchronous Receiver Transmitter(UART) for RS232 serial communication. It can support up to 64K external RAM and ROM. We choose 8051 microcontroller to discuss in this book due to its popularity, low cost, and especially the availability of many affordable IDE development kits such as the Keil μvision development kit and C8051F005DK development kits(the target board included) with support of C programming language for the lab experiments in the book.

  11. Figure 1.4 The Block Diagram of 8051 Microcontroller

  12. Memory Embedded system memory can come on-chip or off-chip. For same type memory, on-chip memory access is much fast than off-chip memory but the size of on-chip memory is much smaller than the size of off-chip memory. Usually, it takes at least two I/O ports as external address lines plus a few control lines such as R/W and ALE control lines to enable the extended memory. E.g., 16 bits of I/O port P0 and P2 are used to address 64k external memory in 8051. ( 216 = 26 x 210 = 64k byte memory space) Memory Embedded system memory can come on-chip or off-chip. For same type memory, on-chip memory access is much fast than off-chip memory but the size of on-chip memory is much smaller than the size of off-chip memory. Usually, it takes at least two I/O ports as external address lines plus a few control lines such as R/W and ALE control lines to enable the extended memory. E.g., 16 bits of I/O port P0 and P2 are used to address 64k external memory in 8051. ( 216 = 26 x 210 = 64k byte memory space) RAM The 8051 memory is divided into Data Memory and Code Memory. Most of the data are stored in Random Access Memory (RAM) and code is stored in Read Only Memory ( ROM). This is due to the RAM constraint of embedded system and the memory organizations RAM The 8051 memory is divided into Data Memory and Code Memory. Most of the data are stored in Random Access Memory (RAM) and code is stored in Read Only Memory ( ROM). This is due to the RAM constraint of embedded system and the memory organizations

  13. RAM(Contd) The RAM size of microprocessor and microcontroller is rather small (<256 bytes in most cases). In order to access any byte in a 256 bytes memory space, we need 8 address lines(internal address bus) because 28 = 256. One ASCII character takes one byte memory space. For example, character ‘A’ has its ASCII code 6510 , i.e., in binary 010000012 (8 bits = 1 byte); A integer number 102410 takes 11 bits(100000000002) which needs 2 bytes to store it. A simplest machine instruction itself takes one byte but some other memory access machine instruction take multiple bytes. The small amount of automatic variable data ( local variables of functions and interrupt service routine functions, stacks) are stored on the on-chip RAM for fast and frequent access and update while the large amount temporary data (array, table) can be stored in off-chip RAM. The RAM chip can be SRAM (static) or DRAM(dynamic) depending on the manufacture. SRAM is faster than DRAM but is more expensive

  14. ROM The ROM, EPROM, and Flash memory are all read only type memory used to store code in embedded system. The embedded system code does not change after the code is loaded into memory. The ROM is programmed at the factory and can not be changed over time. The newer microcontroller comes with EPROM or Flash instead of ROM. Most of microcontroller development kits come with EPROM as well. EPROM and Flash memory are easier to rewrite than ROM. EPROM is a Erasable Programmable ROM in which the contents can be field programmed by a special burner and can be erased by a UV light bulb. The size of EPROM ranges up to 32kb in most embedded systems.

  15. ROM (Contd) All ROM type memory are non-volatile. This is one of the reasons the embedded code firmware is stored in ROM type memory. When the power is on, the first instruction in ROM is loaded into the PC and then the CPU fetches the instruction from the location in the ROM pointed by PC and stores it in the IR to start the CPU, fetch and execution cycle continues. The PC is advanced to the address of next instruction depending on the length of the current instruction or the destination of the Jump instruction. The 68HC11 comes with 256 bytes RAM, 512 bytes EPROM, and 8k bytes ROM. Here 1k is 1024 bytes (210) and 8k = 213 bytes. There need to be 13 address lines available to cover 8k bytes space. The 8051 comes with 128 bytes RAM and 4k ROM. The EPROM or Flash memory can be attached as extended memory.

  16. Bus • From the block diagram you can see all the CPU, memory, and I/O ports are connected by the buses. There are three type buses: data bus, address bus, and control bus. The bus is a pathway to collect all the microcontroller components. A 8-bit or 16-bit microcontroller has a 8 bits or 16 bits data bus to deliver data from one component to another component within the microcontroller. The address bus is used to specify the memory location for CPU to load instructions to be executed or to access data in the memory or ports. The control bus is used for CPU to control the operation in sequence with the timing tick paces and specify the read/write memory access operation. Just as you have seen before, in order to run an instruction in the ROM, CPU needs to load the instruction from the ROM to IR based on the PC, extract the op-code and operands, load the operands from memory, perform the instruction operation in ALU, store the results in the destination, and start new fetch-execution cycle, all of these are controlled by the control signals on the control bus issued by the CU. The external bus is used for microcontroller to connect to the external devices.

  17. I/O Ports • The I/O ports are used to connect input and output devices. The common input devices for an embedded system include keypad, switch, button, knob, all kinds of sensors (light, temperature, pressure, etc). The output devices include Light Emitting Diode(LED), Liquid Crystal display(LCD), print, alarm, actuator, etc. Some devices support both input and output such as communication interfaces including Network Interface Card (NIC), modem, and mobile phone. • Parallel Port • A microcontroller is integrated with several parallel I/O ports which are used to interface the microcontroller to outside devices such as switches, LCD, keypad, and actuators. The parallel ports get or send 8 bits data at a time from/to connected outside devices. Many microcontrollers have 4-8 ports, e.g., both the 8051 and 68HC11 have 8-bit I/O ports.

  18. Serial Ports Some I/O ports such as the port D of 68HC11 and port3 of 8051 can be used to connect a external serial device. Instead of 8 parallel lines in parallel I/O communication, the serial communication exchanges data one bit at a time with single data line plus reference lines if needed. The typical application of serial port is to connect a PC with a serial cable to take advantage of PC for embedded software debug, testing, and deployments. A serial ports also allows data to be flown between microcontrollers, or between microcontrollers and any serial device. In order to make it work, there must be a protocol (rule) to govern the handshaking between two parties so that the receiver can recognize the beginning of the new coming byte and the ending of the byte. Assume the base logic is high “1” and once the transfer starts, the line is lowered to “0” for a period of time to signal the receiver that the start bit is coming soon, then the receiver activates its accepting circuit.

  19. Both sender and receiver follow the same clock pace so that the receiver can sample the right data. The logic “1” is resumed after the 8 bits delivered to mark the end of transmission of one byte data. Figure 1.6 below describes the basic concept of serial communication. The RS232 is a serial communication standard which specifies the handshaking rules between two sites. E.g., the communication of a 9-pin COM port connecting to a PC COM port with serial cable complies the RS232 protocol. The data is transferred at a specified baud rate (bps – number of bits per second). The baud rate at both sites must be set same so that the signals can be synchronized. It is called asynchronous communication because there is no clock control line between for transmitter and receiver to synchronize the pace.

  20. Clock Oscillator, Timer and Watchdog You have known that time is a very important factor to be considered in embedded system design. All microcontrollers need an oscillator clock unit which generates the clock tick at a predetermined rate. The clock is used to control the clocking requirement of the CPU for executing instructions and the configurations of timers. For example, a classic 8051 clock cycle is (1/12)10-6 second (1/12 µs) because the clock frequency is 12MHz. A simple 8051 take 12 cycles (1 µs) to complete. Of course some multi-cycle instructions take more clock cycles. A timer is a real time clock for real time programming. Every timer comes with a counter which can be configured by programs to count the incoming pulses. When the counter overflows(reset to zero) it will fire a time out interrupt that triggers predefined actions. Many time delays can be generated by timers. For example, a timer counter is configured to 24,000 and it will trigger the timeout signal in 24,000 x 1/12 µs = 2 ms.

  21. A tutorial of C8051F005 MCU

More Related