SBL2e Dual Serial-to-Ethernet User's Manual
Page 15
7.1
Multi-Function Pin Control
In addition to Serial-to-Ethernet capabilities, the SBL2e provides external control and readback
functionality for General Purpose Input/Outputs and Analog to Digital inputs.
The function of each multi-function pin is set in the GPIO configuration web page (GPIO is
the most common function).
The "GPIO Network Server" on the SBL2e listens on the TCP port number specified in the
"GPIO Server Port" field. For a quick test, you can use the telnet utility: "telnet <ip address>
1000" for the default port of 1000.
Some pins are fixed, but are shown for reference.
The pin configuration can only be done through the HTML web page or serial AT
commands.
Access to the pin functions can only be done through a TCP connection to the GPIO
Network Server (not the serial port).
7.2
Command Syntax
Once you have established a TCP connection to the GPIO Network Server, the following
commands can be used, where "xx" is a value from 03 to 15. All commands and queries must be
terminated by a line feed character: 0x0A. You may also terminate with a carriage return and line
feed; the carrage return will be ignored by the parser.
General Purpose I/O Functions:
Pxx = 0
Set pin output low.
Pxx = 1
Set pin out put high.
Pxx = I
Set pin as input.
Pxx?
Read input value. Note that this command will automatically program the pin as an
input. The value of an output pin cannot be read. The return value is 0 or 1 in the
format: "0, OK\r\n" or "1, OK\r\n".
Examples:
"P14=0\n"
returns "0, OK\r\n"
"P15?\n"
returns "1, OK\r\n" if the pin is logic high
Analog to Digital Functions:
Pxx?
Read input value. The value read is a number from 0-4095 representing the number
of counts. The counts represent a ratiometric value to the 3.3V reference voltage.
The maximum voltage input is 3.3V.
Example:
"P07?\n" , returns "1234, OK\r\n" if the number of counts was 1,234.
electronic components distributor