bidouille
Posts: 2
Joined: Wed Apr 15, 2015 12:29 pm

USB slave <-> serial conector chip

Wed Apr 15, 2015 1:00 pm

Hi,

i'm trying to program my raspberry 2 as a usb slave.
(like some other people on the net, but nobody seems to have succed yet ...)

I need to handle the full usb protocol negociation => create the descriptors myself !
I've read many things about USB protocol, etc ...

So here is what i know :
The pi itself can't be used as a slave, because of the hardware (usb ports are connected to a hub, forcing host mode)
=> there is a usb OTG port (the mini usb port in fact) : pins not connected to anything and could be used, but that would neeed hardware modification on the board itself, so ... not a solution for me.

So usb on itself is dead, but the pi has serials interfaces (I2C and UART at least).
I was thinking about connecting one of these to a "magical external chip" (here is the trick) that would simply convert serial to usb
=> many chips do that (TTL cable for example), but theses handle the USB protocol themselfs (needs driver on windows, etc ...)
=> not what i need.

What i need is something like teensy (see there : https://www.pjrc.com/teensy/) : it can be used to create usb peripherical and let the user program the full usb protocol himself. That's perfect, but i'd like to programm the full stuff on the raspberry.
I may have understood that Teensy does have a serial port too, so i could maybe do something like
Pi <= Serial => Teensy <= USB => ...
But i'm looking for something simpler.

I say it again : i need a simple bridge between UART & USB : no intelligence : receive from one side, transmit to the other. that's all.

I may have found these that could maybe do the stuff, for what i understood :
http://www.microchip.com/wwwproducts/De ... e=en533924
http://www.st.com/web/catalog/sense_pow ... 4/PF122777

But I'm not sure that's what I need ...

Someone know about a good chip / card to do my stuff ?

PS :
Note that i'm experienced in computer programming, so kernel stuff and drivers are not a problem.
sorry for the many grammar mistakes i may/must have done : french guy talking ! Feel free to correct them.

fruitoftheloom
Posts: 21338
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: USB slave <-> serial conector chip

Wed Apr 15, 2015 6:48 pm

The RPi Model A & A+ do not use a USB/LAN Hub on the USB BUS

https://www.raspberrypi.org/documentati ... /README.md

viewtopic.php?f=63&t=15696
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12534
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: USB slave <-> serial conector chip

Thu Apr 16, 2015 12:26 am

the PI in principle uses USB-OTG hardware, but the only driver available uses it to create master mode only, and as all the B models have a hub behind the SoC's USB port this makes using the hardware for a slave mode interface impossible, this isn't true for the A models, but as you said nobody managed to use the to create a USB slave driver to use the OTG hardware options.

Its simply not doable it seems, although someone write a primitive (master) USB stack for bare metal, see the bare metal forum.

I would try other ways to create a USB slave device, for example a specific microcontroller with USB slave hardware, and software that talks serially with the PI, that seems a much easier solution

bidouille
Posts: 2
Joined: Wed Apr 15, 2015 12:29 pm

Re: USB slave <-> serial conector chip

Thu Apr 16, 2015 7:34 am

I would try other ways to create a USB slave device, for example a specific microcontroller with USB slave hardware, and software that talks serially with the PI
I agree, that's much easier : i found out a card that could make it, teensy, and a few chip (see original question for links)
I was wandering if someone knew about a good/better chip ?

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: USB slave <-> serial conector chip

Fri Apr 17, 2015 11:11 am

bidouille wrote:I say it again : i need a simple bridge between UART & USB : no intelligence : receive from one side, transmit to the other. that's all.
An FT232 from http://www.ftdichip.com/ (as in the TTL cables you mention) does exactly this. I'm not sure why you need to handle the USB protocol yourself if that is really all the functionality you need.

That said, you could look at the ARMinARM or AVRPi-32U4 boards I'm selling (http://www.onandoffables.com). They're both capable of being programmed as a USB HID and take commands from the Pi over I2C, SPI or USART. Like a Teensy, but integrated on the Pi.
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

pingaaas
Posts: 14
Joined: Sat Oct 17, 2015 8:08 pm

Re: USB slave <-> serial conector chip

Sat Oct 17, 2015 8:13 pm

Hello bidouille! I am also trying to find a solution to use the RPi as an USB slave. Have you had any luck with this approach?

User avatar
adun
Posts: 102
Joined: Fri Mar 20, 2015 9:25 am
Location: Switzerland

Re: USB slave <-> serial conector chip

Sun Oct 18, 2015 2:05 pm

What about an Atmega32u4 from Atmel? It can act as a USB Slave and has an UART port that you can connect to the RPi.
The same chip is used in the Arduino Leonardo if you want start prototyping.
Or the Atmega16u2 which is used in the Arduino UNO as the USB-Serial bridge.
If you only need a UART to USB slave connection I would go for this.

Return to “Interfacing (DSI, CSI, I2C, etc.)”