Part I: Assembly Programming Requirement : You must demo your program on a Drago
ID: 3839966 • Letter: P
Question
Part I: Assembly Programming
Requirement: You must demo your program on a Dragon12-Light board.
Goal: To become familiar with using XIRQ hardware interrupt, writing your own interrupt service routines, setting up interrupt service routines and using Dragon12-Light boards and improving your programming skills.
Project:
-To enable XIRQ interrupt, modify the main program: replace the codes for enabling IRQ interrupt by code to enable XIRQ interrupt.
-Change the service routine name from IRQ_ISR to XIRQ_ISR.
-Set up your XIRQ interrupt vector accordingly. For setting up interrupt service routine in C, please study Example 11-15 of your textbook.
-Modify the XIRQ_ISR service routine to do the following: When a momentary active-low signal is sent to XIRQ pin, it generates XIRQ interrupt. Your XIRQ interrupt service routine will be called, which turns on all the even LEDs. Let them stay on for one second by calling a one second delay subroutine. After finishing handling the interrupts, the main program should just turn off all LEDs. When another momentary active-low signal is sent to XIRQ pin, it generates XIRQ interrupt again. Your XIRQ interrupt service routine will be called, which should turn on all the odd LEDs. Let them stay on for one second by calling the same delay subroutine. After finishing handling the interrupts, the main program should just turn off all LEDs. If active-low signal is provided continuously at XIRQ pin, then your XIRQ service routine should continuously toggle even/odd LEDs in one Hz frequency.
-After finishing handling the interrupts, the main program should just turn off all LEDs.
Part II: C Programming: Second part is same instructions except written in C language
XIRQ program
;*****************************************************************
; export symbols
;*****************************************************************
;For absolute assembly: this is the application entry point
ABSENTRY Main
;*****************************************************************
; Include derivative-specific definitions
;*****************************************************************
;The microcontroller chip used by Dragon12-Light boards
INCLUDE 'mc9s12dg256.inc'
;*****************************************************************
; Symbolic constant(EQU) section
;*****************************************************************
DATA EQU RAMStart ;use $1000 - $1FFF for data
STACK EQU RAMEnd+1 ;use $2000 - $3FFF for stack
CODE EQU $4000 ;use flash ROM $4000 - $7FFF for code
;*****************************************************************
; Data section
;*****************************************************************
ORG DATA
;*****************************************************************
; Main program section
;*****************************************************************
ORG CODE
Main:
LDS #STACK ;initialize Stack Pointer SP
LDAA #%00000000
STAA DDRE ;make PE1 an input pin
JSR InitLEDs
LDAA #%01000000
STAA INTCR ;enable low-level triggering
;enable IRQ pin interrupt
CLI ;clear the mask
Loop
LDAA #$81
STAA PORTB ;turn on LED0 and LED7 continously.
BRA Loop
;*****************************************************************
; Subroutine section
;*****************************************************************
InitLEDs
;LEDs are connected to PORTB on Dragon12-Light
LDAA #$FF
STAA DDRB ;make PORTB as Output port
;PTP0, PTP1, PTP2 and PTP3 of port P control the 4 units of the seven seg. display
;GRB LED is controlled by PTP4-PTP6: PTP4=1, red; PTP5=1, green; PTP6=1, blue
LDAA #$FF
STAA DDRP ;make PTP output port
LDAA #$2F ;make PTP0-PTP3 high to disable the seven seg. dispaly,
STAA PTP ;and make PTP5 high to turn on green RGB LED
RTS
;*****************************************************************
; Interrupt service routine
;*****************************************************************
IRQ_ISR
LDAA #$FF
STAA PORTB
RTI
;*****************************************************************
; Interrupt Vectors
;*****************************************************************
ORG $FFF2
DC.W IRQ_ISR ;set up IRQ interrupt vector
ORG $FFFE
DC.W Main ;set up Reset Vector
Explanation / Answer
2. The two key types of decisions that have to be considered while deciding on the organization of a firm’s management structure are: (i) The first decision is regarding breaking complex organizational structures into smaller pieces that are more manageable. This is an important decision and will have to be considered as it can ensure clarity in roles and responsibilities. (ii) The second decision that needs to be considered is whether the new structure can create accountability for decisions that directly affect customers. This will help in retaining customers.
3. The advantage of management overlay is that it makes effective decision making easier. Valuable expertise is introduced during overlays and usually overlays can be used appropriately during situations where a reduction in the number of decision nodes is required. This reduction along with a parallel decision making authority will make the process more streamlined.
4. If management responsibilities are defined too broad then it will not be easy to make quick and effective decisions. Execution and implementation will be negatively impacted and this will affect the entire organization negatively. It can result in decreased efficiency and an increase in costs.
On the other hand if the management responsibilities are defined too narrow it will make them less accountable.
5. When changing structure it is important to recognize that reorganizations are not vital determinants of financial performance of an organization. What needs to changed is the ability of the organization to make decisions that are faster and more effective.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.