# Dual Serial Motor Controller-Individual Motor Control issue

**URL:** https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140
**Category:** Motor controllers/drivers and motors
**Created:** [February 17, 2009, 6:54pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140 "2009-02-17T18:54:40Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![arthuranderson14](https://forum.pololu.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@arthuranderson14](https://forum.pololu.com/u/arthuranderson14)
#### Post date: [February 17, 2009, 6:54pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/1 "2009-02-17T18:54:40Z")

</div>

Motor Controller: Low-Voltage Dual Serial Motor Controller  
Micro Controller: Basic Stamp 2  
Desired Operation: 2 motor mode, default motor numbers  
Motors: Tamiya 70168  
Power: Motor: Power 2 - 1.5v AA / Micro/Motor Controller – 5v regulated on Basic Stamp Homework Board  
Wiring Deviations: 0.1uF capacitors aren’t installed

Hello,

I am new to motor/microcontrollers and have been experiencing difficulty controlling two motors independently. The motors will only respond to the following commands.

If I use 1 as the motor number both motors turn in one direction.

SEROUT 0, 84, [$80, 0, 1, 127]

If I use 0 as the motor number both motors turn in the opposite direction.

SEROUT 0, 84, [$80, 0, 0, 127]

I tried using the default motor numbers and others (0-20) just for testing with no luck.

I am fairly sure I am the cause of the problem since I didn’t read the documentation all the way through. I started by issuing the configuration command at the start of my test program:

SEROUT 0, 84,[$80,2,2]  
LOW 2 'reset motor controller  
HIGH 2  
PAUSE 100

I also had a return statement at the end of my test program which would cause the application to loop.

I figured it would be a good idea to start from scratch but I am having some trouble getting there. Does anyone have a BS2 script to erase the motor controller eeprom and reset the factory defaults?

Any other suggestions would be greatly appreciated!

Thanks,  
Eric

---

<div class="post-metadata">

### Author: ![jan](https://forum.pololu.com/user_avatar/forum.pololu.com/jan/32/20_2.png) [@jan](https://forum.pololu.com/u/jan)
#### Post date: [February 17, 2009, 8:23pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/2 "2009-02-17T20:23:11Z")

</div>

Hello.

It sounds like your motor controller got set to single-motor mode. Your SEROUT 0, 84, [$80, 2, 2] line should restore the defaults. If you run that without the immediate reset, do you see the LEDs flash in the expected fashion? After that, you should get individual motor control.

- Jan

---

<div class="post-metadata">

### Author: ![arthuranderson14](https://forum.pololu.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@arthuranderson14](https://forum.pololu.com/u/arthuranderson14)
#### Post date: [February 17, 2009, 8:45pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/3 "2009-02-17T20:45:53Z")

</div>

Hi Jan,

Thank you for the quick response. If I run the script below, I get a solid green LED and motor connected to M1± starts running.

’ {$STAMP BS2}  
’ {$PBASIC 2.5}

SEROUT 0, 84,[$80,2,2]  
END

If I add a pause/reset, it will run for the amount of time definned for the pause and then stop when reset.

’ {$STAMP BS2}  
’ {$PBASIC 2.5}

SEROUT 0, 84,[$80,2,2]  
PAUSE 4000

LOW 2 'reset motor controller  
HIGH 2

END

Thanks,  
Eric

---

<div class="post-metadata">

### Author: ![jan](https://forum.pololu.com/user_avatar/forum.pololu.com/jan/32/20_2.png) [@jan](https://forum.pololu.com/u/jan)
#### Post date: [February 18, 2009, 2:53am UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/4 "2009-02-18T02:53:21Z")

</div>

That shouldn’t be happening. Can you try without the motor connected?

- Jan

---

<div class="post-metadata">

### Author: ![arthuranderson14](https://forum.pololu.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@arthuranderson14](https://forum.pololu.com/u/arthuranderson14)
#### Post date: [February 18, 2009, 3:51am UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/5 "2009-02-18T03:51:26Z")

</div>

I disconnected both motors and ran the script below. The LED went solid green for 4 seconds.

’ {$STAMP BS2}  
’ {$PBASIC 2.5}

SEROUT 0, 84,[$80,2,2]  
PAUSE 4000

LOW 2 'reset motor controller  
HIGH 2  
END

Thanks,  
Eric

---

<div class="post-metadata">

### Author: ![jan](https://forum.pololu.com/user_avatar/forum.pololu.com/jan/32/20_2.png) [@jan](https://forum.pololu.com/u/jan)
#### Post date: [February 18, 2009, 4:41pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/6 "2009-02-18T16:41:48Z")

</div>

Can you try putting the reset stuff before the serout command? In other words, make pin 0 high, then toggle the reset line, then send the configuration command.

- Jan

---

<div class="post-metadata">

### Author: ![arthuranderson14](https://forum.pololu.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@arthuranderson14](https://forum.pololu.com/u/arthuranderson14)
#### Post date: [February 18, 2009, 8:55pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/7 "2009-02-18T20:55:02Z")

</div>

Hi Jan,

No luck. ☹ Same behavior with the following script:

’ {$STAMP BS2}  
’ {$PBASIC 2.5}

HIGH 0  
LOW 2  
HIGH 2  
PAUSE 100

SEROUT 0, 84,[$80,2,2]  
PAUSE 4000

LOW 2 'reset motor controller  
HIGH 2

END

---

<div class="post-metadata">

### Author: ![jan](https://forum.pololu.com/user_avatar/forum.pololu.com/jan/32/20_2.png) [@jan](https://forum.pololu.com/u/jan)
#### Post date: [February 19, 2009, 1:36am UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/8 "2009-02-19T01:36:02Z")

</div>

Can you try sending the three bytes separately, with big pauses or debug statements in between, and find out when the LED turns on?

- Jan

---

<div class="post-metadata">

### Author: ![arthuranderson14](https://forum.pololu.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@arthuranderson14](https://forum.pololu.com/u/arthuranderson14)
#### Post date: [February 19, 2009, 8:02pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/9 "2009-02-19T20:02:34Z")

</div>

Hi,

The green LED turns on M1 motor turns when the 3rd byte is sent. I think I did it right but the script is below:

HIGH 0  
LOW 2  
HIGH 2  
PAUSE 1000

SEROUT 0, 84,[$80]  
DEBUG CLS, "Serout 1"  
PAUSE 5000

SEROUT 0, 84,[2]  
DEBUG CLS, "Serout 2"  
PAUSE 5000

SEROUT 0, 84,[2] ’ LED TURNS ON HERE AND MOTOR 1 STARTS TURNING  
DEBUG CLS, “Serout 3”

---

<div class="post-metadata">

### Author: ![jan](https://forum.pololu.com/user_avatar/forum.pololu.com/jan/32/20_2.png) [@jan](https://forum.pololu.com/u/jan)
#### Post date: [February 20, 2009, 5:06pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/10 "2009-02-20T17:06:15Z")

</div>

I don’t have any explanation for the behavior (if you aren’t doing anything wrong), but it’s very unlikely for a problem with the motor controller to fail in this way. You shouldn’t be doing the test with the motor connected since that brings your power setup more into play, and you could also try using our serial transmitter utility (connect a computer serial port to the RS-232 input) to take your BASIC Stamp out of the picture. If all that leads to the same results or if you’re sick of testing, you can send the unit back to us for us to evaluate.

- Jan

---

<div class="post-metadata">

### Author: ![arthuranderson14](https://forum.pololu.com/letter_avatar_proxy/v4/letter/a/a183cd/32.png) [@arthuranderson14](https://forum.pololu.com/u/arthuranderson14)
#### Post date: [February 20, 2009, 8:10pm UTC](https://forum.pololu.com/t/dual-serial-motor-controller-individual-motor-control-issue/1140/11 "2009-02-20T20:10:04Z")

</div>

I appreciated all your help. I will likely send it back and let the experts take a look.

Thanks,  
Eric
