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

home / study / science / advanced physics / questions and answers / goal: to bec

ID: 3839319 • Letter: H

Question

home / study / science / advanced physics / questions and answers / goal: to become familiar with using port a and ...

Your question has expired and been refunded.

We were unable to find a Chegg Expert to answer your question.

Question: Goal: To become familiar with using Port A and Por...

Bookmark

Goal: To become familiar with using Port A and Port H as input ports H as an input port and port B as an output port, using dragon12-Light boards as well as to improve your programming skills.

Project: Write an assembly program and a C program to do the following:

When DIP switch #8 is high and #1 is low, turn on all the even numbered LEDs and let them stay on even after the switch #8 is changed to low.

When DIP switch #1 is high and #8 is low, turn on all the odd numbered LEDs and let them stay on even after the switch #1 is changed to low.

When both DIP switches #8 and #1 are high, turn on all LEDS. Afterwards, if one of the two is changed to low, turn off the corresponding even or odd LEDs.

Once LEDS are on, the only way to turn them off is to make the PA0 pin HIGH. LEDs will continue to be off as long as PA0 pin is HIGH. LEDs will be on/off according to the switches when PA0 pin becomes low again.

Your program must monitor PA0 and DIP switches continuously until a Reset.

Note 1: The DIP switches on the boards are numbered 12345678 for bits 76543210.

Note 2: DIP switches are connected to port H, and LEDs are connected to port B.

Explanation / Answer

I have designed the Assembly program which gives you an detailed information about the describes about the dragon12-Light board using PORTA and PORTB. I have included the comments for each part of the code and atatched the final output.

Let me explain you in simpler and step-by-step procedure:-

Step-1:

The initial step is to operate the Dragon-12 Light board,So the first step is to plug the AC adapter input to a wall outlet and plug the desired DC plug on the other side of the DC jack of the board.

Example:-

In Dragon-12 board, The two DIP switches should be at the low positions, so the EVB mode LED is lit.

Step-2:

The next step is to keep the DB9 male plug of the cable into the DB9 connectors P1 which should be placed at the upper side of the board and DB9 female should end up near the COM1 or COM2 port in the respective PC,

Example:-

In Dragon-12 board,The DB9 connector P2 should be placed on the lower left side of the board.

Step-3:

Following this, The value of PB7-PB0 LEDs in the Dragon-12 should press the reset button/ Press the reset button on the DRAGON12 board, and the should chase from left to right.

Example:-

In Dragon-12 board,The Reset button is present from the left to right of the board.

Step-4:

The final step is to make use of three commands which is required to run the ASMIDE from the respective 68hc12 for developing the work scenario.

Example:-

In Dragon-12 board, At the bottom end, click on the terminal button to open the window display.

Assembly C Program:-

; This is an entry point of the Dragon-12 board
ABSENTRY Entry   

; The xs95DS381 is the cpu address of the board
  
       INCLUDE 'xs95DS381.inc'   

; This are the registers present in ports

R0 EQU $1000
R1 EQU $1001
R2 EQU $1002


ORG $5000   
Entry:
   LDS #$5000
BSET DDRE,%01001001

; This will turn off / on using the PORT

BACK BSET PORTE,%01001001
   JSR DELAY
   BCLR PORTE,%01001001
   JSR DELAY
  
   BRA BACK   
  
; It will call the delay method
  
DELAY

PSHA      
LDAA #200  
STAA R2      

L3 LDAA #05
STAA R1
L2 LDAA #170
STAA R0
L1 NOP   
NOP   
NOP   
DEC R0
BNE L1
DEC R1
BNE L2
DEC R2
BNE L3

PULA          
RTS

ORG $FFFE
DC.W Entry