Write an assembly language program to turn the stepper


Write an assembly language program to turn the stepper motor. Start a new project. Set bits 1 to 4 of PORT P ($25A) to 1 (output direction) Do not set bits 0, and 5-7, setting these bits may produce unexpected results. Output the following sequence to turn the motor clockwise to PORT P($258): Bit # 7 6 5 4 3 2 1 0 |= value x x d 0 1 0 1 d |= 0x0A x x d 1 0 0 1 d |= 0x12 x x d 1 0 1 0 d |= 0x14 x x d 0 1 1 0 d |= 0x0C x= cannot write to - writing to these bits may produce undesired results d= don't care This sequence will cause the motor to step four times. Sending the data out in reverse order will cause the motor to turn in the reverse direction. Steps: Program the Port P data direction register as outputs by writing ones to bits 1-4 in the address $25A. Put the step data into an array and use an index register (X or Y) to step through the data. The data sequence should be sent to PORT P (address $258). Note the bits used.When the end of the array is reached the pointer will need to be reset back to the beginning of the array. Delay 30 milliseconds between each step using a loop delay. Make the delay loop a subroutine. Save the program, later direction and speed control will be added. The program should run in a continuous loop.

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: Write an assembly language program to turn the stepper
Reference No:- TGS0564692

Expected delivery within 24 Hours