0

I am working on a project that requires a UHF reader development kit that can communicate using either RS232 or by USB. Via USB and a Serial terminal, I have been able to send commands to the reader as well as analyze its response.

My goal is to send these same commands to the reader, but through an Arduino Nano. My first instinct was to use the RS232, converting the signal via a MAX232. However, this is for a school project, and my advisor preferred I try to work with USB. I am familiar with UART communication, and I've been under the assumption that USB operates using UART.

I had purchased a USB converter that gives me access to the pins, but it had two additional pins than I was not expecting: CTS and DTR. I attempted to communicate despite these pins (just leaving them open, and connecting Rx, Tx, Vcc and GND as I normally would). When plugged into the UHF reader, the device did power on (as it draws power from the USB connection), however, it did not receive the output signal from the Arduino Nano.

I know that my baud rate and other settings are correct, because, as I have said, communicating via USB and a Serial terminal gives me no problems. My initial thought is that I need to properly connect the CTS and DTR pins, but immediately I could not find a good reference on how to do this, and I am not entirely convinced this is the issue. My other thought was that perhaps I am writing out my HEX values wrong from the Arduino, using a line similar to the following, where "UHF_Reader" is defined by SoftwareSerial:

UHF_Reader.write(0xAA);

However, it appears to me from research that this is indeed the correct way to output HEX values via serial.

My final attempt to resolve this was to connect the micro-USB from the Nano to the USB of the reader, and then use Software Serial in conjunction with the USB converter to analyze the output on a Serial terminal, while powering the Nano via a 5V power supply. However, since the reader draws power from the USB port, it did not even turn on when I attempted this (I am assuming that the Vcc can only be supplied from the USB end?). Regardless, this attempt proved useless as well.

If anyone can offer any advice, or point me towards any references for something similar, I would much appreciate it! I have spent a while on this, and I just can't figure out what the problem is.

For reference, the reader I am using is found here: UHF Reader

And the USB converter I am using is here: USB Converter

migrated from superuser.com Jan 3 at 15:28

This question came from our site for computer enthusiasts and power users.

0

I've been under the assumption that USB operates using UART.

No. You have it backwards. Devices can emulate a UART (known as CDC/ACM) over a USB connection as one of the many possible device profiles, but it is about as far from being a UART as an F1 car is from a Penny Farthing.

USB operates on a strict Master / Slave principle. That is, it has a single master device, called the Host, which coordinates all the devices on the bus and makes requests to them. Everything you plug into a USB system is a Device and requires a Host to tell it what to do.

Neither the Nano, nor this adaptor you bought, are Hosts. They are just Devices. And Devices cannot talk to Devices. Only Hosts can talk to Devices.

Which means you need a Host in there somewhere. If you want it controlled by Arduino then you need a USB Host Shield (or something similar) which normally communicates over SPI.

If the device you are trying to talk to uses the CDC/ACM profile then you can use the USB Host Shield with it. If it uses a proprietary profile, like the CH340G or FT232, then getting it to work with the USB Host Shield will be much harder (maybe even impossible) unless you are intimate with the underlying protocol used.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.