CS 320. Computer Architecture Core Architecture

Size: px
Start display at page:

Download "CS 320. Computer Architecture Core Architecture"

Transcription

1 CS 320 Computer Architecture 8051 Core Architecture Evan Hallam 19 April 2006

2 Abstract The 8051 is an 8-bit microprocessor designed originally in the 1980 s by the Intel Corporation. This inexpensive and simple, yet extremely useful and powerful microprocessor is commonly used in a variety of control systems, embedded applications and consumer electronics. Although many derivatives of the 8051 exist that create a versatile set of microprocessors, the core architecture of the entire family remains relatively unchanged [1]. The basic architectural form of the 8051 will be examined with some references to derivative models. Primary architecture aspects to be analyzed will include: hardware overview, memory organization, registers and buffers, instructions and addressing, input/output and the interrupt system.

3 Contents 1 Introduction 1 2 Hardware Overview Registers, Ports, Etc Pinout Oscillator and Clocking Memory Organization Memory Space Separation and Size Program Storage Data Storage On-Chip ROM Special Function Registers Accumulator and B Registers Program Status Word Stack Pointer Program Counter and Data Pointer Port Latches Serial Data Buffer Timer Registers Control Registers I/O Ports Input Loading and Output Driving Alternate Port Functions Accessing External Memory I

4 6 Timers and Counters Timing Timer 0 and Timer Timer Modes Mode 0 and Mode Mode Mode Timer Serial Ports Serial Port Control and Status Register Serial Port Modes Mode 0 - Shift Register Mode Mode 1 - Standard UART Mode 2 and Mode 3 - Multiprocessor Modes PCON Register Interrupts Servicing External Devices Polling and Buffering Basic Interrupt Action Multiple Interrupt Sources and Vectoring Priority Levels Interrupt Timing and Handling Activation Levels and Flag Clearing Predefined Vector Addresses Instructions and Addressing Direct Addressing II

5 9.2 Indirect Addressing Register Addressing Immediate Operand Instructions Indexed Addressing Instruction Groups Arithmetic Operations Logic Operations Data Transfer Operations Boolean Operations Branching Operations Boolean Processor Carry III

6 1 Introduction Nearly all modern electronics rely on some microprocessor system to compute, store or analyze data. The main goals of most microprocessor implementations are size reduction and cost reduction. The release of the 8051 microprocessor in 1980 by the Intel Corporation helped to meet these reductions [7]. The 8051 provides a highly expandable base for developers to implement applications with a small footprint and a very low per chip cost. This expandability and low cost allows for variations of the microprocessor based on the targeted applications [2]. At the heart of this microprocessor is the 8051 core architecture. Various aspects of any architecture include: memory organization, instructions and addressing, input/output and control units [10]. The 8051 provides a simple implementation of these areas as well as some advanced features that make it extremely suitable for a variety of embedded applications. 2 Hardware Overview The core 8051 has a simple set of hardware architectural attributes. The 8051 package contains an 8-bit CPU, 4K bytes of ROM on board, 128 bytes of RAM and 32 I/O lines. The 8051 also has two 16-bit timers, five interrupt sources, a serial port and a Boolean processor. The typical 8051 also provides for oscillator and clocking circuitry on board [9]. A block diagram of the 8051 is shown in Figure 1. Figure 1: Block Diagram of the [3] 1

7 2.1 Registers, Ports, Etc. Figure 2: Full Block Diagram of the [4] The full block diagram in Figure 2 shows some of the various registers, ports and other devices on the The 8051 architecture consists of these features: [5] Sixteen-bit program status word (PSW) Sixteen-bit program counter (PC) and data pointer (DPTR) 2

8 Eight-bit stack pointer (SP) Four register banks, each containing eight registers Sixteen bytes, which is bit addressable Eighty bytes of general-purpose memory for data Timer and associated control registers Program address register (PAR) Instruction register (IR) A (the accumulator) and B special registers Control registers: TCON, TMOD, SCON, PCON, IP, IE Four 8-bit latched ports: P0 - P3 These features combined form the building blocks of the 8051 core architecture. These, and some additional features will be addressed later. 2.2 Pinout Figure 3: 8051 DIP Pin Assignments. [4] 3

9 A pinout of a 40-pin Dual In-Line package is shown in Figure 3. It is important to notice that many of the pins are used for multiple functions. To reduce the overall pin count of the package, the 8051 multiplexes pins so that many more functions are available than the number of pins allow. Therefore, not all of the possible 8051 functions can be used at the same time [5]. 2.3 Oscillator and Clocking Figure 4: 8051 Bus Cycles [3] The smallest CPU timing unit is the oscillator, called the clock. The 8051 contains circuitry that generates 4

10 the clock pulses by which all internal operations are synchronized. Pins XTAL1 and XTAL2 are provided to connect a quartz crystal. Typical crystal frequencies range from 1 megahertz to 16 megahertz. Some later derivative models operate using faster crystals. This crystal frequency is the basic internal clock of the microcontroller [5]. Figure 4 shows machine cycle divisions. A machine cycle consists of six states, S1 through S6. Each state is divided into two phases, P1 and P2. Each phase lasts one clock period. Therefore, one machine cycle lasts 12 clock periods [9]. 3 Memory Organization An operational computer must have memory for program code, usually in ROM, and RAM for variable data that can be altered as the program executes. The 8051 has internal RAM and ROM for these functions. Additional external memory can be added if needed by the appropriate circuitry [5]. Figure 5: 8051 Memory Map [3] 5

11 3.1 Memory Space Separation and Size Unlike Von Neumann architecture microcontrollers, which use a single address for either program code or data, but not for both, the 8051 has a Harvard architecture, which uses the same address, in different sets of memory, for both code and data. The internal circuitry accesses the correct memory set based on the nature of the operation in progress, as will be discussed later [5]. The 8051 supports 64K bytes of program storage, the lowest 4K being on-chip, the remainder external. In addition to the 128 bytes of on-chip RAM, the 8051 supports up to 64K of additional external data storage. The 8051 memory structure is shown in Figure 5 [9]. 3.2 Program Storage After a processor reset, the CPU begins to fetch instructions beginning at address 0000H. This starting physical address is either on-chip or in external storage depending on the pin designated EA as shown in Figure 5. If EA is low, the address 0000H and all other program storage address will reference external storage. If, however, EA is high, addresses 0000H to 0FFFH will reference on-chip ROM and higher addresses will automatically reference external storage [9]. 3.3 Data Storage Figure 6: 8051 Lower 128-bytes of Internal RAM [3] The internal data storage of the 8051 consists of the lower 128 byes and the Special Function Register 6

12 (SFR) space, also 128 byes, which will be discussed later. The lower 128 byes of internal RAM is shown in Figure 6. The lowest 32 byes, from address 00H to 1FH are grouped into four banks, numbered 0 to 3, of eight registers each. Only one bank at a time can be in active use, and is selected by a 2-bit field, consisting of RS0 and RS1 in the Program Status Word (PSW). The eight registers in the active bank are designated R0 through R7 and can be addressed by name or directly by RAM address. After a reset, the Stack Pointer (SP), points to the top register of the lowest bank at address 07H. The 16 bytes above the register banks form a block that can be addressed as either bytes or as 128 individual bits. The byte addresses of this block range from 20H to 2FH. The bit addresses range from 00H to 7FH. Even though the same numeric address can refer to either a byte of a bit, there is no ambiguity. Thus, for example, bit address 4F is also bit 7 of byte address 29H. The instruction that uses the address determines whether the reference is to be a byte or a bit. Addressable bits are useful when a program need only to remember a binary event [5, 9]. 3.4 On-Chip ROM The block of on-chip ROM occupies code address space 0000H to 0FFFH. The Program Counter (PC) is used to address program code bytes from addresses 0000H to FFFFH. Addresses referenced higher than 0FFFH will cause the 8051 to fetch code bytes from external program memory. Code bytes can also be fetched exclusively from external address by grounding the external access pin EA [5]. The contents of the on-chip ROM in the 8051 are masked at the factory. The program designer sends a program for the 8051 to the chip manufacturer. The manufacturer translates the program into a pattern on a photographic mask that is used to define a set of interconnections in the silicon during a final step of chip production. Once this process is completed, the program contained on the chip cannot be changed. This masking process is highly cost effective for large distributions of chips, such as mass-produced consumer electronics. To be cost effective, the program must be stable (no changes needed) and completely bug-free before the masking processes is completed. Some 8051 derivatives allow for program alteration. Although these options may not be cost effective for mass-production, they do offer a cost and time benefit for development and small scale productions [9]. 7

