Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A 68000/68230 microcomputer-based microcomputer is required to drive the LEDs co

ID: 2085362 • Letter: A

Question

A 68000/68230 microcomputer-based microcomputer is required to drive the LEDs connected at bit 7 of ports A and B based on the input conditions set by switches connected at bit 0 of ports A and B. The VO conditions are as follows: If the input to bit 0 of port A is HIGH and the input to bit 0 of port B is low, then the LED connected to port A will be ON and the LED connected to port B will be OFF If the input to bit 0 of port A is LOW and that of port B is HIGH, then the LED of port A will be OFF and that of port B will be ON. If the bit 0 inputs of both ports A and B are the same (either both HIGH or both LOW), then both LEDs of ports A and B will be ON. Assume the pins and signal shown in the Figure below for the 68000 and 2764 (ODD and EVEN) Connect the chips and draw a neat schematic. Determine the memory map. Assume an 8-MHz internal clock on the 68000. Assume 200 ns access time for 2764.

Explanation / Answer

Answer:- The assembly code for led blink using switch is as follows-

PGCR EQU $800000 ; Port control register

PACR EQU $80000C ; Port A control register

PBCR EQU $80000E ; Port B control register

PADDR EQU $800004 ; Port A data direction register

PBDDR EQU $800006 ; Port B data direction register

PADR EQU $800010 : Port A data register

PBDR EQU $800012 ; Port B data rgister

ANDI.B #$3F, PGCR ; Select mode zero

BSET.B #7, PACR ; Port A bit i/o submode

BSET.B #7, PBCR ; Port B bit i/o submode

MOVE.B #$80, PADDR ; Port A pin7 as o/p and pin0 as i/p

MOVE.B #$80, PBDR ; Port B pin7 as o/p and pin0 as i/p

LOOP1: ; Label name LOOP1

MOVE.B PADR, D0 ; Read port A

ANDI.B #$1, D0 ; Check if bit 0 of port A is set

BEQ LED_ON1 ; Go to label LED_ON1

MOBE.B #$00, PADR ; Make led off

NEXT1: ; Label name NEXT1

MOVE.B PBDR, D0 ; Read port B

ANDI.B #$1, D0 ; Check if bit 0 is set

BEQ LED_ON2 ; Go to label LED_ON2

MOBE.B #$00, PBDR ; Make led off

NEXT2: ; Label name NEXT2

MOVE.B PADR, D1 ; read port A

CMPI.B D1, D0 ; compare D0 and D1

BEQ LED_ON12 ; If equal go to LED_ON12

LED_ON1:

MOVE.B #$80, PADR ; Led is on of port A

BRA NEXT1

LED_ON2:

MOVE.B #$80, PBDR ; Led is on of port B

BRA NEXT2

LED_ON12:

MOVE.B #$80, PADR ; Led on of port A

MOVE.B #$80, PBDR ; Led on of port B

BRA LOOP1

END

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote