USB-zigbee connection & programming - zigbee

I am sending ASCII character to USBport of laptop, need to give this ASCII as input to zigbee, which is to be used as a transmitter.How to accomplish this? what do i exactly need to use, USb to TTL dongle or xbee usb adapter board?
I need to transmit ASCII character using one zigbee and use another zigbee to receive the same i.e. i need to transmit and then receive the ASCII character using zigbee 2 zigbee. Then the output of receiving end zigbee is to be fed to microcontroller PIC16f628.
do i need to program both the zigbee for communication?
do i need to program receiving end zigbee to communicate with microcontroller?

You could take a look at this:
https://git.ti.com/znp-host-framework/znp-host-framework#more
It is an open source project that will run on Linux or an MCU, connected to a CC2538EM module via USB or UART. There is a dataSendRcv example application that will allow you to send ASCII messages between ZigBee nodes (running with Linux or MCU).
Regards,
TC.

Related

Two way Serial Communication not possible with Qt and Arduino

I am trying to do a sample application using Qt to communicate to Arduino board DUE.
But When one communication is started other is not able to connect,meaning when i start my Arduino first I am not able to start Qt application to read or write data and viceversa.
Can anybody tell me whether this is possible if Yes please help me in this and i ll try to post my sample code.
If I understand your question correctly, you want to be able to connect to your Arduino device (via its USB to RS232 converter) while the Arduino IDE, and thus, the serial monitor is running.
If that's the case, that is simply not possible. Not because of Qt, nor because of Arduino. That's the way serial ports work. You can't connect to the same port twice from different processes.
Since the microcontroller on the Arduino DUE has 4 UARTS, you may consider using one of them (with another USB to serial adapter, and thus, having another COM port showing up on your PC) to interface the board with your Qt application while the Arduino IDE is still connected to the "main" serial port.
Also, keep in mind that the Arduino Due works with 3.3 V, so ensure that the USB to serial adapter is compatbile with that voltage range.

Upload a HEX firmware to Arduino board

is it possible to upload a firmware to an ATMEGA328P aka Arduino Uno using a serial terminal like Putty or Coolterm?
I know that the Arduino is ready to receive a new firmware after a reset over USB, does the IDE (and avrdude) makes something different other than echoing the binary hex file over serial port?
Thanks
Theoretically, yes. It would be awkward, and you'd need to be able to send and receive arbitrary bytes within a strict time limit, before the bootloader gives up waiting, but you could do it.
The most common bootloaders for the atmega328 use Atmel's STK500 protocol, originally designed for their own AVR development boards but widely used elsewhere (such as on the Arduino). Documentation for this protocol can be found here.
Note that Optiboot, used on modern Arduinos, implements only a subset of this protocol.

XBee AT communication between PC and Arduino

I need to send data (an integer) from an Arduino to a C program on a PC. I know that the connection is fine, because with X-CTU works perfectly. I need to do this in AT mode but I don't know how to start.
If you're using the XBee modules in AT mode, then it isn't much different than what you'd have to do with a direct serial cable connection between the Arduino and PC. Look for sample programs demonstrating serial communications for both platforms.
Having the connection working with X-CTU is an excellent starting point, since you have confirmed that the radio modules are communicating correctly.
On the PC, you might want to look at this Open Source XBee Host Library on GitHub. It includes a sample program called "xbee_term" that demonstrates a simple serial terminal for using an XBee in AT mode. It also has a layered API to allow for easy use of XBee modules in API mode -- which you would need to use if the PC was going to communicate with multiple Arduino nodes running in AT mode.
As for sending an int, you can use sprintf() to format it as a string to send over the wireless link, and strtol() to convert it back to an int on the PC end.

how to test serial port communication in windows with rxtx?

I am using RXTX with Java to connect to serial port. But now i have to test whether the communication is working properly or not? How to do this. Do i need modem or can we test any way in my local with out modem.
this is the program i want to test http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port
On Windows you can use a 'null modem emulator' called com0com. This registers 2 dummy com ports onto the OS, which will communicate between each other.
So, you'd need to connect to it 'twice', one for each end of the serial connection.
com0com also has variants called com2tcp & hub4com, if that's more appropriate for you.
HTH
Uh, no you don't need a modem(?). You can use a null modem serial cable to do loopback testing from one COM port to another. You can do this on a single PC or two different computers. If you don't have enough COM ports, use a USB to serial converter.

WinUSB driver for Arduino

I'm using an Arduino to read data from the web and display it. I can easily pass the data as serial using the supplied drivers, because they identify the COM port so I can send serial to the COM port.
However, I want to use 'real' USB techniques so the device can be plugged in and out like a normal USB device. I'm looking at using WinUSB as the driver. However, USB is all new to me. Is there an .inf file that uses WinUSB and an Arduino (I have an Uno)?
The lack of information on this is making me think I am going about this incorrectly.
Turns out that an Arduino Uno is not a genuine USB device.
It acts as a Serial to USB adapter. Consequently USB drivers don't talk to it.
I got round this by writing a sketch which reported back what device it was when it got the correct query from the PC.
On the PC I just iterated the Serial ports and sent the query to each port. The one that replied was the Arduino.
After that I record the port number and send serial data to the Arduino.
To learn the USB portion, maybe you could combine V-USB and the UNO?
Check out V-USB.
V-USB is a software-only implementation of a low-speed USB device for Atmel’s AVR® microcontrollers, making it possible to build USB hardware with almost any AVR® microcontroller, not requiring any additional chip.
While not necessarily Arduino, it may provide you the learning exprience you want, and let you use incorporate your UNO device.

Resources