Oricom Technologies
www.oricomtech.com

Return to:
Servo Controller Chip page.
Servo Controller Command Set

Bot-CoP Servo Controller Chips have over 30 separate commands, including 15 specifically for selection of servo parameters. All commands are coded in simple ASCII format. The chip can be controlled manually using a terminal emulator for testing purposes, or via custom software, or via another controller with RS-232 capability, such as the Basic Stamp, OOPic, or Basic Atom.

Note that BotCoPs do not have a "language" per se, rather they have a "command set". This is the same as the difference between the Basic programming language and DOS command line operations. BotCoP commands do not compile into ROM, rather the chip waits for a "host", or master, controller to issue commands to it over the RS-232 line, then it executes those commands in real-time. Controlled-velocity servo movements can be specified, which might take upwards to 5 seconds to complete, during which time the host controller is free to engage in other activities.



BASIC COMMANDS
Vsend (V)ersion number to host.
Zreturn chip to (Z)ero state, i.e. power-up configuration.
ACcc(A)nalog mode - (C)onvert A/D converter (cc)hannel, where (cc) = 00 - 04; output as 8-bit hex number.
ANdd (A)nalog mode - set (N)umber of analog channels to (dd)ata value, where (dd) = 00, 03, or 05.
Ipb configure (p)ort (b)it as (I)nput, read & return value '0' or '1', where (p) = 'A', 'B', or 'C', and (b) = 0 - 7.
Hpb configure (p)ort (b)it as output and set (H)igh, where (p) = 'A', 'B', or 'C', and (b) = 0 - 7.
Lpb configure (p)ort (b)it as output and set (L)ow, where (p) = 'A', 'B', or 'C', and (b) = 0 - 7.
Pc (P)ort command - read and display individual port (c) data, where (c) = 'A', 'B', or 'C'.

SERVO CONTROL COMMANDS
Global Servo Control
SO(S)ervo mode - turn all servos (O)n.
SF(S)ervo mode - turn all servos of(F).
SZ(S)ervo mode - return to (Z)ero mode; disable all servos, load default (center) pulsewidths.
SAdddd (S)ervo mode - set enable flags for (A)ll servos per hex (dddd)atabytes, where bit# 19 ... 0 in (dddddd) corresponds to servo# 19 ... 0, respectively; bit = '1' enables servo. Eg, for SA010203, (dddddd) = (binary format) 00000001 00000010 00000011 and enables servos# 16, 9, 1, and 0.
SA (S)ervo mode - read (A)ll servo enable flags, in hex format; eg, output "0C410D" indicates servo# 19, 18, 14, 8, 3, 2, and 0 are enabled, and all others disabled.
SC (S)ervo mode - set all servo pulsewidths to (C)enter (default) position = 1.5 msec.
SGdddd (S)ervo mode - set (G)lobal pulsewidth (ie, all servos) to 12-bit (dddd)ata, where (dddd) = 01F4 - 09C4h (500 - 2500d); resolution in 1 usec increments.
SXlluu (S)ervo mode - set e(X)cursion limits of all servos to (ll)ower and (uu)pper bounds, in multiples of 16 usec; eg, SX4080. Lowest allowable value = 1Fh (31d*16 = 496 usec); highest allowable value = 9Dh (157d*16 = 2512 usec).
SX (S)ervo mode - read e(X)cursion limits; outpus lower and upper bounds, in multiples of 16 usec; eg, '4080'.
SPdd (S)ervo mode - set servo pulse repetition (P)eriod timer per (dd)atabyte, where (dd) = 01 - 05, corresponding to period values of decimal 10, 15, 20, 25, and 30 msec, respectively; default = 20 msec.
SP (S)ervo mode - readout pulse repetition (P)eriod timer value, in hex.
Individual Servo Control
SEss (S)ervo mode - (E)nable (ss)ervo#, where (ss) = 00 - 13h (19d); configure port pin=output and enable pulsing.
SDss (S)ervo mode - (D)isable (ss)ervo#, where (ss) = 00 - 13h (19d).
SWssdddd (S)ervo mode - set target (ie, end) pulse(W)idth on (ss)ervo# to 12-bit (dddd)ata, where (dddd) must be between 01F4h (500d) and 09C4h (2500d); resolution in 1 usec increments.
SWss (S)ervo mode - read "current" pulse(W)idth of (ss)ervo#; output in usec in hex format, eg, output "05DC" = 1500d usec. Use SWssdddd command without (dddd) appended. Useful for position indication when using slow velocity values.
SVssdd (S)ervo mode - set (V)elocity of (ss)ervo# to (dd)ata, where (dd) = 01h-FFh. Velocity = pulsewidth stepsize, in multiples of 4 usec, added to current pulsewidth when moving towards end pulsewidth; used automatically in all servo move commands (SW, SC, SG, M). Default setting = 04h = 4*4 = 16 usec/step.
SVss (S)ervo mode - read current (V)elocity value for (ss)ervo#; output in 4 usec multiples in hex format, eg, output "0A" = (10d)*4 = 40 usec. Use SVssdd command without (dd) appended.

