Library to easily communicate with XBee modules.

Dependencies:   DigiLogger

Dependents:   WaterLogger XbeeGateway XBee_Cooker ProjetReceiver ... more

You are viewing an older revision! See the latest version

Serial hardware flow control

The XBee constructor 'rts' and 'cts' parameters determine the hardware flow control in the serial connection between the mbed processor and the XBee module. Each of the parameters can be set to 'NC' meaning not connected or to an actual mbed module pin, leading in following 4 combinations:

rtsctsFlow Control
NCNCNo flow control
configuredconfiguredRTS and CTS
configuredNCRTS only
NCconfiguredCTS only

If rts pin is configured, then that pin has to be wired from the mbed module to the RTS# pin of the XBee module (pin 16); and the XBee module DIO6 has to be configured accordingly ("D6" at command set to 1).
If cts pin is configured, then that pin has to be wired from the mbed module to the CTS# pin of the XBee module (pin 12); and the XBee module DIO7 has to be configured accordingly ("D7" at command set to 1).

Information

The XBee constructor checks that the XBee module DIO7 and DIO6 are configured accordingly. If not you will see errors like 'Bad CTS configuration. Radio 'D7' param is x and should be 1'

Information

From the XBee module point of view, CTS# is is an output and RTS# is an input.

Example: In following example we'll use a Arch-Pro board:

We create an XBeeZB object specifying to use the mbed pin P0_4 as rts pin and P0_5 as cts.
Additionally, P2_13 is used to reset the XBee module:

XBeeZB xbee = XBeeZB(P4_28, P4_29, P2_13, P0_4, P0_5, 115200);


/media/uploads/hbujanda/rtscts_all.png


All wikipages