Multi-Motor Driver Shield w/ DUE

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Multi-Motor Driver Shield w/ DUE

Postby dgelman » Thu Jan 10, 2013 6:18 pm

Hello Community,

I have been playing with the UNO for a while now and now I have switched to the DUE. I have the following shield the can potentially control 4 DC motors.

http://arduino-direct.com/sunshop/index.php?l=product_detail&p=292

The shield comes with a library that is strictly for AVR Arduinos (everything but the DUE), so the library is useless. Trying to decypher the language, I understand that it is using a latch to trigger forward and reverse current (via shift register). I know where to send the PWM just not the control of direction...

http://yourduino.com/docs/Multi-MotorShieldSchematic.jpg

My previous designs required me to send states that would direct the polarity of the current to provide the reversing or forwarding of the motors. Now this shield uses a shift register and direct latch. This confusion along with my limited understand of ARM is making this difficult for me to understand.

Notice the "~_BV(a);" and "_BV(b);" and its variations that all polarity in the current.

From Library of Shield
Code: Select all
void AF_DCMotor::run(uint8_t cmd) {
  uint8_t a, b;
  switch (motornum) {
  case 1:
    a = MOTOR1_A; b = MOTOR1_B; break;
  case 2:
    a = MOTOR2_A; b = MOTOR2_B; break;
  case 3:
    a = MOTOR3_A; b = MOTOR3_B; break;
  case 4:
    a = MOTOR4_A; b = MOTOR4_B; break;
  default:
    return;
  }
 
  switch (cmd) {
  case FORWARD:
    latch_state |= _BV(a);
    latch_state &= ~_BV(b);
    MC.latch_tx();
    break;
  case BACKWARD:
    latch_state &= ~_BV(a);
    latch_state |= _BV(b);
    MC.latch_tx();
    break;
  case RELEASE:
    latch_state &= ~_BV(a);
    latch_state &= ~_BV(b);
    MC.latch_tx();
    break;
  }
}


I hope this isnt to vague of a question. Please let me know if this is confusing.

Thanks,
Dan
dgelman
 
Posts: 2
Joined: Thu Jan 10, 2013 6:05 pm

Re: Multi-Motor Driver Shield w/ DUE

Postby adafruit_support_bill » Thu Jan 10, 2013 6:31 pm

Hi. This appears to be a copy of an older design of ours. You should contact the seller for support.
User avatar
adafruit_support_bill
 
Posts: 15983
Joined: Sat Feb 07, 2009 9:11 am


Return to Arduino

Who is online

Users browsing this forum: No registered users and 12 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [100]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[108]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[69]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]