Question: Write an assembly language program to turn the stepper motor. The stepper motor is connected to Port P ( at address $ 2 5 8
Write an assembly language program to turn the stepper motor.
The stepper motor is connected to Port P at address $ Set bits through of the DDR of Port P located at address $A Do not set bits and as setting these bits may produce unexpected results. Output the following sequence to Port to turn the motor clockwise:
tableBit #value
cannot write to this bit. Writing to these bits may produce undesired results.
don't care.
This sequence will cause the motor to step four times. Sending the sequence in reverse order will the motor to turn in the reverse direction.
As in the previous procedures, use an index register to point to the first element of the sequence and step through the array. When the endwhich of the sequence is reached, the pointer will need to be set back to the beginning of the array. Delay milliseconds between each step using a loop delay. Make the delay loop a separate subroutine from the loop that sends the values of the sequence to Port P SAVE THIS PROGRAM! Later, direction and speed control will be added The program should run in a continuous loop.
Freescale Codellarrior for the HC Progran direct
INCLUDE 'derivative. inc'
XDEF Entry
XREF SEGENDSSTACK
MYEXTENDEDRAM: SECTION
vaI : dsb
MYCONSTANTROM: SECTION
ports: equ $
ddrs: equ $
HyCode: SECTION
Entry:
I
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