13 4 Special Function Registers Figure 7: Special Faction Map [3] The 8051 operations that do not use the internal 128-byte RAM address from 00H to 7FH are done by a group of specific internal register, each called a Special Function Register (SFR), which may be addressed much like internal RAM, using addresses from 80H to FFH. Some of the SFR locations are bit-addressable as well as byte-addressable. Figure 7 shows a Special Function Register map. Not all addresses are occupied. In general, unoccupied addresses are not implemented and reserved for future versions of the 8051 [5, 9]. 4.1 Accumulator and B Registers The 8051 contains 34 general purpose registers. Two of these, the Accumulator (A) and the B register, hold the results of many instructions. These two registers are known commonly as the CPU registers [5]. When referring to the accumulator as a location in the SFR, ACC is used. Accumulator specific instructions use the accumulator as A [9]. The accumulator register is the most versatile of the two CPU registers and is used in many operations including addition, subtraction, integer multiplication and division, and Boolean bit manipulations. The A register is also used for all data transfers between the 8051 and external memory 8

14 [5]. Because of this heavy reliance on the accumulator, the 8051 is commonly referred to as having an accumulator architecture. The B register has a specific function in multiply and divide operations. This register has no other special function and otherwise may be used as a general memory location [9]. 4.2 Program Status Word Figure 8: Program Status Word Register [3] Figure 8 shows the flags contained in the Program Status Word Register. Flags are 1-bit registers provided to store the results of certain program instructions. Other instructions may test the condition of the flags and make decisions based on the flag status. Many of the more common flags are grouped inside the PSW. The PSW contains math flags, user program flag F0, and the register select bits that identify which of the four register banks is currently active. The math flags include Carry (C), Auxiliary Carry (AC), Overflow (OV), and Parity (P). The user flag F0 may be used for a user-defined purpose. All flags can be set and cleared directly by the programmer, but are more commonly used as status indicators of instruction results [5]. Note that although that PSW does not include a zero flag, as many architectures do, this is not a problem because the 8051 has specific instructions to test the accumulator for zero [9]. 9

15 4.3 Stack Pointer The stack is an area of RAM that is used with certain instructions to quickly store and retrieve data. The 8-bit Stack Pointer (SP) register is used to hold a RAM address that points to the top of the stack. The address in the register points to the RAM address of the last byte of data that was placed on the stack by a stack operation [5]. Because the stack pointer is 8 bits wide, the maximum stack size is 256 bytes. The stack pointer is incremented for new data in the stack, so the stack grows upward through memory as data is stored. On a processor reset, the stack pointer contains the address 07H, causing the stack to start at location 08H in a register bank. Because programs usually use this area of memory (the registers) for other uses, the stack pointer can be changed to any internal RAM address by the programmer, causing the stack to be moved to a different location. The stack is usually moved higher in RAM before doing any stack operations. Care must be taken when moving the stack to avoid conflicts with other registers, bit-addressable memory or otherwise reserved areas of RAM [9]. 4.4 Program Counter and Data Pointer The 8051 contains two 16-bit registers: the Program Counter (PC) and the Data Pointer (DPTR). Each is used to hold the address of a byte in memory. Program instructions are fetched from locations in memory that are addressed by the program counter. As stated before, code ROM may be fully on-chip, fully off-chip, or a combination of both. The program counter is automatically incremented after every instruction byte is fetched and may also be altered by certain instructions such as jumps and branches [5]. The data pointer is a 16-bit quantity held in two 8-bit parts: the high byte in DPH and the low byte in DPL. The primary purpose of the DPTR is to hold a 16-bit address for certain instructions, especially when referencing external memory. It can be used as a single 16-bit register or two 8-bit registers [9]. 4.5 Port Latches The 32 I/O pins are organized into four 8-bit ports named P0-P3. Each port has an associated 8-bit latch, the outputs of which drive the matching I/O pins. The contents of the latches can be read from or written to in the SFR [9]. Ports will be discussed in more detail later. 10

16 4.6 Serial Data Buffer The Serial Data Buffer (SBUF) is actually two different registers sharing a common address. One register is read-only and the other is write-only. When data are written to SBUF, they go to a transmit buffer and are held there for serial transmission. When data are read from SBUF, they come from the serial data receive buffer [9]. Serial communication will be discussed in more detail later. 4.7 Timer Registers The registers TH0 and TL0 are the high and low bytes, respectively, of the 16-bit counting register for timer/counter 0. Likewise, TH1 and TL0 are for timer/counter 1 [9]. Some 8051 derivatives include other timer registers for additional timers to special types of counters. Timers and counters will be discussed in more detail later. 4.8 Control Registers The SFR contains registers used for the control and status of the interrupt system, the timers and counters, and the serial port. The are: Interrupt Priority (IP), Interrupt Enable (IE), Timer Mode (TMOD), Timer Control (TCON), Serial Port Control (SCON), Power Control (PCON) [9]. Each will be discussed later. 5 I/O Ports One of the major features of a microcontroller is the versatility built into the I/O circuits that connect the microcrontoller to the outside world [8]. To be commercially viable, the 8051 had to incorporate as many I/O functions as were technically and economically possible [5]. One of the most useful features of the 8051 is four bidirectional I/O ports. Each port has an 8-bit latch in the SFR space as mentioned earlier. To reduce the overall package pin count, the 8051 employs multiple functions for each port. Each port also has an output drive and an input buffer. These ports can be used to general purpose I/O, as an address and data lines, and for certain special functions to be discussed later [9]. 11

17 5.1 Input Loading and Output Driving Ports 1, 2 and 3 have the equivalent of internal pull-up resistors. When used as input, the pin of P1, P2 and P3 will be high (logical 1) when open-circuited and will source current when pulled low by an external device. Port 0 does not have the same pull-up feature and is floating (high impedance) when used as an input. Some care should be taken to avoid confusion when reading a port. Each port has a D-type output latch for each pin. The SFR for each port is made up of these eight latches, which can be addressed at the SFR address for the port. The port latches should not be confused with the port pins. A condition can occur where the port is of such low resistance that the voltage of the pin is at the same level as a low. Reading the latch would show a 1, but reading the pin would show a 0. Instructions that do read-modify-write operations read the latch. When used as outputs, ports 1, 2, and 3 each can drive the equivalent of four LSTTL inputs. Port 0 can drive eight such equivalent inputs. However, manufacturer specification should be carefully followed for driving. Driving more than two LSTTL inputs typically degrades the noise immunity of the ports. Buffering the ports when they must drive currents in excess of the manufacturer recommendations may be required. To speed up 0 to 1 output transitions on ports 1, 2, and 3, an additional pull-up is activated briefly during output to drive the pin high quickly [5, 9]. 5.2 Alternate Port Functions Pin Function P3.0 RXD(serial input port) P3.1 TXD(serial output pin) P3.2 IN T 0(external interrupt) P3.3 IN T 1(external interrupt) P3.4 T0(timer/counter 0 external input) P3.5 T1(timer/counter 1 external input) P3.6 WR(external data memory write strobe) P3.7 RD(external data memory read strobe) Table 1: Alternalte Functions of Port 3 Pins [3] All of the pins of port 3 have an alternate function, as listed in Table 1. To enable an alternate function, a 1 must be written to the corresponding bit in the port latch[9]. Unlike ports 1 and 2, which can have external addressing functions and change all eight port bits when in alternate use, each pin of port 3 may 12

