Question

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


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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

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   

Add a comment
Know the answer?
Add Answer to:
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
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am writing a program in c programming and it is supposed to do the following using mc9s12dg256.h microcontroller When...

    I am writing a program in c programming and it is supposed to do the following using mc9s12dg256.h microcontroller When both DIP switches #8 and #1 are high, turn on all LEDS. When both DIP switches #8 and #1 are low, turn off all LEDs When DIP switch #8 is high and #1 is low, turn on all the even numbered LEDs. When DIP switch #1 is high and #8 is low, turn on all the odd numbered LEDs. Your...

  • 4. A CMOS port output is modelled as shown in Figure 3.4(b). It is powered from...

    4. A CMOS port output is modelled as shown in Figure 3.4(b). It is powered from 5V. The value of RS(high) is estimated to be 120 U and the value of RS(low) 70 U. One port pin will light an LED when it is at Logic 1, and another will light an LED when it is at Logic 0. An LED current of 4 mA is required; for this the LEDs have a forward voltage of 1.8 V. Sketch a...

  • You are to create a new application that will execute on your Arduino platform based upon...

    You are to create a new application that will execute on your Arduino platform based upon the Blink example that is available in the Arduino Examples folder that you downloaded as part of the IDE. Your application will use a toggle switch to interface with the user. The application will operate by controlling the LEDs based upon the position of the toggle switch. If the user moves the LEDs until new user input is provided. When the user moves the...

  • I need help with doing these tasks for code composer Lab 3 - Branching, Push Button...

    I need help with doing these tasks for code composer Lab 3 - Branching, Push Button and LEDs-Reading Assignment in this lab, we are going to control a LED via a push button- using general purpose digital 10 for both input (button) and output (LED) on port 1 - using Code Composer Studio. Furthermore, we are going to use a branch instruction to create an IF-ELSE structure in assembly to determine if the LED should be lit up based on...

  • Can someone please show me a circuit diagram so i can see how to construct this...

    Can someone please show me a circuit diagram so i can see how to construct this on a bread board i am id 6 yhanks in advance EEET-2251: Course & Projoct Guide 2018 EEET-2251: Cousc &Projoct Guide 2018 affic Light Controller A single switch must set your HC74 based state machine to the initial state (the U state This lab will get you to design a simple controller for a pedestrian crossing based on synchronous digital logic. You will master...

  • i posted device what i use Introduction Project 1 is designed to increase famiarty with Amel Studia, the Atmel So...

    i posted device what i use Introduction Project 1 is designed to increase famiarty with Amel Studia, the Atmel Software Framework, and te N ELVIS Il electrical test and measurement บnten. In addeen, it as LEDs vd pushbumons (overs concepts such as de-bouncing pushb.nors, ล"d sina ig and sorong with a microcontroler Materials 1 SAMD21 or SAMN25 Xpuined Pro Evaluation Board 2 LED 3300 resistor 4) 10k resistor S Push buttorn hamper wees Breadboar 8 SAMD21 Datasheet Equipment NI ELVIS...

  • I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED str...

    I am doing an Arduino Uno project where I made a "Simon says" memory game with 3 neopixel LED strips and 3 - ultrasonics. I have them working independently but I need to combine the code so they work together. Here is what I have: Memory Game #define PLAYER_WAIT_TIME 2000 // The time allowed between button presses - 2s byte sequence[100]; // Storage for the light sequence byte curLen = 0; // Current length of the sequence byte inputCount =...

  • Questions 4-20. Questions 4-20. QUESTION 4 the output becomes The longer a signal is applied to...

    Questions 4-20. Questions 4-20. QUESTION 4 the output becomes The longer a signal is applied to the input of an integrator op amp, the a smaller b. larger QUESTION 5 the output becomes. The faster the voltage applied to the input of a differentiator changes, the a smaller . b. larger QUESTION 6 voltage than for a negative-going signal. A Schmitt trigger switching threshold for a positive-going input signal is at a a lesser . b.greater QUESTION 7 If a...

  • For this lab you will write a Java program that plays the dice game High-Low. In...

    For this lab you will write a Java program that plays the dice game High-Low. In this game a player places a bet on whether the sum of two dice will come up High (totaling 8 or higher), Low (totaling 6 or less) or Sevens (totaling exactly 7). If the player wins, they receive a payout based on the schedule given in the table below: Choice Payout ------ ------ High 1 x Wager Low 1 x Wager Sevens 4 x...

  • Java Program Note: no break statements or switch staements High, Low, Sevens For this lab you...

    Java Program Note: no break statements or switch staements High, Low, Sevens For this lab you will write a Java program that plays the dice game High-Low. In this game a player places a bet on whether the sum of two dice will come up High (totaling 8 or higher), Low (totaling 6 or less) or Sevens (totaling exactly 7). If the player wins, they receive a payout based on the schedule given in the table below: Choice Payout ------...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT