| Oricom Technologies
www.oricomtech.com |
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 or Unix 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.
New Commands in Firmware Version 2.0 - [01.2005]
In version 2.0, several new commands have been added to the command set, including several binary commands and new ASCII commands. There are binary commands for specifying both 4-usec resolution servo pulsewidths between 1000-2000 usec, and also for 1-usec resolution pulsewidths between 500 and 2500 usec, plus commands for A/D conversions.
The basic form of the binary commands is compatible with the mini-SSC comand set, where 3 binary databytes are sent over the RS-232 link, with the first being an escape-code = 255h. The escape-code is the signal that the next several databytes are a command in binary format. It is also possible to send a velocity value with a command, and to send binary commands that specific 1-usec pulsewidth resolution. The advantage of binary format is that the commands are shorter, and binary <=> Hex <=> ASCII conversions are not required.
NEW Version 2.0 COMMANDS
| Binary Commands (non-ASCII) | |
| 255,s,p (3 bytes) |
set (s)ervo (p)ulsewidth, where (s)=0-19d and (p)=0-254d. Pulsewidth = (4*p)+1000 usec. 4-usec pulsewidth resolution. |
| 255,64+s,p,v (4 bytes) |
set (s)ervo (p)ulsewidth and (v)elocity, where (s)=0-19d, (p)=0-254d, and (v)=1-254d. 4-usec pulsewidth resolution, and velocity = (v)*2 usec/update. |
| 255,128+s,h,l (4 bytes) |
set (s)ervo pulsewidth to 12-bit value specified by successive bytes (h) + (l), where (s)=0-19d, pulsewidth = [(256*h)+l] usec. 1-usec pulsewidth resolution. |
| 255,128+64+s,h,l,v (5 bytes) |
set (s)ervo pulsewidth and velocity, where (s)=0-19d, successive databytes (h) + (l) specify 12-bit pulsewidth value = [(256*h)+l] usec, and (v)elocity = 1-254d. 1-usec pulsewidth resolution. |
| 255,32+c (2 bytes) | convert A/D (c)hannel and send data to host, where (c)=0-7d. 8-bit resolution. |
| 255,32+c (2 bytes) | convert A/D (c)hannel and send data to host, where (c)=8-15d. 10-bit resolution. |
| new ASCII commands | |
| CS | (C)onfiguration (S)tore to on-chip data eeprom. |
| CL | (C)onfiguration (L)oad from on-chip eeprom - done automatically on power-up. |
| CE | (E)rase (C)onfiguration memory. |
| CD | (D)isplay on-chip data eeprom. |
| CV | send (C)onfiguration (V)ersion info to host. |
| YTllhh | enable c(Y)cle (T)esting - cycle enabled servos between (ll)ow and (hh)igh pulsewidth positions with 2 sec period, where max pulsewidth range = 1000-2000 usec. |
| YF | turn servo test c(Y)cling of(F). |
| V | send (V)ersion number to host. |
| Z | return 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. |
| Uc | set RS-232 ba(U)drate per data (c)haracter, where (c)= 'A' - 'H', for baud 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, respectively (bootup default = 9600). |
The servo controller chip also has a Debug mode, which displays port info, register and memory locations, to aid familiarization and code development.