In the figure 3.10 area marked with the red border are the LEDs connected to the input stage of
the L293D motor driver. Area marked by Blue border shows LEDs connected to the output of
the motor driver. Orange border marks position encoder output LEDs. Yellow border marks left
and right motor connectors.
Microcontroller pin connections
Microcontroller Pin
PD5 (OCR1AL)
PD4 (OCR1BL)
PB0
PB1
PB2
PB3
LED Direction Indications
Direction
FORWARD
REVERSE
RIGHT
(Left wheel forward, Right
wheel backward)
LEFT
(Left wheel backward,
Right wheel forward,)
SOFT RIGHT
(Left wheel forward,, Right
wheel stop)
SOFT LEFT
(Left wheel stop, Right
wheel forward,)
SOFT RIGHT 2
(Left wheel stop, Right
wheel backward)
SOFT LEFT 2
(Left wheel backward,
Right wheel stop)
HARD STOP
SOFT STOP
(Free running stop)
© NEX Robotics Pvt. Ltd. and ERTS Lab IIT Bombay, INDIA
Pulse width modulation for the left motor (velocity control)
Pulse width modulation for the right motor (velocity control)
Left motor direction control
Left motor direction control
Right motor direction control
Right motor direction control
Table 3.2: Pin functions for the motion control
L1
L2
(Red)
(Red)
(I/P)
(I/P)
PB0
PB1
0
1
1
0
0
1
1
0
0
1
0
0
0
0
1
0
0
0
1
1
Table 3.3: Direction and PWM LED indications
SPARK V ATMEGA16 Hardware Manual
Function
PL
R1
R2
(Yel.)
(Red)
(Red)
(I/P)
(I/P)
(I/P)
PD3
PB2
PB3
1
1
0
1
0
1
1
0
1
1
1
0
1
0
0
1
1
0
1
0
1
1
0
0
1
0
0
1
1
1
PR
Direction
(Yel.)
Output
(I/P)
(Red / Yel.)
PD4
Left
Right
Motor
Motor
1
Yellow
Yellow
1
Red
Red
1
Yellow
Red
1
Red
Yellow
1
Yellow
Off
1
Off
Yellow
1
Off
Red
1
Red
Off
1
Off
Off
1
Off
Off
19
Need help?
Do you have a question about the SPARK V ATMEGA16 and is the answer not in the manual?