Snippet - Modified Adafruit Motor Driver to be Pin Compatible With Panda II

Modified Adafruit Motor Driver to be Pin Compatible With Panda II

In order to get a low cost pin compatible motor driver for a Panda II a SainSmart L293D Motor Drive Shield (~$14) was modified to be controlled by the Panda’s parallel port. The original design was compatible with the Arduino Duemilanove Mega and used only 4 I/O pins but required a shift register to form the 8 bit control byte to the driver ICs.

By removing the shift register IC and connecting the empty socket outputs directly to the 8 parallel port pins on the Panda, coding was simplified and motor control was achieved through a byte arrayused to mask the appropriate bits in the motor control byte that is presented to the parallel port. The mapping of the parallel port pins to the empty 74HCT595N shift register socket is as follows with the numbers being:

pp bit - fez pin - IC socket:

0 - D51 - 2
1 - D50 - 3
2 - D49 - 4
3 - D48 - 1
4 - D47 - 15
5 - D46 - 6
6 - D45 - 7
7 - D44 - 5

The modified shield can drive 4 DC motors and 2 servos, or two steppers and 2 servos.To be pin compatible the code used 2 OutputCompare pins to substitute for PWM pins originally available on the Arduino and also used 2 fez PWM pins that were in the right location. The code snippet posted here only demonstrates how to start, reverse and stop each of the four dc motors. A later version of this project directly controlled the motors through a virtual COM port by merging this code with the Fez Term project developed by William (great piece of work by the way, William) . Comments in the snippet explain the most important features.

2 Likes

Creative! :slight_smile:

Some of us get lazy and want everything to be FEZ forgetting that we can modify any hardware to fit our needs. Good job

We got spoiled by Gadgeteer! :smiley:

Agree :slight_smile: