XBEEs can be used alone , without a microcontroller.This is called XBEE DIRECT.It enables projects that are truly wireless & saves space,power & cost of the project.
Tarang XBEEs have limited I/O pins.By default all I/O pins are DIGITAL OUTPUTs .Some of the pins can be configured as DIGITAL or Analog INPUTs.TARANG modules do not support Analog Output.
Besides transmitting data & changing state of digital pins , no logical decision can be made in XBEE Direct mode.
TARANG Module PIN Configuration :
As you can see above in the pin configuration there are 8 DIGITAL I/O pins out of which 6 are multiplexed for Analog Inputs. Two of the pins are multiplexed for serial hardware handshaking signals.
CTS – Clear To Send pin 12 /DIO7
RTS – Request To Send pin 16/DIO6.
In some cases, simple TX / RX connections are not enough to ensure your data gets delivered intact.In such cases ,Serial flow control can help make sure your data is not lost in transmission.
A transmitter raises its RTS line causing interrupt on Receiver , asking “ can I send Data “.
If Receiver accepts , it will assert its CTS line telling “ yes, you can send Data “.
Handshaking is enabled in Tarang modules using command ATSHS .By default it is 0 , meaning No Flow Control.Change it to 1 ( ATSHS1) to enable handshaking.Generally handshaking is not needed unless there is another microcontroller in the project.
Note that Signal Strength RSSI debugging light (pin 6) is not yet implemented in Tarang F4.
We shall use 2 Tarang F4 modems to test XBEE Direct functionality.
Following is the set up :
Pin 20 of first modem (Digital I/O 0) is pulled high using a 10k resistor to 3.3v supply & then a switch is connected as shown.
We shall declare this pin 20 as DIGITAL INPUT using command ATID.
Enter command mode by issuing +++.
Enter command ATID02 ,
AT is the command
I is I/O control category
D0 is the I/O pin to be configured (note it is D zero & not D letter O)
& finally 2 which represents Digital Input.
Do not forget to give ATGWR command to write changes to modem.
An LED is connected as shown to the second modem’s pin 20 through a 220E resistor to +3.3v supply.
Now if you press the switch at modem 1 , the condition of pin 20( DIO 0) is transmitted wirelessly to other end.The pin 20 of second modem goes low , lighting the LED.
Watch this support video :