mohsenln90
Newbie level 2
- Joined
- Apr 17, 2012
- Messages
- 2
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,293
Hello
my name is mohsen, I work on project that I want to count the steps of stepper motor if the numbers of steps are in Periods PORTD.2 turn on and else PORTD.3 turn on.
I wrote the program in c language in code vision avr and simulate in proteus but the simulation doesn’t work properly.
My program is:
Would you please help me.
Thanks.
my name is mohsen, I work on project that I want to count the steps of stepper motor if the numbers of steps are in Periods PORTD.2 turn on and else PORTD.3 turn on.
I wrote the program in c language in code vision avr and simulate in proteus but the simulation doesn’t work properly.
My program is:
Code:
{
i=50;
while(PINB.1=0)
{
for(j=0;j<200;j++)
{
PORTC=0b00000011;
delay_ms(i);
PORTC=0b00000110;
delay_ms(i);
PORTC=0b00001100;
delay_ms(i);
PORTC=0b00001001;
delay_ms(i);
}
if(PINB.1=1)
{PORTC=0x00;}
if((j>5)||(j<14)){
PORTD.2=1;}
else
{ PORTD.3=1;}
}
}
}
Thanks.
Last edited by a moderator: