The packet data will be sent out of the XBees Dout (serial) pin if RTS is low (if enabled).
The typical method is to have the arduino serial UART enabled and then trip an interrupt when data arrives in the arduino’s UART. The ISR then handles incoming serial data.
No, the arduino’s UART produces the interrupt internally.
You need arduino code to setup its UART for interrupt on receiving data.
If you connect the XBee Dout line to the arduino interrupt input this will tell the arduino that the XBee got data but this data would then be lost unless the interrupt handler does a serial ‘bit-bang’ receiver.
I want to do a program which keeps running all the time without checking if a packet was received. But, each time a packet arrives, it stops to do whatever it was doing and read the packet.
OK. Have the arduino’s UART produce an interrupt when data arrives. The interrupt is handled in an ISR that reads the data out of the UART and places it in a ring buffer. The ISR then sets a flag bit that the ‘main’ code loop that polls the flag bit to know when there is data to start processing the incoming packet.
I don’t use the arduino so don’t have any code you you. I use this method in PICs and other processors to handle serial data from a device like an XBee.