18 be individually programmed to be used either as I/O or as one of the alternate functions [5]. 5.3 Accessing External Memory Two separate external memory spaces are made available by the 16-bit PC and DPTR and by different control pins for enabling external ROM and RAM chips. Internal control circuitry accesses the correct physical memory, depending on the machine cycle state and the instruction being executed. Because the 8051 has separate program memory and data memory, it uses different hardware signals to access external storage devices. The Program Store Enable (PSEN) signal is used as the read strobe for program memory and RD and WR are used as the read and write strobes to access data memory. Note that RD and WR are alternate functions of P3.6 and P3.7, as mentioned earlier. Ports 0 and 2 are used to address and access external memory. Accesses to external program storage always uses a 16-bit address. Accesses to external data storage may use either an 8-bit or a 16-bit address, depending on the instruction being executed. In the case of a 16-bit address, the high-order 8 bits of the address are output on port 2, where they are held constant during the entire memory access cycle. The prior contents of port 2 latched are stored and restored after the memory cycle has completed. The low-order 8 bits of the address are multiplexed with the data byte on port 0. That is, it first provides the lower byte of the 16-bit memory address, then acts as a bidirectional data bus to write or read a byte of memory data. When used in this mode, port 0 pins are connected to an internal active pull-up; they do not float as they would normally. The prior contents of port 0 latches are lost. The Address Latch Enable (ALE) signal must be used to capture the low-order address bits in an external latch [5, 9]. 6 Timers and Counters Many microcontroller applications require the counting of external events, such as frequency of a pulse train, or the generation of precise internal time delays between actions. Both of these tasks can be accomplished using software techniques, but software loops for counting or timing keep the processor occupied so that other, perhaps more important, functions are not done [6]. 13

19 The 8051 has two 16-bit registers that can be used as either timers or counters. These two up counters are name T0 and T1 and are provided for general use of the programmer. Each counter may be programmed to count internal clock pulses, act as a timer, or programmed to count external events as a counter. The counters are divided into two 8-bit registers called the timer low (TL0, TL1) and timer high (TH0, TH1) bytes. These registers are in the SFR as pairs of 8-bit registers [5, 9]. 6.1 Timing If a counter is programmed to be a timer, it will count the internal clock frequency of the 8051 oscillator divided by 12. The register is incremented once per machine cycle, which is equal to once per 12 clock periods. When used as a counter, the register is incremented on a 1-0 transition (a negative edge) applied to the appropriate input pin. It takes two complete machine cycles for the 8051 to see the negative edge transition; the input must be held high for at least one cycle and then low for at least one cycle. 6.2 Timer 0 and Timer 1 Figure 9: Timer/Counter Mode Control Register (TMOD) [3] The operation mode of timer 0 and timer 1 is determined by the 8 bits written to the TMOD register, shown in Figure 9. Bits M0 and M1 (one pair for each timer) are used as a two bit field to select one of 14

20 four operating modes, designated mode 0 through 3. Both counters work the same in modes 0, 1, and 2, but differently in mode 3 [9]. TCON, shown in Figure 10, has the control bits and flags for the timers in the upper nibble, and control bits for the external interrupts in the lower nibble. The TCON register must be carefully set when using timer generated interrupts [5] Figure 10: Timer/Counter Control Register (TCON) [3] 6.3 Timer Modes Mode 0 and Mode 1 Mode 0 is a 13-it counter that can be thought of as an 8-bit counter preceded by a 5-bit divide-by-32 prescaler[9]. Setting a timer mode bits to 00B in the TMOD register results in using the THx (where x = 0 or 1) registers an 8-bit counter and TLx as a 5-bit counter; the pulse input is divided by 32 in TL so that TH counts the original oscillator frequency reduced by a total 384. A an example, the 6 megahertz oscillator frequency would result in a final frequency to TH of hertz. The timer interrupt flag (TF) is set whenever THx goes from FFH to 00H (an overflow), or in.0164 seconds for this example if THx starts at 00H [5]. Mode 1 is the same as mode 0, except that the timer register is 16 bits long, with all 8 bits of TL being used[9]. The mode bits in TMOD are set to 01B [5]. 15

21 6.3.2 Mode 2 Mode 2 is selected when the mode bits of TMOD are set to 10B. Mode 2 is commonly referred to as an 8-bit auto-reload timer. The TL register is used as an 8-bit stand-alone counter and the TH stores a preset number. When TL goes from all 1s to all 0s the interrupt flag is set and the contents of TH are transferred to TL. The contents of TH remain unchanged unless altered by the programmer. Because the contents of TH are under software control, the counter can be made to divide the count source by any number from 1 to 255 by means of the automatic reload of TH into TL [9] Mode 3 In mode 3, timer 1 is disabled but holds its current count. Timer 0 mode 3 is split into separate counters. The first counter is the same as mode 0, except TL0 is used as an 8-bit counter and there is no prescaler divide. The second counter uses TH0 as an 8-bit counter. The count source is the oscillator divided by 12 and the enable control is the TR1 bit in the TCON register. The first counter sets the TF0 interrupt flag and the second counter sets TF1. Mode 3 is the only mode in which the timers do not operate independently [5, 9]. 6.4 Timer 2 Timer 2 is a 16-bit timer/counter only in the 8052 family. It is not included in the 8051 core architecture. The input source for timer 2 can be the clock or an external input. Timer 2 has three operating modes: capture, auto-load, and baud-rate generator. The input source and mode can be selected by bits in the T2CON register [9]. 7 Serial Ports In modern multiprocessor distributed systems, computers must be able to communicate with other computers. One cost-effective way to do this is to send and receive data bit serially [5]. The 8051 has a full duplex serial port that allows for data transmission to be accomplished by hardware while software does other things. A serial port interrupt is generated by hardware so that the program can read or write serial 16

22 data to the port at the appropriate time. The receiver hardware is double buffered which allows the receiver interrupt service to be less-time critical by storing a frame until another frame is received. However, the first frame must be read before the next frame is received or the first frame will be overwritten and lost. Both transmit and receive buffers are accessed at the same address in the SFR space. Writing to SBUF loads the transmit buffer, and reading from SBUF obtains the contents of the receive buffer. The serial port has four modes of operation to be discussed later [9]. 7.1 Serial Port Control and Status Register Figure 11: Serial Port Control and Status Register (SCON) [3] SCON, shown in Figure 11, is the serial port control and status register. Bits SM0 and SM1 are used to select the operating modes for the serial port. The SM2 bit is used in a multiprocessor system where one 8051 acts as a master and send commands to slave devices. These types of systems will not be discussed here. Note the other bits included in SCON. REN is a software set bit that enables or disables serial reception. TB8 and RB8 are used in modes 2 and 3 and will be discussed later. TI and RI are transmit and receive interrupt flags that are set by hardware to trigger a software routine. Both must be cleared in software [5, 9]. 17

23 7.2 Serial Port Modes Mode 0 - Shift Register Mode Mode 0 is a half-duplex synchronous operation, also known as shift register mode. Setting bit SM0 and SM1 in SCON to 00B configured SBUF to receive or transmit data bits using pin RXD for both functions (but not at the same time). Pin TXD in connected to the internal shift frequency pulse source to supply shift pulses to external sources. The shift frequency, or baud rate, is fixed at 1/12 of the oscillator frequency, the same rate used by the timer/counters when operating in the timer configuration. The TXD shift clock is a square wave that is low to machine cycle states S3-S4-S5 and high for S6-S1-S2 [5]. A shift clock edge will occur during the valid state of each data bit. When transmitting, data are shifted out of RXD. Received data comes in on pin RXD and should be synchronized with the shift clock produced at TXD. Note that both RXD and TXD are alternate functions of port 3 pins [9]. Mode 0 is not intended for communication between computers, but as a high-speed serial data-collection method using discrete logic to achieve high data rates. The baud rate for mode 0 will be much higher than other modes [5] Mode 1 - Standard UART Mode 1 is a full-duplex synchronous operation, also known as a Standard UART. Setting SM0 and SM1 in SCON to 01B, SBUF becomes a 10-bit full-duplex receiver/transmitter that may receive and transmit data at the same time. Data are sent out RXD and received through TXD. A complete frame consists of a start bit (always a 0), followed by 8 data bits (LSB first), followed by a stop bit (always a 1). The start and stop bits are added by the hardware; the software writes the 8-bit data byte to, or reads it from, SBUF. When transmitting, all 10 bits are sent via TXD. Once all 10 bits have been transmitted, TI is set to signal software the transmission is complete. When receiving, the start bit is discarded, the stop bit is stored in RB8 of SCON, and RI is set to indicate a received byte is stored in SBUF. If RI is still set from the previous receive, indicating that previous byte has not yet been read from SBUF, the new byte will not be stored and will be lost [5, 9]. Timer 1 is used to generate the baud rate for Mode 1 by using the Overflow flag of the timer. Typically, 18

24 timer 1 is used in timer mode 2 as an 8-bit auto-reload timer. Care must be taken to ensure the correct baud rate is being used [5]. Baud rate selection and calculation is beyond the scope of this document. The reader should consult the Intel MCS-51 Microcontroller Family User s Manual (see [3]) for this information Mode 2 and Mode 3 - Multiprocessor Modes Mode 2 is similar to mode 1 except 11 bits are transmitted: a start bit, nine data bits, and a stop bit. The ninth data bit is copied from bit TB8 in SCON during transmit and stored in bit RB8 of SCON when data is being received. Both start and stop bits are discarded. The 11th data bit is typically used as an interrupt source to multiprocessor communications. The baud rate for Mode 2 is either 1/32nd or 1/64th of the oscillator frequency as selected in bit 7 (SCON) of the PCON register. This baud rate is much higher than the standard communication rates. This high data rate is needed in many multiprocessor application [5, 9]. Mode 3 is the same as mode 2, except the baud rate is variable and can be obtained in the same way as in mode 1, via timer 1 overflows [9]. 7.3 PCON Register Of the 8 bits in the PCON power control register, only bit 7, SMOD, is used in the standard As mentioned earlier, SMOD is used in setting the baud rate of the serial port in mode 2. Other bits are used in CMOS versions of the 8051 for power-savings modes and general-purpose flags [9]. 8 Interrupts A program only has two ways to determine the conditions that exists in internal and external circuits. One method uses software processing heavily. Software techniques use up processor time that could be devoted to other tasks. The second method is to respond to hardware signals, called interrupts, that force the program to call a special subroutine, called an Interrupt Service Routine (ISR). Interrupts take processor time only when action by the program is needed. Most applications of microcontrollers involve responding to events quickly enough to control the environment that generates the events (called real-time programming). 19

25 Interrupts are often the only way in which real-time programming can be done successfully [5]. The 8051 has Figure 12: Interrupt Enable Register [3] five interrupt sources. INT0 and INT1 are external pin interrupt sources. TF0 and TF1 are timer/counter overflow interrupt flags. Another source comes from the serial port, as discussed earlier. A useful feature of the 8051 is that the interrupt sources are associated with bit locations in registers. Those bits can be set or cleared by software, with the same results as when those bits are cleared or set by hardware [5]. As shown in Figure 12, all interrupts or each individual interrupt can be enabled or disabled by setting or clearing the appropriate bits in the Interrupt Enable (IE) register. If enabled, an interrupt will cause a call to one of the predefined locations in RAM. The return address automatically is pushed onto the stack before jumping and is popped back off when an RETI (return from interrupt) instruction is executed. If an interrupt occurs while it is disabled, or while a higher priority one is running, it becomes pending. As soon as a pending interrupt is enabled, it will cause a call, unless it was other canceled in software while it was still pending [9]. 8.1 Servicing External Devices The timing of real-world events is usually asynchronous to the CPU timing; they have no relationship. In order to monitor and control external devices, a microprocessor must have method of responding to an event in a timely manner. Interrupts are instrumental in these types of operations [9]. 20

26 8.2 Polling and Buffering Polling is the method that the processor may use to periodically ask each device if it needs service. The disadvantage of polling is the amount of CPU time that is dedicated to continually checking all devices. Polled devices typically buffer, or store, data that it needs to exchange with the processor the next time it is polled. However, if polling is too slow, and the buffer runs out of data to store, or overflows with too much data, time will be wasted or data lost. Both conditions are unacceptable in most applications In real-time programming applications, devices cannot typically wait for a poll from the processor. The device must be serviced as quickly as possible in order for the application to be useful. A much better way for devices to signal the processor is using interrupts [9]. 8.3 Basic Interrupt Action I/O devices often require immediate service while the processor is busy doing other things. The interrupt is a software-controlled hardware feature that forces the processor to stop what it is doing and service the device that generated the interrupt. When the processor is finished with the device, it may resume the previous task where it left off. An I/O device will request service by activating an interrupt pin on the CPU. If the CPU has enabled that interrupt in software, it will initiate its response, often with an acknowledgment signal sent to the device. This is an example of handshaking between the processor and the I/O device. The rest of the response is similar to a subroutine call. The CPU will push the return address onto the stack and branch to a predefined part of memory, where it expects to find the service routine that it must execute. The last instruction in the routine will be a RETURN, which will pop the return address off the stack and into the PC register. The CPU will then resume program execution from the point where is was interrupted [9]. 8.4 Multiple Interrupt Sources and Vectoring It is possible to have multiple interrupt sources. When an interrupt occurs, the processor must first determine which device caused the interrupt. One method of determining the device that was responsible is to poll all the devices. However, polling can be time consuming. A faster way is for each device to point 21

27 to the place in memory where its service routine is stored. The CPU can then go directly to that location. Such a system is called vectored interrupt. With a vectored interrupt systems, some problems can arise. What happens if two devices trigger interrupts at the same time? Which interrupt is serviced first? The 8051 has a priority scheme to solve this common problem [5, 9]. 8.5 Priority Levels The 8051 has a two-tier priority structure. The top tier has two levels: high and low. Each interrupt source can be assigned to either high or low status by setting the appropriate bits in the Interrupt Priority (IP) register, as shown in Figure 13. When two interrupts of different levels are received at the same time, the one with the higher priority is serviced first. Second tier is used to resolve interrupts that occur at the same time with the same priority level. The priority-within-level ordering from highest to lowest is fixed as follows: IE0, TF0, IE1, TF1, RI or TI [9]. Figure 13: Interrupt Priority Control Register [3] 8.6 Interrupt Timing and Handling At the end of each instruction (except RETI), the 8051 checks all the interrupt flags to determine if an interrupt has occurred. If an interrupt has occurred, a call to the appropriate vector will be generated. The hardware will not generate the interrupt if a higher priority interrupt is already running. The interrupt flags are not checked after an RETI instruction so that, in the case that an interrupt is continually 22

28 being generated, the remainder of the program will still slowly execute. The time between the activation of the interrupt and the start of execution of the service routine is referred to as the response time. On the 8051, the best-case response time is three machine cycles and the worst-case time is nine machine cycles. Response time may be critical in many real time applications [5]. 8.7 Activation Levels and Flag Clearing Interrupts can either be level-triggered or edge-triggered. On the 8051, the external interrupts INT0 and INT1 can be configured to be either level or edge triggered, depending on the value of the bits IT0 and IT1 in the TCON register (see Figure 10). The flag bit will be set when the interrupt occurs and cleared automatically when the call is made to the interrupt vector. For the timers, the TF0 and TF1 flags are set when the counter overflows from all 1s to all 0s. The timer interrupts therefor are considered edge triggered. TF0 and TF1 are also cleared automatically during interrupt service. The serial port interrupt is generated when either the RI or TI bits are set to 1. RI and TI are not automatically cleared. The ISR must determine which bit caused the interrupt and clear it as part of the routine [5]. 8.8 Predefined Vector Addresses The 8051 has predefined vector addresses for interrupts. Table 2 shows this vector assemblers will typically have mnemonics associated with each interrupt source [5]. Interrupt Source IE0 TF0 IE1 TF1 RI & TI TF2 & EXF2 Vector Address 0003H 000BH 0013H 001BH 0023H 002BH Table 2: Interrupt Vector [3] 23

29 9 Instructions and Addressing The 8051 has five addressing modes and five groups of instructions. Different addressing modes allows the 8051 great flexibility and power as a control device [5]. Addressing modes will be discussed, but no examples will be presented here. It is assumed that the reader is familiar with various addressing modes. The reader should refer to the Intel MCS-51 Microcontroller Family User s Manual (see [3]) for more information about addressing modes. 9.1 Direct Addressing Direct addressing is the simplest addressing mode of the Instructions using direct addressing are 2 bytes long. One byte for an 8-bit opcode and one byte for an 8-bit address. The address is a location in internal RAM or the SFR space. Depending on the type of instruction, the address refers to either a byte location or a specific bit in a bit-addressable byte. Figures 6 and 7 showed various address spaces in both RAM and the bit-addressable bytes in the SFR area. Assemblers for the 8051 usually have predefined mnemonic symbols corresponding to important bit and byte addresses. Table 3 on Page 25 shows the bit address names, and Table 4 on Page 26 shows the byte address names. These mnemonics are commonly referenced in 8051 program code [9]. 9.2 Indirect Addressing An instruction using direct addressing specifies the address of the operand explicitly. An instruction using indirect addressing specifies a register that contains the address of the operand. Because the contents of the register can be changed by the program, indirect addressing is a powerful technique. Also, most of the instructions that use indirect addressing are only 1 byte long. Indirect addressing can access external or internal RAM and addresses can be 8 or 16 bits long. The 8-bit addresses use registers R0-R7. 16-bit addresses use the DTPR register [9]. 24

