3. the mc6802 microprocessoryildiz.edu.tr/~sedef/verdigi dersler_files/6802 mikroislemcisi.pdf3. the...

31
1 3. The MC6802 MICROPROCESSOR This chapter provides hardware detail on the Motorola MC6802 microprocessor to enable the reader to use of this microprocessor. It is important to learn the operation and interfacing of the MC6802 microprocessor first. Once you learn MC6802, transition to the other microprocessors (i.e. 6809, 68000, 8080, 8085A, 8086) or to the microcontrollers (i.e. 68HC08, 68HC11, 8051 AT89C51, AT89C52, PIC16F877) manufactured by any of the IC houses is easy.

Upload: dokiet

Post on 02-Apr-2018

222 views

Category:

Documents


3 download

TRANSCRIPT

1

3. The MC6802 MICROPROCESSOR

• This chapter provides hardware detail on the Motorola MC6802microprocessor to enable the reader to use of this microprocessor.

• It is important to learn the operation and interfacing of the

MC6802 microprocessor first.

• Once you learn MC6802, transition to the other microprocessors

(i.e. 6809, 68000, 8080, 8085A, 8086)

or to the microcontrollers

(i.e. 68HC08, 68HC11, 8051 AT89C51, AT89C52, PIC16F877)

manufactured by any of the IC houses is easy.

2

The MC6802 MICROPROCESSOR

3.1 Pin Diagrams and Features

Pin Diagrams:

• Figure 3-1 illustrates the MC6802 microprocessor package and pindiagram.

• The MC6802 is packaged in 40-pin dual in-line package (DIP).

• This device operate from a single 5V supply.

(VCC=+5V, VSS=0V or GND)

• Power dissipation of MC6802 is less than 1.5 W.

3

The MC6802 MICROPROCESSOR

FIGURE 3-1 Package and pin diagram of the Motorola MC6802 microprocessor

4

The MC6802 MICROPROCESSOR

• Features:

1. On-chip clock circuit

2. 128x8 bit (128 byte) on-chip RAM (00 to 7FH)

3. 32 bytes of RAM are retainable (00H to 1FH)

4. Software-compatible with the MC6800

5. Standard TTL-compatible inputs and outputs

6. 8-bit word size

7. 16-bit memory addressing

8. Interrupt capability

5

The MC6802 MICROPROCESSOR

3.2 Bus and Control Signals

Proper operation of the MPU requires that certain control and timingsignals be provided to accomplish specific functions and the other signallines be monitored to determine the state of the processor.

• Busses:Address Bus (A0..A15), Data Bus (D0..D7)

• Bus Control Signals:Enable (E), Valid Memory Address (VMA), Read/Write (R/W)

• MPU Control Signals:Reset (RESET), Halt (HALT), Interrupt Request (IRQ),Non-Maskable Interrupt (NMI), Memory Ready (MR).

6

The MC6802 MICROPROCESSOR

FIGURE 3-2 Bus and control signals of the MC6802 microprocessor

7

The MC6802 MICROPROCESSOR

1) Address Bus (A0-A15)

• Sixteen pins are used for the address bus.

• The outputs are capable of driving one standard TTL load and 90pF.

• These lines do not have three-state capability.

8

The MC6802 MICROPROCESSOR

2) Data Bus (D0-D7)

• Eight pins are used for the data bus.

• It is bidirectional, transferring data to and from the memory andperipheral devices.

• It also has three-state output buffers capable of driving one standardTTL load and 130 pF.

• Data bus will be in the output mode when the internal RAM is accessedand RE will be high. This prohibits external data entering the MPU.

• External RAM at 0000H to 007FH must be disabled when internal RAM isaccessed. It should be noted that the internal RAM is fully decoded from0000H to 007FH.

9

The MC6802 MICROPROCESSOR

3) Halt (HALT)

• When this input is in the low state, all activity in the machine will behalted.

• This input is level sensitive.

• In the HALT mode, the machine will stop at the end of an instruction,bus available will be at a high state (BA=1),valid memory address will be at a low state (VMA=0).The address bus will display the address of the next instruction.

• HALT should be tied high if not used.

10

The MC6802 MICROPROCESSOR

4) Read/Write (R/W)

• This TTL-compatible output signals indicate to the peripherals andmemory devices that whether the MPU is in a read (high) or write (low)state.

• The normal standby state of this signal is read (high).

• When the processor is halted, it will be in the read state.

• This output is capable of driving one standard TTL load and 90 pF.

11

The MC6802 MICROPROCESSOR

5) Valid Memory Address (VMA)

• This output indicates to peripheral devices that there is a valid addresson the address bus.

• In normal operation, this signal should be utilized for enablingperipheral interfaces such as the PIA (6821) and ACIA (6850).

• This signal is not three-state.

• One standard TTL load and 90 pF may be directly driven by this activehigh signal.

12

The MC6802 MICROPROCESSOR

6) Bus Available (BA)

• The bus available signal will normally be in the low state;when activated, it will go to the high state indicating that themicroprocessor has stopped and that the address bus is available(but not in a three-state condition).

• This will occur if the HALT line is in the low state or the processor is inthe WAIT state as a result of the execution of a WAIT instruction.

• At such time, all three-state output drivers will go to their off-state andother outputs to their normally inactive level.

• The processor is removed from the WAIT state by the occurrence of amaskable (mask bit I=0) or nonmaskable interrupts.

