PORTB=0x80; //FORWARDDDDD
delay_ms(500);
PORTB=0x40;
delay_ms(500);
PORTB=0x20;
delay_ms(500);
PORTB=0x10;
delay_ms(500);
Sir please trust me. I know what I am doing. The only thing that i am not able to understand is the behavior of the motor. The sequence is correct according to the connections made to the L293DNE and it is meant to rotate the motor in the anticlockwise direction.
But this is the first thing you need to do:And honestly i dont know which one of them is A, B, C, D respectively
I said randomly. This means sometimes the operation is correct, sometimes not.it should not have worked even for once if what you say is right.
It may work .....by accidence. But expect no torque.So it randomly moves forward or back.
Yes. This is full step mode, one direction, full sequence.0x80, 0x20, 0x40, 0x10.
Can work when changing coil terminals, e.g. B<->C.in opposite this: (I doubt this works)
0x80, 0x40, 0x20, 0x10.
Correct. I´m still confused with schematic of post#4 where A and B clearely go to the same coil.Can work when changing coil terminals, e.g. B<->C.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 void main() { trisB=0x00; PORTB=0xF0; while(1) { PORTB=0x80; //FORWARDDDDD delay_ms(500); PORTB=0x40; delay_ms(500); PORTB=0x20; delay_ms(500); PORTB=0x10; delay_ms(500); PORTB=0x80; //FORWARDDDDD delay_ms(500); PORTB=0x40; delay_ms(500); PORTB=0x20; delay_ms(500); PORTB=0x10; delay_ms(500); delay_ms(1500); PORTB=0x10; //BACKWARD delay_ms(500); PORTB=0x20; delay_ms(500); PORTB=0x40; delay_ms(500); PORTB=0x80; delay_ms(500); PORTB=0x10; //BACKWARD delay_ms(500); PORTB=0x20; delay_ms(500); PORTB=0x40; delay_ms(500); PORTB=0x80; delay_ms(500); delay_ms(1500); } }
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?