30 Symbol Bit Position Bit Address Meaning CY PSW.7 D7H Carry Flag AC PSW.6 D6H Auxiliary Carry Flag F0 PSW.5 D5YH Flag 0 RS1 PSW.4 D4H Register Bank Select Bit 1 RS0 PSW.3 D3H Register Bank Select Bit 0 OV PSW.2 D2H Overflow Flag P PSW.0 D0H Parity Flag TF1 TOCN.7 8FH Timer 1 Overflow Flag TR1 TCON.6 8EH Timer 1 Run Control Flag TF0 TCON.5 8DH Timer 0 Overflow Flag TR0 TCON.4 8CH Timer 1 Run Control Flag IE1 TCON.3 8BH Interrupt 1 Edge Flag IT1 TCON.2 8AH Interrupt 1 Type Control Bit IE0 TCON.1 89H Interrupt 0 Edge Flag IT0 TCON.0 88H Interrupt 0 Type Control Bit SM0 SCON.7 9FH Serial Mode Control Bit 0 SM1 SCON.6 9EH Serial Mode Control bit 1 SM2 SCON.5 9DH Serial Mode Control Bit 2 REN SCON.4 9CH Receiver Enable TB8 SCON.3 9BH Transmit Bit 8 RB8 SCON.2 9AH Receive Bit 8 TI SCON.1 99H Transmit Interrupt Flag RI SCON.0 98H Receive Interrupt Flag EA IE.7 AFH Enable All Interrupts ES IE.4 ACH Enable Serial Port Interrupt ET1 IE.3 ABH Enable Timer 1 Interrupt EX1 IE.2 AAH Enable External Interrupt 1 ET0 IE.1 A9H Enable Timer 0 Interrupt EX0 IE.0 A8H Enable External Interrupt 0 RD P3.7 B7H Read Data for External Memory WR P3.6 B6H Write Data for External Memory T1 P3.5 B5H Timer/Counter 1 External Flag T0 P3.4 B4H Timer/Counter 0 External Flag INT1 P3.3 B3H Interrupt 1 Input Pin INT0 P3.2 B2H Interrupt 0 Input Pin TXD P3.1 B1H Serial Port Transmit Pin RXD P3.0 B0H Serial Port Receive Pin PS IP.4 BCH Priority of Serial Port Interrupt PT1 IP.3 BBH Priority of Timer 1 Interrupt PX1 IP.2 BAH Priority of External Interrupt 1 PT0 IP.1 B9H Priority of Timer 0 Interrupt PX0 IP.0 B8H Priority of External Interrupt 0 Table 3: Predefined bit addresses for 8051 [3, 9] 25

31 Symbol Hex Address Meaning ACC E0 Accumulator B F0 Multiplication Register DPH 83 Data Pointer (high byte) DPL 82 Data Pointer (low byte) IE A8 Interrupt Enable IP B8 Interrupt Priority P0 80 Port 0 P1 90 Port 1 P2 A0 Port 2 P3 B0 Port 3 PSW D0 Program Status Word SBUF 99 Serial Port Buffer SCON 98 Serial Port Controller SP 81 Stack Pointer TCON 88 Timer Control TH0 8C Timer 0 (high byte) TH1 8D Timer 1 (high byte) TL0 8A Timer 0 (low byte) TL1 8B Timer 1 (low byte) TMOD 89 Timer Mode Table 4: Predefined data addresses for 8051 [3, 9] 9.3 Register Addressing Register instructions use the contents of one of the registers, typically R0-R7, as the operand. All register instructions are 1 byte long. A few register instructions are register-specific; they do not allow the programmer to specify an arbitrary register. Register instructions rely on the accumulator as a second operand if needed [9]. 9.4 Immediate Operand Instructions Instructions that use immediate operands have a numeric constant following the op-code. The constants can be 8 or 16 bits long, depending on the instruction [9]. Immediate operand instructions are useful in loading specific numerical values into registers. 9.5 Indexed Addressing The 8051 has two different uses for indexed addressing: reading data tables from program memory space and implementing jump tables. In either case, a 16-bit register holds a base address and the accumulator holds an 8-bit displacement or index. The address of the data byte (or jump address) is the sum of the 26

32 16-bit base address and the 8-bit displacement held in the accumulator. Because the addition is unsigned, the result is always a forward reference from the base address of 0 to 255 bytes. The base register is either DPTR or the PC [9]. 10 Instruction Groups The 8051 has 111 instruction types. Counting the variations of these types, there are 255 different instructions. Each hex code from 00H to FFH corresponds to a valid instruction, except A5 which is reserved for future use. The instructions fall into five general groups: arithmetic, logic, data transfer, Boolean, and branching [9]. A brief description of each group, and some specific instructions follows. However, the reader should consult the Intel MCS-51 Microcontroller Family User s Manual (see [3]) for a complete listing of instructions and detailed descriptions Arithmetic Operations The 8051 has the typical arithmetic operations of an 8-bit processor: add (ADD), add-with-carry (ADDC), subtract-with-borrow (SUBB), increment (INC), decrement (DEC), and decimal-adjust-accumulator (DA). It also has two advanced operations not as typical of 8-bit microprocessors: multiply (MUL) and divide (DIV) [8, 9]. MUL AB multiplies the contents of the accumulator by the contents of the B register as unsigned 8-bit integers to give a 16-bit result. The lower order 8 bits of the result are stored in the accumulator and the higher-order bits will be in the B register. DIV AB causes the contents of the accumulator to be divided by the contents of the B register as unsigned integer numbers. The integer part of the result will be in the accumulator, and the remainder will be stored in the B register Logic Operations Logic operations of the 8051 include and (ANL), or (ORL), exclusive-or (XRL), clear and complement (CLR and CPL), and rotates (RL, RLC, RR, RRC). Also in the group is the SWAP A instruction which swaps nibbles within the accumulator. SWAP is useful when working with 4-bit quantities such as BCD 27

33 numbers [9] Data Transfer Operations The basic data transfer instruction is move, which has three forms: MOV, MOVC, and MOVX. Also included in the group are PUSH, POP and XCH(exchange). MOV instructions are used to reference internal RAM and SFR space. Two MOVC instructions are used to move bytes from program memory into the accumulator, as from a data table. The MOVX instructions are used to reference external RAM [9] Boolean Operations This group of instruction is associated with the single-bit Boolean processor hardware of the This group include set and clear, and, or and complement instructions. Bit-level move instructions and bit-level test conditional jumps. This group makes up a miniature assembly language set for the Boolean processor which will be discussed shortly [9] Branching Operations Included in this group are all subroutine calls and returns and various conditional and unconditional jumps. The conditional jumps are relative to the first byte of the next instruction. Because the jump is given as a signed two s complement 8-bit number, the range is -128 to +127 bytes, allowing for forward and backward jumps. The jump instruction has three basic versions: short (SJMP), long (LJMP), and absolute (AJMP). The short jump uses a relative offset as described above. The long jump uses a 16-bit address as part of the instruction which allows a jump to any reference in the 64K program memory space. The long jump instruction is 3 bytes long. The absolute jump uses an 11-bit address which is split into 8 lower bits and 5 upper bits. The 3 upper bits are combined with a 5-bit operation specifier to make an 8-bit opcode. Therefore, the entire instruction is only 2 bytes long. The 11 bits of the address are substituted for the lower 11 bites in the program counter, which means that the location referenced must be within 2K bytes of the 28

