Feather nRF52840 Express usb connection problem

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
dcsleep
 
Posts: 5
Joined: Thu Sep 17, 2015 2:33 pm

Feather nRF52840 Express usb connection problem

Post by dcsleep »

I have a Feather nRF52840 Express board which seems to work fine when no battery is connected. When I connect it to my Mac (Mojave 10.14.6) via USB a serial device appears as expected (/dev/cu.usbmodem14601). Double-pressing the reset button causes a drive to appear in Finder. My Arduino application runs fine.

However when I connect a LiPo battery this behavior changes. My Arduino application runs fine. But no serial connection is created when the board is connected via USB. Double-pressing the reset button has appears to lock things up as the NeoPixel stays red instead of turning green as it does when the battery is not connected. No serial connection or drive appears on my Mac. Single-pressing reset causes a reset so the application runs again but still no serial connection via USB.

The board is running the latest version of the bootloader (UF2 Bootloader 0.6.1) and I have the latest CP210x VCP Mac OSX Driver (v6.0.1) installed.

Any ideas? It's annoying to have to disconnect the battery to make application changes.

User avatar
adafruit_support_mike
 
Posts: 67459
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather nRF52840 Express usb connection problem

Post by adafruit_support_mike »

The LiPo shouldn't make any difference as far as the USB connection is concerned.

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

User avatar
dcsleep
 
Posts: 5
Joined: Thu Sep 17, 2015 2:33 pm

Re: Feather nRF52840 Express usb connection problem

Post by dcsleep »

I agree - the LiPo shouldn’t make any difference. I tried it again today after rebooting my Mac just to make sure and it shows the same behavior.

I tried my best to take a good picture of the connections.
wiring.jpg
wiring.jpg (138.62 KiB) Viewed 512 times
It's hard to see what's going on so here’s a description in addition to help clarify the picture:

* SPDT slide switch wired across EN and GND to power the board on/off. It doesn’t make any difference in the behavior whether the switch is on/off before connecting via USB. I’ve tried both ways.

* A3144 Hall effect sensor wired to 3V, GND and A1 (with a pullup resistor wired to 3V).

* LED wired to A3 (inline current limit resistor) and GND.

This is used to measure RPM using a magnet attached to a wheel.

Hope this helps.

User avatar
adafruit_support_mike
 
Posts: 67459
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather nRF52840 Express usb connection problem

Post by adafruit_support_mike »

Thanks. That’s all pretty straightforward, and the polarity of the battery cable looks right. I don’t see anything that should interefere with USB.

What voltages do you see on the BAT and USB pins when you connect the LiPo before connecting USB, then connecting the LiPo after connecting USB?

User avatar
dcsleep
 
Posts: 5
Joined: Thu Sep 17, 2015 2:33 pm

Re: Feather nRF52840 Express usb connection problem

Post by dcsleep »

