0 оценок0% нашли этот документ полезным (0 голосов)
36 просмотров25 страниц
This document provides an introduction to microcontrollers and compares them to microprocessors. It discusses that a microcontroller contains a CPU, RAM, ROM, and I/O ports on a single chip, making it suitable for embedded systems that require minimum components. In contrast, a microprocessor only contains a CPU and requires additional external memory and I/O components. The document also outlines the basic architecture of microcomputers, including their program memory, data memory, input/output systems, buses, and applications of microcontrollers.
This document provides an introduction to microcontrollers and compares them to microprocessors. It discusses that a microcontroller contains a CPU, RAM, ROM, and I/O ports on a single chip, making it suitable for embedded systems that require minimum components. In contrast, a microprocessor only contains a CPU and requires additional external memory and I/O components. The document also outlines the basic architecture of microcomputers, including their program memory, data memory, input/output systems, buses, and applications of microcontrollers.
This document provides an introduction to microcontrollers and compares them to microprocessors. It discusses that a microcontroller contains a CPU, RAM, ROM, and I/O ports on a single chip, making it suitable for embedded systems that require minimum components. In contrast, a microprocessor only contains a CPU and requires additional external memory and I/O components. The document also outlines the basic architecture of microcomputers, including their program memory, data memory, input/output systems, buses, and applications of microcontrollers.
Studies in Engineering Microcontroller Based Embedded Systems Lecture1 2 Introduction Microprocessor (P)(MPU) A P is a CPU on a single chip. Components of CPU ALU, instruction decoder, registers, bus control circuit, etc. Micro-computer (u-Computer) small computer P + peripheral I/O + memory specifically for data acquisition and control applications Microcontroller (C) u-Computer on a single chip of silicon 3 P vs. C A P P only is a single-chip CPU
bus is available bus is available RAM capacity, num of port is selectable RAM is larger than ROM (usually) A C contains a CPU and RAM,ROM ,Peripherals, I/O port in a single IC internal hardware is fixed Communicate by port ROM is larger than RAM (usually) Small power consumption Single chip, small board Implementation is easy Low cost 4 Applications Cs are suitable to control of I/O devices in designs requiring a minimum component Ps are suitable to processing information in computer systems. P vs. C cont. 5 P vs. C cont. C is easy to use and design. Only single chip can be a complete system interfacing to other devices, for example, motors, displays, sensors, and communicate with PC. In contrast, similar system that builds from P would require a lot of additional units, such as RAM, UART, I/O , TIMER and etc. 6 C is a Reusable Hardware Logic circuit provides limited function for one single design. In order to change circuits functionality, we need to redesign the circuits. C can reprogram and change functionality of every port, input to output or digital to analog on the fly. 7 Microcontrollers Many Cs are existing right now. PIC, 8051, 68HC11, MSP430, ARM series, and etc. We may widely divide it with how it is designed RISC/CISC architecture. What is the main difference between RISC/CISC? Does it make any difference to our application? 8 The Microprocessor (MPU) The P is the brain of the microcomputer Is a single chip which is capable of processing data controlling all of the components which make up the microcomputer system P used to sequence executions of instructions that is in memory P Fetch , Decode , and Execute the instruction The internal architecture of the microprocessor is complex. 9 The Microprocessor (MPU) Microprocessor (MPU) typically contains Registers: Temporary storage locations for program instruction or data. The Arithmetic Logic unit (ALU): This part of the MPU performs both arithmetic and logical operations Timing and Control Circuits: that keep all of the other parts of system (Regs, ALU, memory & I/O) working together in the right time sequence 10 Microcomputers All Microcomputers consist of (at least) 1. Microprocessor Unit (MPU) 2. Program Memory (ROM) 3. Data Memory (RAM) 4. Input / Output ports 5. Bus System (and Software) MPU is the brain of microcomputer 11 Microcomputers 12 The Input/Output (I/O) System I/O is the link between the MPU and the outside world. An input port is a circuit through which an external device can send signals (data?) to the MPU. An output port is a circuit that allows the MPU to send signals (data?) to external devices. I/O ports connect both digital and analogue devices by DAC and ADC 13 Bus A Bus is a common communications pathway used to carry information between the various elements of a computer system The term BUS refers to a group of wires or conduction tracks on a printed circuit board (PCB) though which binary information is transferred from one part of the microcomputer to another The individual subsystems of the digital computer are connected through an interconnecting BUS system. 14 Bus There are three main bus groups ADDRESS BUS DATA BUS CONTROL BUS 15 Data Bus The Data Bus carries the data which is transferred throughout the system. ( bi- directional) Examples of data transfers Program instructions being read from memory into MPU. Data being sent from MPU to I/O port Data being read from I/O port going to MPU Results from MPU sent to Memory These are called read and write operations 16 Address Bus An address is a binary number that identifies a specific memory storage location or I/O port involved in a data transfer The Address Bus is used to transmit the address of the location to the memory or the I/O port. The Address Bus is unidirectional ( one way ): addresses are always issued by the MPU. 17 Control Bus The Control Bus: is another group of signals whose functions are to provide synchronization ( timing control ) between the MPU and the other system components. Control signals are unidirectional, and are mainly outputs from the MPU. Example Control signals RD: read signal asserted to read data into MPU WR: write signal asserted to write data from MPU 18 Main memory The duties of the memory are : To store programs To provide data to the MPU on request To accept result from the MPU for storage Main memory Types ROM : read only memory. Contains program (Firmware). does not lose its contents when power is removed (Non-volatile) RAM: random access memory (read/write memory) used as variable data, loses contents when power is removed volatile. When power up will contain random data values 19 Read-Only Memory P can read instructions from ROM quickly Cannot write new data to the ROM ROM remembers the data, even after power cycled Typically, when the power is turned on, the microprocessor will start fetching instructions from the still-remembered program in ROM (bootstrap ) 20 Available ROMs Masked ROM or just ROM PROM or programmable ROM(once only) EPROM (erasable via ultraviolet light) Flash (can be erased and re-written about 10000 times, usually must write a whole block not just 1 byte or 2 bytes, slow writing, fast reading) EEPROM (electrically erasable read-only memory, also known as EEROMboth reading and writing are very slow but can program millions of timesuseless for storing a program but good for say configuration information. 21 ROM A0 A1 A2 Am D0 Dn D1 D2 OE CE n+1 bit Data 1 2 + m m+1 bit Address Capacity : OE : Output Enable connect to RD of P ) (CS CE ) 1 ( 2 1 + : Chip Enable to Address decoder + n m ROM PROM EEPROM 22 Timing Diagram for a Typical ROM CE A0-Am D0-Dn OE falls to data valid Addr valid to data valid OE 23 RAM (Random Access Memory) The P can read the data from RAM quickly The P can write new data quickly to RAM RAM forgets its data if power is turned off Two type of is available : Static RAM(SRAM): ff base, fast, expensive, low cap/vol, applied for cache , no refresh Dynamic RAM (DRAM): cap base, slow , low cost high capacity/volume , applied for main memory(pc) need refresh. 24 RAM(Static) A0 A1 A2 Am D0 Dn D1 D2 RD WR n+1 bit Data 1 2 + m Capacity : m+1 bit Address CS : Chip Select to Address decoder ) 1 ( 2 1 + + n m RAM CS RD : Read signal connect to MemRD of P WR : Write signal connect to MemWR of P Data bus is Bidirectional 25 SUMMARY