34 instruction following the absolute jump. The upper 5 bits in the PC remain the same [9]. 11 Boolean Processor The single bit Boolean processor can thought of as a built-in bit-level coprocessor which uses the Boolean set of operations as discussed earlier. The Boolean processor is not a true coprocessor because it does not run separately. All of the port lines, 128 bits in RAM and many bits in the SFR space register have bit addresses and are capable of bit-level access. this type of hardware and software combination makes the 8051 well suited for control application that have many on/off kinds of inputs and outputs such as switches, lights, relays and stepper motor drivers [9] Carry The carry bit, bit 7 of the PSW, is the equivalent of an accumulator for the Boolean processor. the name CY is used to designate the carry bit then referring to it as a bit address and the symbol C is used in register-specific instructions that reference the carry bit. The assembler will translate the symbol CY to the number D7H, the bit address of the carry bit. Thus, the instructions CLR PSW.7 and CLR CY are equivalent. Bits from the SFR space registers, from internal RAM, and from I/O ports can be read into CY. Operations such as AND and OR can be performed on CY and the result written back to a bit address. Program branching can be conditional on the state of CY or any other addressable bit. Extensive bit manipulation can be done without having to use extraneous code to mask off bits to extract them from bytes [9]. 29

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller 1 Salient Features (1). 8 bit microcontroller originally developed by Intel in 1980. (2). High-performance CMOS Technology. (3). Contains Total 40 pins. (4). Address bus is of 16 bit

More information

Microcontroller Intel [Instruction Set]

Microcontroller Intel [Instruction Set] Microcontroller Intel 8051 [Instruction Set] Structure of Assembly Language [ label: ] mnemonic [operands] [ ;comment ] Example: MOV R1, #25H ; load data 25H into R1 2 8051 Assembly Language Registers

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MICROCONTROLLERS AND APPLICATIONS 1 Module 2 Module-2 Contents: Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MEMORY

More information

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman Microprocessors 1 The 8051 Instruction Set Microprocessors 1 1 Instruction Groups The 8051 has 255 instructions Every 8-bit opcode from 00 to FF is used except for A5. The instructions are grouped into

More information

ENE 334 Microprocessors

ENE 334 Microprocessors Page 1 ENE 334 Microprocessors Lecture 7: MCS-51 Architecture I : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Architecture I Page 2 Outlines: 8051 Microcontroller Hardware

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051: DEPARTMENT OF ECE MICROPROCESSORS AND MICROCONTROLLERS MATERIAL UNIT V 8051 MICROCONTROLLERS To make a complete microcomputer system, only microprocessor is not sufficient. It is necessary to add other

More information

Module Contents of the Module Hours COs

Module Contents of the Module Hours COs Microcontrollers (EE45): Syllabus: Module Contents of the Module Hours COs 1 8051 MICROCONTROLLER ARCHITECTURE: Introduction to Microprocessors and Microcontrollers, the 8051 Architecture, 08 1 and pin

More information

EE6502- MICROPROCESSOR AND MICROCONTROLLER

EE6502- MICROPROCESSOR AND MICROCONTROLLER . EE6502- MICROPROCESSOR AND MICROCONTROLLER UNIT III - 8051 MICROCONTROLLER PART - A 1. What is Microcontroller? A device which contains the microprocessor with integrated peripherals like memory, serial

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text In this lecture the detailed architecture of 8051 controller, register bank,

More information

Distributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. 8051 8052 and 80C51 Hardware Description December 1992 Order Number 270252-006

More information

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52 Features Compatible with MCS -51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 10,000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz

More information

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families The Microcontroller Lecture Set 3 Architecture of the 8051 Microcontroller Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports. In most cases, all that is

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 8, 2016 Controller vs Processor Controller vs Processor Introduction to 8051 Micro-controller In 1981,Intel corporation

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller EE4380 Fall 2001 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas 8051 Architecture Programmer s View Register Set Instruction Set Memory

More information

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,

Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, CISC and RISC processors etc. Knows the architecture and

More information

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch HARDWARE DESCRIPTION This chapter provides a detailed description of the 80C51 microcontroller (see Figure 1). Included in this description are: The port drivers and how they function both as ports and,

More information

Microcontroller. Instruction set of 8051

Microcontroller. Instruction set of 8051 UNIT 2: Addressing Modes and Operations: Introduction, Addressing modes, External data Moves, Code Memory, Read Only Data Moves / Indexed Addressing mode, PUSH and POP Opcodes, Data exchanges, Example

More information

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC. MICROCONTROLLERS AND APPLICATIONS 1 Module 1 Module I Introduction to Microcontrollers: Comparison with Microprocessors Harvard and Von Neumann Architectures - 80C51 microcontroller features - internal

More information

8051 microcontrollers

8051 microcontrollers 8051 microcontrollers Presented by: Deepak Kumar Rout Synergy Institute of Engineering and Technology, Dhenkanal Chapter 2 Introduction Intel MCS-51 family of microcontrollers consists of various devices

More information

Embedded Controller Programming

Embedded Controller Programming Embedded Controller Programming Counters, Timers and I/O in Assembly Language Ken Arnold Copyright 2000-2004 Ken Arnold 1 Outline Timer/Counters Serial Port More 8051 Instructions Examples Copyright 2000-2004

More information

SN8F5000 Family Instruction Set

SN8F5000 Family Instruction Set SONiX Technology Co., Ltd. 8051-based Microcontroller 1 Overview SN8F5000 is 8051 Flash Type microcontroller supports comprehensive assembly instructions and which are fully compatible with standard 8051.

More information

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller The 8051, Motorola and PIC families are the 3 leading sellers in the microcontroller market. The 8051 microcontroller was originally developed by Intel in the late 1970 s. Today many

More information

MCS-51 Serial Port A T 8 9 C 5 2 1

MCS-51 Serial Port A T 8 9 C 5 2 1 MCS-51 Serial Port AT89C52 1 Introduction to Serial Communications Serial vs. Parallel transfer of data Simplex, Duplex and half-duplex modes Synchronous, Asynchronous UART Universal Asynchronous Receiver/Transmitter.

More information

8051 Core Specification

8051 Core Specification 8051 Core Specification Authors: Jaka Simsic Simon Teran jakas@opencores.org simont@opencores.org Rev. 0.1 August 14, 2001 First Draft www.opencores.org Rev 0.1 First Draft 1 of 26 Revision History Rev.

More information

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH NOVEMBER 1998 FEATURES 80C51 based architecture 4-Kbytes of on-chip Reprogrammable Flash Memory 128 x 8 RAM Two 16-bit Timer/Counters

More information

Contents 8051 Instruction Set BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter I : Control Transfer Instructions Lesson (a): Loop Lesson (b): Jump (i) Conditional Lesson (c): Lesson (d): Lesson (e):

More information

8051 MICROCONTROLLER

8051 MICROCONTROLLER 8051 MICROCONTROLLER Mr.Darshan Patel M.Tech (Power Electronics & Drives) Assistant Professor Department of Electrical Engineering Sankalchand Patel College of Engineering-Visnagar WHY DO WE NEED TO LEARN

More information

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07)

Serial I-O for Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai (version 14/10/07) Serial I-O for 8051 Dinesh K. Sharma Electrical Engineering Department I.I.T. Bombay Mumbai 400 076 (version 14/10/07) 1 Motivation Serial communications means sending data a single bit at a time. But

More information

8XC51RA RB RC Hardware Description

8XC51RA RB RC Hardware Description 8XC51RA RB RC Hardware Description February 1995 Order Number 272668-001 Information in this document is provided in connection with Intel products Intel assumes no liability whatsoever including infringement

More information

C51 Family. Architectural Overview of the C51 Family. Summary

C51 Family. Architectural Overview of the C51 Family. Summary Architectural Overview of the C51 Family C51 Family Summary 1. Introduction............................................................ I.1. 1.1. TSC80C51/80C51/80C31.................................................................

More information

Rev. No. History Issue Date Remark

Rev. No. History Issue Date Remark Preliminary Bar Code Reader Document Title Bar Code Reader Revision History Rev. No. History Issue Date Remark 0.0 Initial issue June 5, 2000 Preliminary 0.1 Change document title from Bar Code Reader

More information

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET 1 SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET Intel 8086/8088 Architecture Segmented Memory, Minimum and Maximum Modes of Operation, Timing Diagram, Addressing Modes, Instruction Set,

More information

8051 Serial Communication

8051 Serial Communication 8051 Serial Communication Basics of serial communication Parallel: transfers eight bits of data simultaneously over eight data lines expensive - short distance fast Serial : one bit at a time is transferred

More information

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation CoE3DJ4 Digital Systems Design Chapter 5: Serial Port Operation Serial port 8051 includes an on-chip serial port Hardware access to the port is through TXD and RXD (Port 3 bits 1 and 0) Serial port is

More information

MODULE-1. Short Answer Questions