When running off the LiPo before connecting USB, the BAT pin is 3.96V and the USB pin is 3.35V. After plugging in USB (LiPo connected), the BAT pin is still 3.96. However the voltage on the USB pin fluctuates wildly between about 0.25V and 1.00V (like it's floating). The charging LED is not lit.

When running off USB with the LiPo disconnected, the BAT pin is 4.13V and the USB pin is 5.21V. The charging LED flickers and everything appears fine.

When the LiPo is plugged in after the USB the BAT pin is 3.96V and the USB is steady at 5.2V. The charging light is solid indicating the battery is charging.

I also tried plugging into a simple USB charger instead of my Mac with the LiPo connected. The charging light came on immediately and the voltage on the USB pin was steady at 5.17V.

So it appears that there's something going on when the USB is plugged with the LiPo is connected that affects the power provided from the USB port on the Mac. Perhaps something in the USB protocol? I assume this is done in the bootloader but just guessing.

User avatar
adafruit_support_mike
 
Posts: 67459
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather nRF52840 Express usb connection problem

Post by adafruit_support_mike »

dcsleep wrote:When running off the LiPo before connecting USB, the BAT pin is 3.96V and the USB pin is 3.35V. After plugging in USB (LiPo connected), the BAT pin is still 3.96. However the voltage on the USB pin fluctuates wildly between about 0.25V and 1.00V (like it's floating). The charging LED is not lit.
That’s unexpected.

The 5V line from the USB jack connects to the USB pin through a low-voltage Schottky diode. The LiPo connects to the USB pin through a p-mosfet oriented so current can flow through the protection diode to the rest of the circuit.

Given those two diodes, the USB pin voltage should never be more than about 0.6V lower than the LiPo or the USB 5V line.

If we assume something is wrong with the mosfet’s protection diode, the behavior you described could be possible if the USB cable’s line voltage was about 1.5V.. too low to power the board, but high enough to shut off the p-mosfet to the battery.

That would imply the computer’s USB port is shutting down when you plug the board in, and I’d expect OSX to complain about that.

User avatar
dcsleep
 
Posts: 5
Joined: Thu Sep 17, 2015 2:33 pm

Re: Feather nRF52840 Express usb connection problem

Post by dcsleep »

My MacBook Pro has USB-C ports. It’s my understanding that power is handled differently in the USB-C specification and may not be provided unless the appropriate signals are received. So it’s probably not strange that OSX doesn’t complain.

I noticed something else that’s interesting. The USB cable I’m using requires an adapter to convert the USB-A plug to USB-C. I usually leave the adapter on the end of the cable and just plug/unplug the adapter from my computer. However when the adapter is plugged in first and then the cable is plugged into the adapter the serial connection is consistently established (LiPo also connected). I tried several adapters (generic and one from Apple) and the behavior was consistent across all of them. I don't have a USB-C to Micro-USB cable to try (one on order).

It appears that there’s something weird going on in the way the board establishes the USB connection that occurs only when the LiPo is connected. Not sure why plugging the adapter in first changes things. I haven’t noticed anything like this with any other device using an adapter.

At this point it appears that I can reliably establish a USB connection without removing the board from the enclosure to disconnect the battery which is a win from a convenience perspective.

User avatar
adafruit_support_mike
 
Posts: 67459
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather nRF52840 Express usb connection problem

Post by adafruit_support_mike »

dcsleep wrote:It’s my understanding that power is handled differently in the USB-C specification
That’s an understatement.. IMO USB-C is what happens when a standards committee says, “Murphy’s law? Who ever heard of that?”
dcsleep wrote:Not sure why plugging the adapter in first changes things. I haven’t noticed anything like this with any other device using an adapter.
The adapter may be a USB-2 hub. That would block all of the USB-C messages and allow more standard connections.

That might be the easiest way to avoid the problem: put a cheap/old USB-2 hub between the computer and the Feather. It sounds like that should work reliably.

User avatar
dcsleep
 
Posts: 5
Joined: Thu Sep 17, 2015 2:33 pm

Re: Feather nRF52840 Express usb connection problem

Post by dcsleep »

I still don't understand why the behavior changes depending on whether the LiPo is connected or not. As I mentioned this happens with multiple adapters. To me this points to something going on within the feather board. I don't have another board to compare against so I can't determine whether I have a flaky board or if there's a design defect in the board/software.

User avatar
adafruit_support_mike
 
Posts: 67459
Joined: Thu Feb 11, 2010 2:51 pm

Re: Feather nRF52840 Express usb connection problem

Post by adafruit_support_mike »

It sounds like the problem is related to power negotiation between the Feather and the USB-C port.

USB-2 requires devices to run on one 'unit load' (100mA) when they connect to the host. A device can request up to 500mA during the enumeration process as it sets its operating parameters.

USB-3 has a whole sub-protocol for power negotiation (USB Power Delivery) that spans multiple voltages and currents. It sounds like your Mac isn't getting the response it wants, and shuts off power to the port. Then, for some reason, it holds the USB 5V line at a voltage too low to run the microcontroller and charge the LiPo, but high enough to shut off the p-mosfet that controls power from the LiPo.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”