SPONSORED LINKS
 
 
Google
 
SOLVED EXAMPLES
 SOLVED EXAMPLES

Q. 1: Can the ports P0 and P2 be used for I/O when using external memory? Explain.

Ans: No. The output drivers of ports 0 and 2, and the input buffers of Port 0, are used to access external memory. Port 0 outputs the low byte of the external memory address, time multiplexed with the byte being read/written. Port 2 outputs the high byte of the external memory address when the address is 16 bits wide. Otherwise, the P2 SFR contents available at the port 2 pins. Therefore, when external memory is being used, ports 0 and 2 are unavailable for their primary use as general I/O lines.

Q. 2: Is there anything one can do to use these ports for I/O when using external memory? 

Ans: Normally ports PO, PI, P2,P3 can not be used for I/O, But in some cases it can be used. For example, one can use port 2 for output, when PSEN ,RD and WR are all inactive. The chip will emit the contents of the P2 SFR at that time. Because the contents of the SFR latch for port 2 are not modified during the execution of a Data Memory fetch cycle on the Expanded Bus. If an instruction requiring a cycle on the Expanded Bus is not followed by another instruction requiring a cycle on the Expanded Bus, then the original content of the port 2 SFR latch will appear during the next machine cycle.

Q. 3: Port 0 has open drain outputs. Ports 1, 2, and 3 have internal pull-ups. What does this mean?

Ans: When used as outputs, all port pins will drive the state to which the associated SFR latch bit has been set. Except for port 0, which will only drive low (not high ). When a 0 is written to a bit in port 0, the pin is pulled low (0). But, when a 1 is written to a bit in port 0, the pin goes into a high impedance state-or in other words, "disconnected", no value.

To be able to get a 1 as output, an external pull up resistor are needed to pull up the port (to + 5V, or 1) when the port is in its high impedence state. Typical values for pull-ups might be 470 ohm to drive a LED, and 4.7K or higher to drive logic circuits. (Any port pin may be used as a general purpose input simply by writing a 1 into the associated SFR latch bit. Since ports 1, 2, and 3 have internal pull-up devices they will pull high and will source current when pulled low. When a port 0 bit is programmed for input (set to 1) it will go to a high impedance state.)

Q. 4: Why is such an "odd" crystal frequency of 11.0592 MHz used so often for 8051 designs. 

Ans: When Timer 1 is used as the baud rate generator, the baud rates in Modes 1 and 3 are determined by the Timer 1 overflow rate and the value of SMOD (PCON.7 - double speed baud rates) as follows: .

2Smod
Baud rate = 32 (Timer 1 overflow rate)
Most typically, the timer is configured in the auto-reload mode (mode 2, high nibble of TMOD = 01000B). In this case, the baud rate is given as:
2smod Oscillator frequency
Baud rate = 32 x 12 x (265 - TH1

Some typical baud rates for an 11.0592 crystal:

Baud rate SMOD THI
19200 1 OFDH
9600 0 OFDH
4800 0 OFAH
2400 0 OF4H
1200 0 OE8H
300 0 OAOH

Q. 5: The Intel MCS-51 assembly language defines alternate symbols ARO... AR7 for registers R0... R7. What is this good for?

Ans: Some 8051 instructions do not support all possible addressing modes. For example, the PUSH and POP instructions are only available with direct addressing. Since the registers R0.R7 are mapped into the internal memory, they must also have a DATA (= direct) address. The special assembler symbols AR0 ... AR7 are simply the absolute DATA addresses of registers R0.R7.
Although there is no instruction PUSH R5 with true register addressing, you can do it with PUSH AR5 (= direct addressing).

PROBLEMS

  1. Name three features of the 8051.
  2. What is the major difference between the 8051 and 8052 microcontrollers? 
  3. Give the size of RAM in 8051,8052 and 8031.
  4. Give the size of the on chip ROM in 8051, 8052 and 8031.
  5. What are the different power-saving modes of 8051?
  6. Differentiate them.
  7. Which port has no alternate functions.
  8. What component are normally put together with the microcontroller into a single chip? 
  9. Name registers that can do division.
  10. Find the baud rate for the serial port in mode 0 for a 6 megahertz crystal.
  11. Why a low-address byte latch for external memory is needed.
  12. Find the largest possible time delay for a timer in model if a12 megahertz crystal is used.
  13. What is a SFR? Can you identify the bit addressable SFRs from their addresses?
  14. In choosing a microcontroller, how important is it to have a multiple source for that chip?
  15. Find the time a timer in mode 1 to overflow if initially set to 03Aeh with a 6 megahertz crystal.
  16. If a microcontroller architecture has both 8-bit and 16-bit versions, which of the following statement is true.

(a) The 8-bit software will run on the 16-bit system.
(b) The 16-bit software will run on the 8-bit system.

  1. List the different addressing modes used in 8051 with one example for each.
  2. With a diagram, show the memory mapping of 8051.
  3. Write short notes on the following:
  •  Boolean Processor
  •  Interrupts
  • Serial data communication


True or False

  • A general-purpose microprocessor has on-chip ROM.
  • A microcontroller has on-chip ROM.
  • A microcontroller has on-chip I/O ports.
  • A microcontroller has a fixed amount of RAM on the chip.

Fill in the blanks

  1. The 8051 is a__________-bit microprocessor.
  2. The 8751 has bytes of on-chip ROM.
  3. The 8051 has_________on-chip timers.
  4. The 8052 has_________ bytes of on-chip RAM.
  5. The ROMless version of the 8051 uses _______as the part number
  6. The 8051 family has_________pins for I/O.
  7. The 8051 family has circuitry to support_____________serial ports.
  8. The 8751 on-chip ROM is of type______________
BACK
SPONSORED LINKS