MODULE-1. Short Answer Questions MODULE-1 Short Answer Questions 1. Give the comparison between microprocessor and microcontroller. It is very clear from figure that in microprocessor we have to interface additional circuitry for providing

More information

MCS -51 Programmer s Guide and Instruction Set

MCS -51 Programmer s Guide and Instruction Set MCS -51 Programmer s Guide and Instruction Set November 1992 Order Number 270249-003 COPYRIGHT INTEL CORPORATION 1996 MCS -51 PROGRAMMER S GUIDE AND INSTRUCTION SET CONTENTS PAGE MEMORY ORGANIZATION 1

More information

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution 1. (a) 1. (b) T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution Priority modes. 1) Fully Nested Mode : It is a general purpose mode. IR 0 highest priority IR 1 lowest

More information

CPEG300 Embedded System Design. Lecture 6 Interrupt System

CPEG300 Embedded System Design. Lecture 6 Interrupt System CPEG300 Embedded System Design Lecture 6 Interrupt System Hamad Bin Khalifa University, Spring 2018 Correction Lecture 3, page 18: Only direct addressing mode is allowed for pushing or popping the stack:

More information

UNIT IV MICROCONTROLLER

UNIT IV MICROCONTROLLER UNIT IV 8051- MICROCONTROLLER Prepared by R. Kavitha Page 1 Application Prepared by R. Kavitha Page 2 Pin Description of the 8051 UNIT IV- 8051 MICROCONTROLLER P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST

More information

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

ENE 334 Microprocessors

ENE 334 Microprocessors Page 1 ENE 334 Microprocessors Lecture 10: MCS-51: Logical and Arithmetic : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Logical & Arithmetic Page 2 Logical: Objectives

More information

The Final Word on 8051 Microcontroller

The Final Word on 8051 Microcontroller The Final Word on 8051 Microcontroller This is a book about the Intel 8051 microcontroller and its large family of descendants. It is intended to give you, the reader, some new techniques for optimizing

More information

UNIT MICROCONTROLLER AND ITS PROGRAMMING

UNIT MICROCONTROLLER AND ITS PROGRAMMING M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 UNIT-7 8051 MICROCONTROLLER AND ITS PROGRAMMING INTRODUCTION The microcontroller incorporates all the features that are found

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization Program Memory The 80C51 has separate address spaces for program and data memory. The Program memory can be up to 64k bytes long. The lower 4k

More information

Three criteria in Choosing a Microcontroller

Three criteria in Choosing a Microcontroller The 8051 Microcontroller architecture Contents: Introduction Block Diagram and Pin Description of the 8051 Registers Some Simple Instructions Structure of Assembly language and Running an 8051 program

More information

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000,

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000, 8051 TUTORIAL Donal Heffernan University of Limerick May-2002 8051 Tutorial D.Heffernan 2000, 2001 1 Blank 8051 Tutorial D.Heffernan 2000, 2001 2 Some reference material: Test books + MacKenzie Scott.

More information

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS EXAMINATION FOR 159.233 COMPUTER SYSTEMS Semester One June 2008 Time allowed: THREE (3) hours This exam contains THREE (3) questions ANSWER ALL THREE (3) QUESTIONS

More information

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary C51 Family Programmer s Guide and Instruction Set Summary 1. Memory Organization.................................................... I.3.2 1.1. Program Memory.......................................................................

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP 805 Microcontroller General Description The Digital Blocks Microcontroller Verilog IP Core is complaint with the MCS 5 Instruction Set and contains standard 805 MCU peripherals,

More information

Introduction To MCS-51

Introduction To MCS-51 Introduction To MCS-51 By Charoen Vongchumyen Department of Computer Engineering Faculty of Engineering KMITLadkrabang 8051 Hardware Basic Content Overview Architechture Memory map Register Interrupt Timer/Counter

More information

8051 Memory Organization BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter 1: Memory Organization There are 2 types of memories available in 8051 microcontroller. Program memory/c code memory (ROM)

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP 805 SFR Bus Digital Blocks Semiconductor IP 805 Microcontroller Configurable Peripherals General Description The Digital Blocks (Configurable Peripherals) Microcontroller Verilog IP Core is complaint with

More information

Fig 1. Block diagram of a microcomputer

Fig 1. Block diagram of a microcomputer MICRO CONTROLLERS www.bookspar.com VTU NOTES QUESTION PAPERS UNIT - 1 Computer: A computer is a multipurpose programmable machine that reads binary instructions from its memory, accepts binary data as

More information

8051 Microcontroller memory Organization and its Applications

8051 Microcontroller memory Organization and its Applications 8051 Microcontroller memory Organization and its Applications Memory mapping in 8051 ROM memory map in 8051 family 0000H 4k 0000H 8k 0000H 32k 0FFFH DS5000-32 8051 1FFFH 8752 7FFFH from Atmel Corporation

More information

Mod-3: Interrupts,Timer operation,serial communication 1

Mod-3: Interrupts,Timer operation,serial communication 1 Mod-3: Interrupts,Timer operation,serial communication 1 Module-3 Contents: Interrupts - interrupt sources - interrupt handling programming examples. Timers operation different modes waveform generation-

More information

8051 Microcontroller Interrupts

8051 Microcontroller Interrupts 8051 Microcontroller Interrupts There are five interrupt sources for the 8051, which means that they can recognize 5 different events that can interrupt regular program execution. Each interrupt can be

More information

8051 MICROCONTROLLER

8051 MICROCONTROLLER What is a Microcontroller? UNIT 5 8051 MICROCONTROLLER A Microcontroller is a programmable digital processor with necessary peripherals. Both microcontrollers and microprocessors are complex sequential

More information

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip. EXPERIMENT NO.1 AIM: Study of 8051 Microcontroller TOOLS: 8051 kit THEORY: Salient Features of 8051 A Microcontroller is a complete computer system built on a single chip. It contains all components like

More information

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU VRS540-4kB Flash, 28B RAM, 25~40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com P.3 P.2 XTAL NC P0./AD VRS540 Overview

More information

INTEGRATED CIRCUITS DATA SHEET. P89C738; P89C739 8-bit microcontrollers Dec 15. Product specification File under Integrated Circuits, IC20

INTEGRATED CIRCUITS DATA SHEET. P89C738; P89C739 8-bit microcontrollers Dec 15. Product specification File under Integrated Circuits, IC20 INTEGRATED CIRCUITS DATA SHEET File under Integrated Circuits, IC20 1997 Dec 15 CONTENTS 1 FEATURES 2 GENERAL DESCRIPTION 3 ORDERING INFORMATION 4 BLOCK DIAGRAM 5 FUNCTIONAL DIAGRAM 6 PINNING INFORMATION

More information

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-6kB Flash, 256B RAM, 40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com

More information

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system. Syllabus: : Introduction to, 8051 Microcontroller Architecture and an example of Microcontroller based stepper motor control system (only Block Diagram approach). (5 Hours) Introduction to A microcontroller

More information

Microcontroller and Embedded Systems:

Microcontroller and Embedded Systems: Microcontroller and Embedded Systems: Branches: 1. Electronics & Telecommunication Engineering 2. Electrical & Electronics Engineering Semester: 6 th Semester / 7 th Semester 1. Explain the differences

More information

Microcontroller and Applications

Microcontroller and Applications S.Y. Diploma : Sem. IV [DE/EJ/ET/EN/EX/EQ/IS/IC/IE] Microcontroller and Applications Time: 3 Hrs.] Prelim Question Paper Solution [Marks : 70 Q.1 Attempt any FIVE of the following : [10] Q.1(a) Define

More information

Q. Classify the instruction set of 8051 and list out the instructions in each type.

Q. Classify the instruction set of 8051 and list out the instructions in each type. INTRODUCTION Here is a list of the operands and their meanings: A - accumulator; Rn - is one of working registers (R0-R7) in the currently active RAM memory bank; Direct - is any 8-bit address register

More information

MICROPROCESSOR LABORATORY MANUAL

MICROPROCESSOR LABORATORY MANUAL MICROPROCESSOR LABORATORY MANUAL T.C. AYDIN ADNAN MENDERES UNIVERSITY ENGINEERING FACULTY ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT Prepared by: Res. Asst. Abdullah GÜLDEREN Aydın 2019 Contents 1.

More information

MICROPROCESSOR & MICROCONTROLLER

MICROPROCESSOR & MICROCONTROLLER a) From road north to East From road east to north From road south to west From road west to south From road west to north b) From road north to East From road south to west From road south to north From