SERVO MOVE "SHORT" COMMANDS
Mssdd (M)ove (ss)ervo# to position given by 8-bit (dd)atabyte, where (dd) = 00 - FAh (0 - 250d) produces output pulsewidths from 500 to 2500 usec.
Nssdd (N)arrow range, move (ss)ervo# to position given by 8-bit (dd)ata byte where (dd) = 00 - FAh (0 - 250d) produces output pulsewidths from 1000 to 2000 usec, with 4 usec resolution.
Rssdd (R)elative move (ss)ervo# forwards or backwards, with respect to current position, an amount given by 8-bit (dd)atabyte, where (dd) = 00 - FFh (0 - 255d); if (dd) >= 80h, move is negative. 4 usec resolution.
Mssddvv
Nssddvv
Rssddvv
same as Mssdd, Nssdd, and Rssdd commands, except with (vv)elocity setting appended to end, where (vv) = 01 - FFh, in 4 usec/step increments.

ALARM / TRIGGER COMMANDS
ASdd enable (A)nalog (S)hutdown mode, set threshold = (dd)atabyte; where (dd) = 00 - FFh corresponds to analog value of 0 - 5v. Averages 16 samples on A/D converter channel RA3, and disables servos if average < threshold. On shutdown, pin RA4 pulses high/low at a 1 sec rate.
TD(T)rigger mode (D)isable.
THpb(T)rigger on (H)igh on (p)ort (b)it, where (p) = 'A', 'B', or 'C', and (b) = 0 - 7; this is actually an "enable" signal, so servos are enabled to run in response to a constant level on the selected pin.
TLpb(T)rigger on (L)ow on (pp)in, on (p)ort (b)it, where (p) = 'A', 'B', or 'C', and (b) = 0 - 7; this is actually an "enable" signal, so servos are enabled to run in response to a constant level on the selected pin.
TI(T)rigger mode - enable (I)ndicator pin; pin RA4 is configured as an output, and goes low when a trigger input is valid.

MISCELLANEOUS COMMANDS
FE (F)lag command - enable (E)cho mode; all command characters sent to chip are echoed back.
FF(F)lag command - set echo mode of(F); only requested data is sent to host (default at bootup).
FR(F)lag command - (R)ead error code for bad command receipt, and system flags byte.
Ucset RS-232 ba(U)drate per data (c)haracter, where (c)= 'A' - 'H', for baud 1200, 2400, 4800, 9600, 19200, 38400, 56700, 115200, respectively (bootup default = 9600).

The servo chip also has a Debug mode, which displays port info, register and memory locations, to aid familiarization and code development.

<| TOP


© Oricom Technologies, updated Oct 2002