chipKIT® Development Platform

Inspired by Arduino™

USB Device (YotaPhone) is not compatible with WF32 at all

Created Wed, 14 May 2014 06:46:13 +0000 by benderamp


benderamp

Wed, 14 May 2014 06:46:13 +0000

Hello,

I am continuing experiments with ChipKIT WF32 working as Android Accessory in USB Host mode as described here: http://chipkit.net/forum/viewtopic.php?f=16&t=2862

And I have met a very weird problem. WF32 does not work with one particular Android smartphone I have - YotaPhone (http://yotaphone.com).

The problem is not only with accessory mode, but at lower level - I am running debug application which prints info about any USB device attached to the board and all events on the USB bus: https://github.com/1i7/snippets/tree/master/chipkit-android-usb/chipkit_usbhost

I can attach 2 Android smarphones (Samsung and Htc) and also USB flash disk to WF32 - all they print some events to UART like:

USB event Application: VBUS REQUEST POWER: current=254, max current=500
USB HOST Initialize: address=1; flags=0
bLength=18, bDescriptorType=1, bcdUSB=512, bDeviceClass=0, bDeviceSubClass=0, bDeviceProtocol=0, bMaxPacketSize0=64, idVendor=0x4E8, idProduct=0x685E, bcdDevice=1024, iManufacturer=1, iProduct=2, iSerialNumber=3, bNumConfigurations=1

But YotaPhone does not generate any events at all (not even REQUEST_POWER or device attached) as if nothing was connected. I have also embedded callback to usb_host.c _USB1Interrupt(void) call and it looks like YotaPhone does not generate any interrupts on the USB bus.

YotaPhone works just fine when I connect it to PC. And even more - it works as USB accessory with ChipKIT Max32+NetworkShield just fine.

So,

  • WF32 + any USB or Anroid device (except YotaPhone) = OK
  • YotaPhone + Max32/NetworkShield = OK
  • WF32+YotaPhone = FAIL

Tested with 2 WF32 boards with same result. I have no idea what can be a reason of such incompatibility and how to digg it further, would appreciate any intput.


Jacob Christ

Fri, 23 May 2014 18:00:25 +0000

My guess is that there are some #defines somewhere that detect the Max32 but are not there for the WF32. There are things like this in the Ethernet library...

Is this you?

http://vimeo.com/95995808

Jacob


Jacob Christ

Fri, 23 May 2014 21:07:47 +0000

From Keith at Digilent via Jacob:

Okay this is way too complex to debug from a description. My first guess is:

that he is running the WF32 off of USB power (5v) and did not by pass the WF32 5v regulator, so the 5v bus on the WF32 is really running at like 4.2v which is then supplied to the cell phone and some will work at the degraded voltage, other will not. The option here would be to try by passing the 5v regulator to ensure a solid 5v going to the cell phone. By default, the WF32 has the 5v regulator engaged; even though by default the power source is from the FTDI USB (UART). We do not ship with the regulator bypassed because we want to make sure you don't blow something up if you switch to say an external 12v source and forget to engage the regulator.

My second guess is:

that one phone takes too much power and depending on how he is powering the WF32 (say from USB) he does not have enough power daisy chained through the WF32 from the PC USB to power the phone on the WF32 USB host connector. My first step would be to power the WF32 from an external power source and see if the cell phone will trigger the power event. If the external power source is a regulated 5v source, bybass the 5v regulator, if the external power source is greater than 5v, engage the regulator. You should only power with ether 5v (bypassed) or something greater than 7v to ensure enough headroom for the regulator to supply a solid 5v.

This is all based on that he is not getting a power on event; that is, the cell phone does not see good enough power.

KeithV


benderamp

Mon, 02 Jun 2014 10:39:04 +0000

It seems, that some of my posts during last days have disappeared from forum, duplicate.

http://vimeo.com/95995808

Yes, that's my video with Max32+NetworkShield and Yotaphone working together.

that he is running the WF32 off of USB power (5v) and did not by pass the WF32 5v regulator, so the 5v bus on the WF32 is really running at like 4.2v which is then supplied to the cell phone and some will work at the degraded voltage, other will not. The option here would be to try by passing the 5v regulator to ensure a solid 5v going to the cell phone. By default, the WF32 has the 5v regulator engaged; even though by default the power source is from the FTDI USB (UART). We do not ship with the regulator bypassed because we want to make sure you don't blow something up if you switch to say an external 12v source and forget to engage the regulator.

That was it! thank you. I have disabled 5V regulator by connecting VU pin to 5V0 pin directly on J16 and now WF32 and Yotaphone see each other and commuicate in Accessory mode.


Jacob Christ

Mon, 02 Jun 2014 21:09:37 +0000

Some kind of forum update happened over the weekend and some stuff may have gotten lost in the transition.

Jacob


benderamp

Sun, 10 Aug 2014 10:13:23 +0000

I have a bit more experiments here, some results.

  1. With 5V regulator enabled

1.1. When power from USB with 5V regulator enabled: tablet works, Yotaphone does NOT work

1.2. When power from external power source 4 AA batteries (1.5V*4=6V input) with 5V regulator enabled: tablet works, Yotaphone also WORKS

1.3. When power from external power source 7.4V LiPo with 5V regulator enabled: tablet works, Yotaphone also WORKS

1.4. When power from external power source 14.8V LiPo with 5V regulator enabled: both tablet and Yotaphone do NOT work: they show signs of life (I see notification about connected device and power inside Androdi OS), but this is all buggy (notification shows and hides several times in a second).

  1. With 5V regulator disabled (VU connected to 5V0)

2.1. When power from USB with 5V regulator disabled: tablet works, Yotaphone also works

2.2. When power from external power source 4 AA batteries (1.5V*4=6V input) with 5V regulator disabled: tablet works, Yotaphone also works

2.3. When power from external power source 7.4V LiPo with 5V regulator disabled: tablet works, Yotaphone does not work [color=#FF0000][that was risky][/color]

2.4. When power from external power source 14.8V LiPo with 5V regulator disabled: attaching USB device burned out USB host port on the board and probably something else (the board itself works after that - can be programmed from laptop, WiFi sketches also work, USB sketches do not work) [I should have read your comment more carefully]

So, for now I would say the following: always use 5V regulator when power board from external source unless you know what you are doing; disable 5V regulator only in case, if Android device does not show signs of life when power from USB (this would allo debug with serial monitor), and then enable it back when power from external source.

I would also recommend not to enable both UART and EXT jumpers at the same time - I have once burned out FTDI module after connecting USB device+external power source with bot UART=ON and EXT=ON, not sure if that was the real reason though.