I created the program using the FOR loop function for clk and aclk wise rotation of stepper motor. i wrote sequence correctly .But the problem,whatever the program in the 1st loop is executed continuously and remaining part doesn't execute.
#include "msp430.h"
int main(void)
{
P1DIR=0XFF;
volatile long int i;
for(;;)
{
for(i=1;i<=200;i++)
{
P1OUT = 0x09; //p1.0
__delay_cycles(4000);
P1OUT = 0x05; //p1.1
__delay_cycles(4000);
P1OUT = 0x06; //p1.2
__delay_cycles(4000);
P1OUT = 0x0A; //p1.3
__delay_cycles(4000);
}
for(i=1;i<=200;i++)
{
P1OUT = 0x0A;
__delay_cycles(4000);
P1OUT = 0x06;
__delay_cycles(4000);
P1OUT = 0x05;
__delay_cycles(4000);
P1OUT = 0x09;
__delay_cycles(4000);
}
}
}