• This output is capable of driving one standard TTL load and 30 pF.

13

The MC6802 MICROPROCESSOR

7) Ram Enable (RE)

• A TTL compatible RAM enable input controls the on-chip RAM of the

MC 6802.

• When placed in the high state, the on-chip memory is enabled torespond to the MPU controls.

• In the low state, RAM is disabled.

14

The MC6802 MICROPROCESSOR

8) Enable (E)

• This signal is used to enable the memory or I/O device.

• This pin supplies the clock for the MPU and the rest of the system.

• This is a single phase TTL-compatible clock.

• This clock may be conditioned by a memory read signal.

• This output is capable of driving one standard TTL load and 130 pF.

The MC6802 MICROPROCESSOR

The MC6802 Bus Timing

16

The MC6802 MICROPROCESSOR

17

The MC6802 MICROPROCESSOR

18

The MC6802 MICROPROCESSOR

9) Crystal Connection Inputs (EXTAL, XTAL)

• These inputs are used for the internal oscillator that may be crystalcontrolled.

• These connections are for a parallel resonant fundamental crystal (seefigure 3-3).

• A divide-by-four circuit has been added so a 4 MHz crystal may be usedin lieu of a 1 MHz crystal for a most cost-effective system.

19

The MC6802 MICROPROCESSOR

FIGURE 3-3 Crystal specifications

20

The MC6802 MICROPROCESSOR

10) Memory Ready (MR)

• MR is a TTL-compatible input signal controlling the stretching of E.

• When MR is high, E will be in normal operation.

• When MR is low, E will be stretched integral numbers of half periods,thus allowing interface to slow memories.

• MR should be tied high (connected directly to VCC) if not used.

21

The MC6802 MICROPROCESSOR

11) VCC Standby

• This pin supplies the dc voltage to the first 32 bytes of RAM as well asthe RAM Enable (RE) control logic.

• Thus, retention of data in this portion of the RAM on a power-up, power-down, or standby condition is guaranteed.

22

The MC6802 MICROPROCESSOR

12) Interrupt Request (IRQ)

• A low level on this input requests that an interrupt sequence begenerated within the machine.

• The processor will wait until it completes the current instruction at isbeing executed before it recognizes the request.

• At that time, if the interrupt mask bit in the condition code register isnot set (I=0), the machine will begin an interrupt sequence.

23

The MC6802 MICROPROCESSOR

IRQ sequences:

1) The index register (X), program counter (PC), accumulators (A, B)and condition code register (CCR) are stored away on the stack.

2) Next the MPU will respond to the interrupt request by setting theinterrupt mask bit high (I=1) so that no further interrupts may occur.

3) At the end of the cycle, a 16-bit vectoring address, which is locatedin memory locations FFF8H and FFF9H is loaded which causes the MPUto branch to an interrupt routine in memory.

24

The MC6802 MICROPROCESSOR

NOTEs:

1) The HALT line must be in the high state for interrupts to beserviced.

2) Interrupts will be latched internally while HALT is low.

3) A nominal 3 k (or 3.3k standard ) pullup resistor to VCC should beused for wire-OR and optimum control of interrupts.

4) IRQ may be tied directly to VCC If not used.

25

The MC6802 MICROPROCESSOR

13) Reset (RESET)

• This input is used to reset and start the MPU from a power-downcondition, resulting from a power failure or an initial start-up of theprocessor.

• When this line is low, the MPU is inactive and the information in theregisters will be lost.

• If a high level is detected on the input, this will signal the MPU to beginthe restart sequence.

This will start execution of a routine to initialize the processor from itsreset condition.

26

The MC6802 MICROPROCESSOR

NOTEs:

1) All the higher order address lines will be forced high.

2) For the restart, the last two (FFFEH, FFFFH) locations in memory willbe used to load the program that is addressed by the program counter.

3) During the restart routine,the interrupt mask bit in the Conditon Code Register (CCR) is set (I=1)andmust be reset (I=0) before the MPU can be interrupted by (IRQ).

Power-up and reset timing are shown in figure 3-4.

27

The MC6802 MICROPROCESSOR

Figure 3-4 Power-up and reset timing

28

The MC6802 MICROPROCESSOR

14) Non-Maskable Interrupt (NMI)

• A low-going edge on this input requests that a non-maskable interruptsequence be generated within the processor.

• As with the interrupt request signal, the processor will complete thecurrent instruction that, is being executed before it recognizes the NMIsignal.

• The interrupt mask bit in the condition code register has no effect onthe NMI.

29

The MC6802 MICROPROCESSOR

• The index register (X), program counter (PC), accumulators (A, B), andcondition code registers (CCR) are stored away on the stack.

• At the end of the cycle, a 16-bit vectoring address which is located inmemory locations FFFCH and FFFDH is loaded causing the MPU tobranch to an interrupt service routine in memory.

• A nominal 3 k pullup resistor to VCC should be used for wire-OR andoptimum control of interrupts.

• NMI may be tied directly to VCC if not used.

30

The MC6802 MICROPROCESSOR

• Inputs IRQ and NMI are hardware interrupt lines that are sampledwhen E is high (E=1)and will start the interrupt routine on a low E (E=0)following the completion of an instruction.

• Figure 3-5 is a flowchart describing the major decision paths andinterrupt vectors of the microprocessor.

31

The MC6802 MICROPROCESSOR

Figure 3-5 Flowchart and vector table of the MC6802 MPU