Shop OBEX P1 Docs P2 Docs Learn Events
Motor Mind B SETDC command, 8N1 - need help — Parallax Forums

Motor Mind B SETDC command, 8N1 - need help

leiji81leiji81 Posts: 7
edited 2006-02-13 08:38 in BASIC Stamp
Can anyone explain 8N1 to me, and how i would go about using the SETDC command.

The following explanation and examples are from the Motor Mind B spec sheet on the Parallax website. I am trying to change the frequency of the motors spinning through this command. I do not understand what the $55, $83, and $DD mean. I've tried looking online to no avail...
Explanation (From tech sheet):
"SETDC command (‘03’h) To adjust motor speed the
master unit sends the sync byte followed by the
SETDC command on the FM pin. The command is then
followed by the positive duty cycle value. The range
is ‘00’h-‘FF’h(0-255dec.). The minimum duty cycle is
0.39%, the maximum is 99.61%. While the Motor Mind
B accepts 256 discrete steps, ‘00’h is implemented as
a ‘01’h, and ‘FF’h as a ‘FE’h. So the actual number of
PWM steps available is 254. The higher the number
the faster the motor will turn."

Example (From Tech Sheet):

'Send SETDC command, set duty cycle to 'DD'h, or 86.2%,(Dec 221 out of 256 possible)
'
SEROUT FM,396,[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

Thank You

Comments

Sign In or Register to comment.