Mahonroy
Posts: 15
Joined: Sat Mar 07, 2020 12:05 am

CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Sat Mar 07, 2020 12:11 am

Hello, I am designing a circuit board using the CM3+. I have pins USB_DP(165) and USB_DM(167) connected up to a LAN9512 for ethernet functionality..... but I also need to be able to connect a PC up to it and have it show up as a mass storage device for configuration (slave mode). In this case, you would typically run USB_DP(165) and USB_DM(167) directly to D+ and D- of a micro USB-B connector (not connected to LAN9512).

How do you have both? And how should the USB_OTGID (168) function in this case?

Thanks and any help or advice is greatly appreciated!

plugwash
Forum Moderator
Forum Moderator
Posts: 3766
Joined: Wed Dec 28, 2011 11:45 pm

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Sat Mar 07, 2020 1:11 am

The controller on the BCM283x can't be both a host and a device at the same time.

If you want both host and device functionality, but not at the same time, then you will need to use a USB mux IC, like the FSUSB42UMX used on the CMIO board triggered by the VBUS on the slave connector. You probablly also want to add a transitor to pull the OTG_ID pin low when using the port in host mode (they didn't bother on the CMIO since the device mode was only used for booting).

fuwen0202
Posts: 18
Joined: Sat Mar 07, 2020 12:51 pm

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Mon Mar 09, 2020 2:07 pm

I used a hub ic named fe2.1,then use lan9500 for lan

Mahonroy
Posts: 15
Joined: Sat Mar 07, 2020 12:05 am

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Mon Mar 09, 2020 5:06 pm

Thanks for the info!
I am reading that the compute module (CM3) already has this FSUSB42UMX chip on-board is that correct? In that case I wouldn't need to put that in my circuit board?

aBUGSworstnightmare
Posts: 4902
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Mon Mar 09, 2020 5:24 pm

Mahonroy wrote:
Mon Mar 09, 2020 5:06 pm
Thanks for the info!
I am reading that the compute module (CM3) already has this FSUSB42UMX chip on-board is that correct? In that case I wouldn't need to put that in my circuit board?
no, it's on the CMIO --> you need to put in on your baseboard

Mahonroy
Posts: 15
Joined: Sat Mar 07, 2020 12:05 am

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Mon Mar 09, 2020 5:34 pm

I looked up the schematic for the CMIO, and I found that it uses the FSUSB42UMX chip. So would I want to do it just like this, only instead of routing the "HOST" portion to a USB-Type A connector, to instead rout this to a LAN9512 chip, which will give me ethernet capability (and additional USB ports but I won't need them).
cm3_1.jpg
cm3_1.jpg (183.74 KiB) Viewed 1284 times
I also noticed this on the CMIO design, is this typically how you would want it to work?
cm3_2.jpg
cm3_2.jpg (182.37 KiB) Viewed 1284 times
Thanks again for the help!

ag2000ir
Posts: 5
Joined: Tue Jul 09, 2019 2:35 pm

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Fri Mar 27, 2020 2:01 pm

Correct, you can use the FSUSB chip as shown to switch between 2 modes.

Mahonroy
Posts: 15
Joined: Sat Mar 07, 2020 12:05 am

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Wed May 06, 2020 6:01 pm

plugwash wrote:
Sat Mar 07, 2020 1:11 am
The controller on the BCM283x can't be both a host and a device at the same time.

If you want both host and device functionality, but not at the same time, then you will need to use a USB mux IC, like the FSUSB42UMX used on the CMIO board triggered by the VBUS on the slave connector. You probablly also want to add a transitor to pull the OTG_ID pin low when using the port in host mode (they didn't bother on the CMIO since the device mode was only used for booting).
The USB_OTGID pin was the only thing I couldn't quite figure out.

So when using the Ethernet in host mode, this should be low. If using the USB and having the device show up as a usb mass storage device, do I want to pull the USB_OTGID pin high? The manual says that if its fixed slave or fixed master to tie the pin to ground, so its a bit confusing.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1731
Joined: Sat Sep 10, 2011 11:43 am

Re: CM3+ - Connecting LAN9512, but also get USB Slave functionality?

Thu May 07, 2020 6:42 am

Drive pin to ground for host mode (CM is a host and will talk to devices)
Open circuit pin (there is an internal pull-up to 1v8) for device mode (CM is a device and will respond to an external computer)
Gordon Hollingworth PhD
Raspberry Pi - Chief Product Officer

Return to “Compute Module”