A4988 Driver is not work..avr studio4

[code]#include <avr/io.h>
#include <avr/interrupt.h>
#include “c:/WinAVR-20100110/avr/include/avr/iom2560.h”
#include <stdio.h>
#include <delay.h>
int main(void) {
DDRF=0xff;
PORTF=0x80;
while(1){
for(int i=0;i<200;i++){
PORTF|= 0x40;
PORTF&=~0x40;
delay_ms(100);
}
delay_ms(2000);
}
return 0;
}

//DIR PIN - PF7, STEP PIN - PF6, EN PIN - PF2 MS1,MS2,M3 - 5V …(ATmega2560)

(AVR Studio4 + WIN AVR)
[/code]

MOTOR(bipolar) is not work…help me~

Hi.

It looks like your code brings the STEP pin of your A4988 high and then low again in consecutive commands. That is probably too fast for the A4988. Could you try adding at least a 1us delay between these lines:

PORTF|= 0x40;
PORTF&=~0x40;

If that does not solve the problem, I recommend watching the video in this blog post and making sure that you have followed those steps to set up your driver. If you still are having trouble after that could you post pictures of your setup that show all connections and a wiring diagram?

-Claire