www.rovingnetworks.com
Version 1.0r 9/21/2012
51
RN -W IFLYCR -U M
fragmentation. For high throughput, increase the UART baud rate, set the flush size to 1,460, and set the flush timer to a
large value so that full IP packets are sent.
You can control packet forwarding in the following ways:
•
set comm match
<
value
> sets the value of the packet terminator. Each time the module sees the match
character it sends an IP packet. For example,
set comm match 0xd
forwards a packet when the module sees a
0xd
hex character.
•
set comm size
<
value
> sets the flush size, where <
value
> is the number of bytes received before forwarding.
The maximum is 1,460 bytes, which is the size of a single Ethernet frame.
•
set comm time
<
value
> sets the flush timer, which is used to flush any partial data sitting the RX buffer if no
additional data is received for <
value
> ms. For example the
set comm time 1000
command causes the module
to wait for 1 second after no data was sent.
If the module will be sending more than a few hundred thousand bytes in a single transaction, you should enable hardware
flow control. Your hardware must actively monitor the CTS pin. Flow control is not enabled by default; you set it with the
set uart flow 1
command.
It is possible to operate higher baud rates (i.e., greater than 115 K) without flow control if the packets are uniform and you
use an application protocol to ensure that the packet data is delivered on the remote side before the next packet is sent.
However, given the uncertainty of packet delays in a TCP/IP network and the affects of interference and retries inherent in
wireless networks, flow control is typically required whenever large, contiguous quantities of data are being written to the
UART to guarantee no data is lost.
Setting GPIO Direction, Alternate Functions & Disabling LEDs
You can control the GPIO pin direction with the GPIO mask using the
set sys mask
<
value
> command, where <
value
> is
entered as a hex number. The hex number represents a bitmask that controls each pin, where 1 = output and 0 = input.
For example:
set sys mask 0x0
// Sets all pins as inputs
set sys mask 0xc0
// Set only GPIO6 and GPIO7
If you only need to set one bit in the mask, you need to read, mask, and set the value. Otherwise, you will overwrite any
previous GPIO settings.
The default mask for the RN-131 module is
0x20f0
, which sets GPIO13, GPIO7, GPIO6, GPIO5, and GPIO4 as outputs.
The default mask for the RN-171 module is
0x21f0
, which corresponds to the following settings:
•
GPIO0 - 3 are used internally on the module.
•
GPIO4 - 6 are LEDs.
•
GPIO 9 is reserved as the ARM factory reset/ad hoc mode (read at power up) and otherwise general-purpose
input detect pin.
•
GPIO10 - 11 are the UART RX and TX pins; TX does not need to be masked as an output.
•
GPIO12 is CTS (input), if used.
•
GPIO13 is RTS (output), if used.