






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information on interfacing a stepper motor with an l298 motor driver and an avr microcontroller. It covers the theory of stepper motor operation, advantages, and control using the l298 driver. The document also includes a schematic layout and c code for controlling the motor.
Typology: Slides
1 / 11
This page cannot be seen from the preview
Don't miss anything!







Dr. S. Paul Sathiyan
KITS | EEE | VER 1.1 | AY 2018 2019
Advantages of Stepper Motor:
of a step and this error is non cumulative from one step to the next.
dependent on the life of the bearing.
less costly to control.
shaft.
PE0/RXD0/PDI
2
PE1/TXD0/PDO
3
PE2/XCK0/AIN
4
PE3/OC3A/AIN
5
PE4/OC3B/INT
6
PE5/OC3C/INT
7
PE6/T3/INT
8
PE7/ICP3/INT
9
PB0/SS
10
PB1/SCK
11
PB2/MOSI
12
PB3/MISO
13
PB4/OC
14
PB5/OC1A
15
PB6/OC1B
16
PB7/OC2/OC1C
17
PG3/TOSC
18
PG4/TOSC
19
RESET
20
XTAL
23
XTAL
24
PD0/SCL/INT
25
PD1/SDA/INT
26
PD2/RXD1/INT
27
PD3/TXD1/INT
28
PD4/ICP
29
PD5/XCK
30
PD6/T
31
PD7/T
32
PG0/WR
33
PG1/RD
34
PC0/A
35
PC1/A
36
PC2/A
37
PC3/A
38
PC4/A
39
PC5/A
40
PC6/A
41
PC7/A
42
PG2/ALE
43
PA7/AD
44
PA6/AD
45
PA5/AD
46
PA4/AD
47
PA3/AD
48
PA2/AD
49
PA1/AD
50
PA0/AD
51
PF7/ADC7/TDI
54
PF6/ADC6/TDO
55
PF5/ADC5/TMS
56
PF4/ADC4/TCK
57
PF3/ADC
58
PF2/ADC
59
PF1/ADC
60
PF0/ADC
61
AREF
62
AVCC
64 PEN
1
ATMEGA
IN
5
IN
7
ENA
6
OUT
2
OUT
3
ENB
11 OUT
13
OUT
14
IN
10
IN
12
SENSA
1
SENSB
15 GND
8
VS
4
VCC
9 U
L
D
LED-BLUE
REVERSE
D
LED-GREEN
FORWARD
B
12V
A
B
C
D
+88.
if(PINB==0b11111110) / /Forward
PORTA|=(1<<1); // Set the First (D1) bit of Port A
_delay_ms(100);
PORTA&=~(1<<1); // Clear the First (D1) bit of Port A
PORTA|=(1<<2); // Set the Second (D2) bit of Port A
_delay_ms(100);
PORTA&=~(1<<2); // Clear the Second (D2) bit of Port A
PORTA=(1<<5); // Set the Fifth (D5) bit of Port A
_delay_ms(100);
PORTA&=~(1<<5); // Clear the Fifth (D5) bit of Port A
PORTA|=(1<<6); // Set the Sixth (D6) bit of Port A
_delay_ms(100);
PORTA&=~(1<<6); // Clear the Sixth (D6) bit of Port A
if(PINB==0b11111101) / /Reverse
// PORTA=0b11000100;
PORTA|=(1<<6); // Set the Sixth (D6) bit of Port A
_delay_ms(100);
PORTA&=~(1<<6); // Clear the Sixth (D6) bit of Port A
PORTA|=(1<<5); // Set the Fifth (D5) bit of Port A
_delay_ms(100);
PORTA&=~(1<<5); // Clear the Fifth (D5) bit of Port A
PORTA|=(1<<2); // Set the Second (D2) bit of Port A
_delay_ms(100);
PORTA&=~(1<<2); // Clear the Second (D2) bit of Port A
PORTA|=(1<<1); // Set the First (D1) bit of Port A
_delay_ms(100);
PORTA&=~(1<<1); // Clear the First (D1) bit of Port A
else
_delay_ms(1);
return 0;