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
tablesety:Idy #: microsecdelay: dey,:decrement cpy #: compare with bne delay,if not go back and continue,RTS: return to KeyFad if done,
KREF keypadseq, sety, port,u lookup. readu ton KDEF loadx
loadz: #keypadseq ; calling the keypadsequence to access each rom
KeyPad:
ldaa
cmpa #
beq reset
staa portu
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:
Hab portu
stab readu
andb #$F ; ignore the upjer nibble
cmpb #$F
beq KeyPad ; continue to next row
# lookup
dab #
bra KeyFress ; go ot look through table if there a key press
reset: #keypadseq
bra KeyPad ; resets the whole sequence
KeyPress:
ldaa portu : load b iwth the old value of hte port
cmpa #$F
bne KeyPress process again if pressed
bra process
process: Idaa ; this gets the look table too look at
cmpa readu
beq finish
inch
cmpb #$
beq finish
hra process
finish:
stab ton : keep the key pressed value
Its ireturn to stack
Laboratory : 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 IO board in the lab. Instead of using delay loops and polling to implement the PWM strategy, as in Lab 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
The unaltered keypad subroutine from Lab should be called in the main program. It is okay to calculate and 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 set bit of Port and exit the interrupt service routine.
Else, if the count is greater than but less than or equal to clear bit of Port and exit the interrupt service routine.
Else, if the count is greater than clear the count and exit the interrupt service routine.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
