240 likes | 459 Views
RTOS and Microcontroller. What is a Real Time System?. Real-time systems process events External input events trigger other events to occur as outputs Minimizing response time is critical, or otherwise the entire system may fail to operate properly. Real-Time Systems.
E N D
What is a Real Time System? • Real-time systems process events • External input events trigger other events to occur as outputs • Minimizing response time is critical, or otherwise the entire system may fail to operate properly
Real-Time Systems • Most embedded systems are real-time • Has timing constraints • Make certain calculations or decisions in a timely manner • A missed deadline is as bad as a wrong answer • Consequences of a missed deadline: - severe -> hard real-time - acceptable -> soft real-time
Hard/Soft Real-Time Systems • Soft Real-Time System - Computer output response as fast as possible, but no specific deadlines that must be met • Hard Real-Time System - Output response must be computed by specified deadline or system fails
Multi-Tasking and Concurrency • Most real-time systems are also embedded systems w/several inputs and outputs and multiple events occurring independently • Separating tasks simplifies programming, but requires somehow switching back and forth among the tasks (multi-tasking). • Concurrency is the appearance of simultaneous execution of multiple tasks
Basic Microprocessor A typical microprocessor has at least a collection of address pins, a collection of data pins, one or more of clock pins, a read pin, and a write pin
Types of Memory(No-Volatile) • ROM (Read Only Memory) - ROM stores programs - It is programmed at the semiconductor factory - Inexpensive permanent memory, best choice for a product with large volumes of program - Slower than RAM, cannot rewrite.
PROM (Programmable ROM) - PROM stores programs - It is shipped in blank, use a PROM programmer to program it - Used for lower volumes, but is more expensive than ROM - Can rewrite only once
EPROM (Erasable PROM) - Shipped in blank and is programmed with a PROM programmer - It can be erased by shining a strong ultraviolet light on it for 10 or 20 minutes and then reused - It is therefore useful when you are debugging a program. - Can rewrite many times
Flash - Flash(special EPROM with large volume). - Cannot change data very often due to slow writing
Types of Memory(Volatile) RAM (Random Access Memory) - RAM is useful for data. - It is sometimes useful to load the program from ROM to RAM at power-up time - Very fast - No limit on write - The microprocessor can read the data from the RAM quickly, faster even than from ROM - The microprocessor can write new data to the RAM quickly, erasing the old data in the RAM as it does so - The RAM forgets its data if the power is turned off
Types of RAM Static RAM - Static RAM remembers its data without any assistance from other parts of the circuit. - Static RAM parts look much like ROM parts, except that they have a write enable signal in addition to the other signals, which tells the RAM when it should store new data.
Types of RAM Dynamic RAM - Dynamic RAM depends on being read once in a while, otherwise it forgets its data - Uses a circuit, often built into the microprocessor, called dynamic RAM refresh, whose sole purpose is to read data from the dynamic RAM periodically to make sure that the data stays valid. - Is cheap
Microprocessor System (Microcontroller) The collection of data, address, and control signals that control the operation pace of the microprocessor, the ROM, the RAM is called the bus
Memory Mapping and the I/O Address for I/O device Memory mapping and the I/O address for I/O device
Direct Memory Access (DMA) Direct memory access (DMA) circuits move data directly from I/O devices to memory and vice versa without microprocessor intervention
Interrupt Interrupts start with a signal form the hardware. Most I/O chips, that drive serial ports, parallel ports, or network interfaces, need attention when certain events occur. For example, when a serial port chip receives a character from the serial port, it needs the microprocessor to read that character from registers of the serial port chip itself and to store it in memory. Similarly, when a serial port chip sends one character, it need the microprocessor to send it the next character to be transmitted.
Universal Asynchronous Receiver/Transmitter and RS-232 • A universal Asynchronous Receiver/Transmitter or UART is a common device on many systems. Its purpose is to convert data to and from a serial interface, that is, an interface on which the bits that make up the data are sent one from another. A very common standard for serial interfaces is the RS-232 interface, used between computers and modems and nowadays often between computers and mice. • It converts data between an eight-bit format and the one-bit-at-a-time format used on serial ports such as RS-232 ports. UARTs are controlled by the microprocessor through a collection of registers (modem, mouse).