More information

MSM80C154S MSM83C154S MSM85C154HVS USER'S MANUAL

MSM80C154S MSM83C154S MSM85C154HVS USER'S MANUAL MSM8C54S MSM83C54S MSM85C54HVS USER'S MANUAL Copyright 988, OKI ELECTRIC INDUSTRY COMPANY, LTD. OKI makes no warranty for the use of its products and assumes no responsibility for any errors which may

More information

DR bit RISC Microcontroller. Instructions set details ver 3.10

DR bit RISC Microcontroller. Instructions set details ver 3.10 DR80390 8-bit RISC Microcontroller Instructions set details ver 3.10 DR80390 Instructions set details - 2 - Contents 1. Overview 7 1.1. Document structure. 7 2. Instructions set brief 7 2.1. Instruction

More information

ET355 Microprocessors Thursday 6:00 pm 10:20 pm

ET355 Microprocessors Thursday 6:00 pm 10:20 pm ITT Technical Institute ET355 Microprocessors Thursday 6:00 pm 10:20 pm Unit 4 Chapter 6, pp. 139-174 Chapter 7, pp. 181-188 Unit 4 Objectives Lecture: BCD Programming Examples of the 805x Microprocessor

More information

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5 MICROCONTROLLER AND PLC LAB-436 SEMESTER-5 Exp:1 STUDY OF MICROCONTROLLER 8051 To study the microcontroller and familiarize the 8051microcontroller kit Theory:- A Microcontroller consists of a powerful

More information

SUMMER 13 EXAMINATION

SUMMER 13 EXAMINATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001-2005 Certified) Subject Code: 12187 SUMMER 13 EXAMINATION Model Answer Important Instructions to examiners: 1) The answers should

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP DB805C-FSM 805 Microcontroller FSM Finite State Machine General Description The Digital Blocks DB805C-FSM IP Core contains Digital Blocks compact DB805C CPU Core & GPIO

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 15, 2016 8051 INSTRUCTIONS JUMP, LOOP AND CALL INSTRUCTIONS 8051 INSTRUCTIONS Repeating a sequence of instructions

More information

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING CHAPTER 2 8051 ASSEMBLY LANGUAGE PROGRAMMING Registers Register are used to store information temporarily: A byte of data to be processed An address pointing to the data to be fetched The vast majority

More information

CPEG300 Embedded System Design. Lecture 3 Memory

CPEG300 Embedded System Design. Lecture 3 Memory CPEG300 Embedded System Design Lecture 3 Memory Hamad Bin Khalifa University, Spring 2018 Review Von Neumann vs. Harvard architecture? System on Board, system on chip? Generic Hardware Architecture of

More information

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts CoE3DJ4 Digital Systems Design Chapter 6: Interrupts Interrupts An interrupt is the occurrence of an event that causes a temporary suspension of a program while the condition is serviced by another program.

More information

TUTORIAL Assembly Language programming (2)

TUTORIAL Assembly Language programming (2) 8051 Assembly Language programming (2) TUTORIAL 4 EEE3410 Microcontroller Applications 1. Write the instructions to move value 34h into register A and value 3Fh into register B, then add them together.

More information

Dragonchip. Instruction Set Manual

Dragonchip. Instruction Set Manual Dragonchip Instruction Set Manual Version 3.1 July 2004 The Objective of this document is to provide the user a detail description to the each instruction set used in Dragonchip s MCU family. There are

More information

Handshake Solutions. HT80C51 User Manual

Handshake Solutions. HT80C51 User Manual HT8C5 User Manual HT8C5 User Manual Document Information Document Information Document Title Date of Creation 27/6/25 Date of last change 27/6/25 File name Status Version Number.7 Client / Target Audience

More information

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATION ENGINEERING QUESTION BANK

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATION ENGINEERING QUESTION BANK Course Name Course Code Class Branch INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad - 500 04 ELECTRONICS AND COMMUNICATION ENGINEERING QUESTION BANK : Microprocessors and Microcontrollers :

More information

Interrupt Programming: Interrupts vs. Polling Method:

Interrupt Programming: Interrupts vs. Polling Method: UNIT 4: INTERRUPT PROGRAMMING & SERIAL COMMUNICATION WITH 8051: Definition of an interrupt, types of interrupts, Timers and Counter programming with interrupts in assembly. 8051 Serial Communication: Data

More information

Y51 Microcontroller. Technical Manual

Y51 Microcontroller. Technical Manual Y51 Microcontroller Technical Manual Disclaimer Systemyde International Corporation reserves the right to make changes at any time, without notice, to improve design or performance and provide the best

More information

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote Programming Book1 8051 Microcontroller Kit Rev 3.0 January, 016 016 Wichit Sirichote 1 Contents Overview...3 SAFTY INFORMATION...3 Tools...3 Experiment 1 Blinking LED...4 Experiment Binary number counting...9

More information

Migrating from the 8XC251Sx to the 8XC251Tx

Migrating from the 8XC251Sx to the 8XC251Tx Migrating from the 8XC251Sx to the 8XC251Tx Application Note May 1999 Order Number: 273252-001 Information in this document is provided in connection with Intel products. No license, express or implied,

More information

Introducing The MCS 251 Microcontroller -- 8XC251SB

Introducing The MCS 251 Microcontroller -- 8XC251SB E AP- 708 APPLICATION NOTE Introducing The MCS 251 Microcontroller -- 8XC251SB YONG-YAP SOH TECHNICAL MARKETING EIGHT-BIT MICROCONTROLLERS February 1995 Order Number: 272670-001 Intel Corporation makes

More information

Preliminary W77E58 8 BIT MICROCONTROLLER. Table of Contents-- Publication Release Date: March Revision A1

Preliminary W77E58 8 BIT MICROCONTROLLER. Table of Contents-- Publication Release Date: March Revision A1 8 BIT MICROCONTROLLER Table of Contents-- GENERAL DESCRIPTION...2 FEATURES...2 PIN CONFIGURATION...3 PIN DESCRIPTION...4 BLOCK DIAGRAM...6 FUNCTIONAL DESCRIPTION...7 MEMORY ORGANIZATION...8 INSTRUCTION...29

More information

8051 Interrupt Organization

8051 Interrupt Organization Interrupt Interrupts of 8051 Introduction 8051 Interrupt organization Processing Interrupts Program Design Using Interrupts Timer Interrupts Serial Port Interrupts External Interrupts Interrupt Timings

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2011 Chapter

More information

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices.

3. (a) Explain the steps involved in the Interfacing of an I/O device (b) Explain various methods of interfacing of I/O devices. Code No: R05320202 Set No. 1 1. (a) Discuss the minimum mode memory control signals of 8086? (b) Explain the write cycle operation of the microprocessor with a neat timing diagram in maximum mode. [8+8]

More information

Chapter C2051 Architecture and Serial Communication Link

Chapter C2051 Architecture and Serial Communication Link Chapter- 2 89C2051 Architecture and Serial Communication Link ABSTRACT This chapter provides the details of 89C2051 microcontroller and description on Serial Communication Facility presented by 89C2051

More information

THE 8051 MICROCONTROLLER Simple comparison: Pentium vs. 8051

THE 8051 MICROCONTROLLER Simple comparison: Pentium vs. 8051 THE 8051 MICROCONTROLLER Simple comparison: Pentium vs. 8051 FEATURE 8051 PENTIUM COMMENT Clock Speed 12Mhz. typical 1,000 MHz. (1GHz.) but 60MHz. ICs available 8051 internally divides clock by 12 so for

More information

7.2.1 Timer 2 Capture LSB... 24

7.2.1 Timer 2 Capture LSB... 24 Data Sheet 8-BIT MICROCONTROLLER Table of Contents-. GENERAL DESCRIPTION... 3 2. FEATURES... 3 3. PIN CONFIGURATIONS... 4 4. PIN DESCRIPTION... 5 5. FUNCTIONAL DESCRIPTION... 6 6. MEMORY ORGANIZATION...

More information

UNIT MICROCONTROLLER

UNIT MICROCONTROLLER Page UNIT-5 805 MICROCONTROLLER INTRODUCTION The microcontroller incorporates all the features that are found in microprocessor. The microcontroller has built in ROM, RAM, Input Output ports, Serial Port,

More information