Beginner issue with motor mind B
Archiver
Posts: 46,084
Hello all.
I just got my first basic stamp (BS2) with a boeard of eduction and the Motor Mind B.
Right now, I'm just trying to get the thing to make a small DC motor to run.
I have run through a few basic programs flashing leds and the like, and seem to have some grasp of how PBASIC works.
But I am stumped on what is going on with this.
I have read the nuts and volts article on SERIN and SEROUT, and entered the following code into the stamp, which is directly from the Motormind datasheet:
'{$STAMP BS2}
OUTPUT 14
INPUT 15
'
TM CON 15
FM CON 14
HIGH FM
'
START_UP:
PAUSE 1000
'
'Send STOP command to Motormind
SEROUT FM,396,[noparse][[/noparse]$55,$80]
SERIN TM,396,NO_CONFIRM1,[noparse][[/noparse]b7]
DEBUG "PROCESSING",CR
IF b7 <> $AA THEN NO_CONFIRM1
CONFIRM1:
DEBUG "STOP",CR
NO_CONFIRM1:
PAUSE 1000
'
'Send SETDC COMMAND
SEROUT FM,396,100,[noparse][[/noparse]$55,$83,$DD]
SERIN TM,396,100,NO_CONFIRM2,[noparse][[/noparse]b7]
IF b7 <> $AA THEN NO_CONFIRM2
CONFIRM2:
DEBUG "SETDC",CR
NO_CONFIRM2:
PAUSE 3000
'
'
DEBUG "DONE",CR
GOTO START_UP:
Nothing Happened.
I figured it might be something to do with the confrimation byte from the motor mind B
So I commented out all the confrimation stuff as follows:
'{$STAMP BS2}
OUTPUT 14
INPUT 15
'
TM CON 15
FM CON 14
HIGH FM
'
START_UP:
PAUSE 1000
'
'Send STOP command to MM
SEROUT FM,396,[noparse][[/noparse]$55,$00]
' SERIN TM,396,NO_CONFIRM1,[noparse][[/noparse]b7]
' IF b7 <> $AA THEN NO_CONFIRM1
'CONFIRM1:
DEBUG "STOP",CR
'NO_CONFIRM1:
PAUSE 1000
'
'Send SETDC COMMAND
SEROUT FM,396,100,[noparse][[/noparse]$55,$03,$DD]
' SERIN TM,396,100,NO_CONFIRM2,[noparse][[/noparse]b7]
' IF b7 <> $AA THEN NO_CONFIRM2
'CONFIRM2:
DEBUG "SETDC",CR
'NO_CONFIRM2:
PAUSE 3000
'
'
DEBUG "DONE",CR
GOTO START_UP:
This is the result: from the debug window:
benjamin@blue Bensstampstuff $ bstamp_run motortest.tok
Model: Basic Stamp 2
Firmware version BCD = 16
Ack = 0
Ack = 0
Ack = 0
Ack = 0
Ack = 0
DEBUG OUTPUT: (Press [noparse][[/noparse]Control]-[noparse][[/noparse]C] to complete sequence)
_____________________________________________________________________
STOP
SETDC
DONE
STOP
SETDC
DONE
STOP
SETDC
_____________________________________________________________________
Received [noparse][[/noparse]Control]-[noparse][[/noparse]C]!
Shutting down communication!
benjamin@blue Bensstampstuff $
I am running this on Linux using tokenizer software downloaded from the Parallax website.
Also the second script did get the motor to go for a few rounds the first time I tried it, but it then stopped, and has yet to go again.
I also am monitoring the volts out of the motormind with a multimeter and nothing is changing there either...
If anybody has any advice I would greately appreicate it.
Many thanks,
Ben
I just got my first basic stamp (BS2) with a boeard of eduction and the Motor Mind B.
Right now, I'm just trying to get the thing to make a small DC motor to run.
I have run through a few basic programs flashing leds and the like, and seem to have some grasp of how PBASIC works.
But I am stumped on what is going on with this.
I have read the nuts and volts article on SERIN and SEROUT, and entered the following code into the stamp, which is directly from the Motormind datasheet:
'{$STAMP BS2}
OUTPUT 14
INPUT 15
'
TM CON 15
FM CON 14
HIGH FM
'
START_UP:
PAUSE 1000
'
'Send STOP command to Motormind
SEROUT FM,396,[noparse][[/noparse]$55,$80]
SERIN TM,396,NO_CONFIRM1,[noparse][[/noparse]b7]
DEBUG "PROCESSING",CR
IF b7 <> $AA THEN NO_CONFIRM1
CONFIRM1:
DEBUG "STOP",CR
NO_CONFIRM1:
PAUSE 1000
'
'Send SETDC COMMAND
SEROUT FM,396,100,[noparse][[/noparse]$55,$83,$DD]
SERIN TM,396,100,NO_CONFIRM2,[noparse][[/noparse]b7]
IF b7 <> $AA THEN NO_CONFIRM2
CONFIRM2:
DEBUG "SETDC",CR
NO_CONFIRM2:
PAUSE 3000
'
'
DEBUG "DONE",CR
GOTO START_UP:
Nothing Happened.
I figured it might be something to do with the confrimation byte from the motor mind B
So I commented out all the confrimation stuff as follows:
'{$STAMP BS2}
OUTPUT 14
INPUT 15
'
TM CON 15
FM CON 14
HIGH FM
'
START_UP:
PAUSE 1000
'
'Send STOP command to MM
SEROUT FM,396,[noparse][[/noparse]$55,$00]
' SERIN TM,396,NO_CONFIRM1,[noparse][[/noparse]b7]
' IF b7 <> $AA THEN NO_CONFIRM1
'CONFIRM1:
DEBUG "STOP",CR
'NO_CONFIRM1:
PAUSE 1000
'
'Send SETDC COMMAND
SEROUT FM,396,100,[noparse][[/noparse]$55,$03,$DD]
' SERIN TM,396,100,NO_CONFIRM2,[noparse][[/noparse]b7]
' IF b7 <> $AA THEN NO_CONFIRM2
'CONFIRM2:
DEBUG "SETDC",CR
'NO_CONFIRM2:
PAUSE 3000
'
'
DEBUG "DONE",CR
GOTO START_UP:
This is the result: from the debug window:
benjamin@blue Bensstampstuff $ bstamp_run motortest.tok
Model: Basic Stamp 2
Firmware version BCD = 16
Ack = 0
Ack = 0
Ack = 0
Ack = 0
Ack = 0
DEBUG OUTPUT: (Press [noparse][[/noparse]Control]-[noparse][[/noparse]C] to complete sequence)
_____________________________________________________________________
STOP
SETDC
DONE
STOP
SETDC
DONE
STOP
SETDC
_____________________________________________________________________
Received [noparse][[/noparse]Control]-[noparse][[/noparse]C]!
Shutting down communication!
benjamin@blue Bensstampstuff $
I am running this on Linux using tokenizer software downloaded from the Parallax website.
Also the second script did get the motor to go for a few rounds the first time I tried it, but it then stopped, and has yet to go again.
I also am monitoring the volts out of the motormind with a multimeter and nothing is changing there either...
If anybody has any advice I would greately appreicate it.
Many thanks,
Ben