Question: Please help me . I am unsure why my code is not working. Please do assembly code. My code is pictered below. XREF KeyPad, ReadIn

Please help me. I am unsure why my code is not working. Please do assembly code. My code is pictered below.
XREF KeyPad, ReadIn
XDEF sety
\table[[sety:,Idy #4000,: 1000 microsec],[delay: dey,:decrement y,],[,cpy #0,: compare with 0],[bne delay,if not 0 go back and continue,],[RTS,: return to KeyFad if done,]]
KREF keypadseq, sety, port,u, lookup. read-u., ton KDEF loadx
loadz: 1dz #keypadseq ; calling the keypadsequence to access each rom
KeyPad:
ldaa 1,zt
cmpa #0
beq reset
staa port_u
jsr sety
BRA ReadIn
getting ready to go through the sequence
checking to see if end of sequence
; if end of sequence
storing result
ReadIn:
1Hab port_u
stab read_u
andb #$0F ; ignore the upjer nibble
cmpb #$0F
beq KeyPad ; continue to next row
1dy # lookup
1dab #0
bra KeyFress ; go ot look through table if there 13 a key press
reset: 1dx #keypadseq
bra KeyPad ; resets the whole sequence
KeyPress:
ldaa port-u : load b iwth the old value of hte port u
cmpa #$0F
bne KeyPress process again if pressed
bra process
process: Idaa 1.y+; this gets the look table too look at
cmpa read_u
beq finish
inch
cmpb #$10
beq finish
hra process
finish:
stab ton : keep the key pressed value
Its ireturn to stack
Laboratory 7.2: PWM, DC Motor Control using Real Time Interrupts.
The objective of this experiment is to write an assembly program that implements PWM to control the speed of the DC Motor on the I/O board in the lab. Instead of using delay loops and polling to implement the PWM strategy, as in Lab 4.1, RTIs will be used. In the main program and the linker parameter file, initialize interrupts by using the information in the background section above. Select an RTI interval of 4ms.
The unaltered keypad subroutine from Lab 5.2 should be called in the main program. It is okay to calculate ton and toff in the main program, but delay loops are not to be used to control the PWM signal.
The simplest way to complete this lab is to define a byte variable to use as a counter and initialize it to zero. In the interrupt routine, do the following:
Increment the count. If the count is less than or equal to t0n, set bit 3 of Port T and exit the interrupt service routine.
Else, if the count is greater than t0n, but less than or equal to 15, clear bit 3 of Port T and exit the interrupt service routine.
Else, if the count is greater than 15, clear the count and exit the interrupt service routine.
Please help me . I am unsure why my code is not

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!