41
I
NPUT
O
UTPUT
(I/O)
The robot microcontroller includes several digital and analog I/O ports. Some I/O ports are used by optional
accessories. Any ports not used by robot accessories may be used for your own custom I/O
See Appendix A for port locations and specifications.
User I/O
The User I/O connector on the Pioneer 3 microcontroller contains eight digital input (ID0-7) and eight digital output
(OD0-7) ports, as well as an analog-to-digital (AN0) port.
14
Additional analog ports are present in the joystick connector
and “tilt/roll” connector, and IR and bumper switch input ports may also be used if necessary for custom I/O.
The bit-mapped states of the sixteen digital ports and one of the analog port are sampled, buffered and placed in the
standard SIP in the
DIGIN
,
DIGOUT
and
ANALOG
fields.
If not physically connected, the digital input and AN port values
may vary and change without warning. In addition, if IO Packets are requested, then all digital and analog I/O states as
well as IR and bumper states are provided in IO packets.
Send the
DIGOUT
command #30 to set one or more of the eight
DIGOUT
ports on the ARCOS microcontroller.
Electrically, the ports are digital high (1) at ~5 VDC (V
cc
) and low (0) at ~0 VDC (
GND
).
DIGOUT
takes a two-byte
(unsigned integer) argument. The first byte is a mask whose bit pattern selects (1) or ignores (0) the state of the
corresponding bit in the second byte to set (1) or unset (0) the digital output port.
For example, here’s the ARCOS client command to set digital output ports zero and three (
OD0
and
OD3
), reset port four
(
OD4
), and leave all the rest alone:
250, 251, 6, 30, 27, 25, 9, 55, 36
See Appendix A for details on connecting devices to User IO including port locations and specifications.
IO Packets
Client software may request the IO Packet (“
IOpac”)
SIP. This packet has type 240 (0xF0). It provides the current state
of all robot I/O.
Send the
IOREQUEST
command number 40 with an argument value of 0, 1 or 2 to request IO packets. The argument
value 1 requests a single packet to be sent by the next client-server communications cycle. The request argument
value of 2 tells ARCOS to send
IOpac
packets continuously, at approximately one per cycle depending on serial port
speed and other pending SIPs. Use the
IOREQUEST
argument value 0 to stop continuous
IOpac
packets.
Table 14. IOpac packet contents
L
ABEL
D
ATA
V
ALUE
D
ESCRIPTION
Header
2
0xFA, 0xFB
Common header
Byte count
1
22
Number of data bytes + 2
Type
1
0xF0
Packet type
N DIGIN
1
4
Number of digital input bytes
DIGIN
1
varies 0-255
ID0-8 bits mapped
Frontbumps*
1
varies 0-255
Front bumper bits mapped
Rearbumps*
1
varies 0-255
Rear bumper bits mapped
IRs
1
varies 0-255
IR inputs
N DIGOUT
1
1
Number of digital output bytes
DIGOUT
1
varies 0-255
Digital output byte(s)
14
Many of these ports are used by the Gripper and other accessories. Alternative I/O is available.