Question: Laboratory 3 . 3 : Stepper MotorWrite an assembly language program to turn the stepper motor.The stepper motor is connected to Port P ( at

Laboratory 3.3: Stepper MotorWrite an assembly language program to turn the stepper motor.The stepper motor is connected to Port P (at address $258). Set bits 1 through 4 of the DDR of Port P (located at address $25A). Do not set bits 0 and 5-7, as setting these bits may produce unexpected results. Output the following sequence to Port P to turn the motor clockwise:Bit #76543210 valuex x d 0101 d OxOAxx d 1001 d 0x12xx d 1010 d 0x14x x d 0110 d 0x0Cx= cannot write to this bit. Writing to these bits may produce undesired results.d = don't care.This sequence will cause the motor to step four times. Sending the sequence in reverse order will cause 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 30 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.

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 Databases Questions!