LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB Low Level commands (embedded Linux, terminal commands) (https://www.linuxquestions.org/questions/linux-newbie-8/usb-low-level-commands-embedded-linux-terminal-commands-4175444158/)

JonCombat 01-04-2013 10:43 AM

USB Low Level commands (embedded Linux, terminal commands)
 
I am a Linux newb. I need to test a USB port on a device. I would like to test it like a comport (short tx/rx together, send char, read char). Is it possible to send a char or just to toggle the tx line high so I can measure the status change? Also, to does a command exist to simply read the status of the RX line. Here are my usb devices
root@TSSC:/$ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 002 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 0424:7500
root@TSSC:/$

theNbomr 01-04-2013 12:52 PM

You could do what you are proposing iff there was some sort of device which looks like a serial port plugged into the USB port. USB, in and of itself, is a bus used by other devices. The device drivers that use USB provide the mechanism for sending and receiving data. There are a couple of USB-Serial chips that are well supported in Linux; FTDI is one, and the other eludes my recollection at the moment. There is no userspace software that I know of that lets you control (send & receive data) the USB bus itself directly.

--- rod.

onebuck 01-05-2013 02:34 PM

Member Response
 
Hi,

You can look at: Introduction to FTDI bitbang mode
Quote:

It was an interface that launched a thousand hacks. Near trivial to program, enough I/O lines for useful work, and sufficiently fast for a multitude of applications: homebrew logic analyzers, chip programmers, LCD interfaces and LED light shows, to name a few.
Today the parallel printer port is on the brink of extinction (and good riddance, some would say). Largely rendered obsolete by USB, few (if any) new peripherals even include a parallel connector, and today’s shrinking computers — nettops, netbooks, media center PCs — wouldn’t have space for it anyway. That’s great for tidy desks, but not so good if you enjoyed the dirt-cheap hacks that the legacy parallel port made possible.
You can use USB FTDI TTL-232 cable - TTL-232R 3.3V from Boardino;
Quote:

This is a FTDI FT232RL usb/serial chip embedded in a cable that has a 6-pin socket at the end. These are perfect for use with a Boarduino, Meggy's, or other Arduino clones, and Fuzeboxen. Useful whenever you want to communicate with a TTL serial device, such as an XPort, GPS, XBee or SIM module through a breakout board. The version we have is the 3.3V. The data signals are at 3V and the power line provides 5V. We suggest this for any product that needs FTDI cables. Because the cable is 5V compliant, you can use it with 3v or 5v logic just fine - no level shifting required!.
If you have a device that is running at 5V logic and requires 5V power, this cable will work fine.
If you want to tweak the voltages and signals a little, you should also check out the FTDI friend
You can download the drivers and datasheet direct from FTDI
If you want a hardware solution then 'Boarduino is an Arduino clone'

HTH!


All times are GMT -5. The time now is 07:33 AM.