Xiao nRF52840 project works when powered with 5V, not with battery or 3.3V

Hi, I’m trying to use a Xiao nRF52840 to drive an e-paper display panel, and I have the panel’s Vcc pin connected to the Xiao’s 3V3 pin (the panel takes 2.5V to 3.6V, with 3.3V being the typical supply voltage).

If I power the Xiao with USB, the display works. If I power it by supplying 5V to the 5V pin, the display also works. But if I connect a LiPo battery (currently supplying 4.1V) to the BAT terminals, I can see that my code on the Xiao runs, but the display doesn’t work. There is 3.3V on the 3V3 pin, as expected. And same if I just directly supply 3.3V to the 3V3 pin–my code runs, but the display doesn’t.

Any ideas why this is happening? I see from the schematic that both Vbus and Vbat go to the 3.3V regulator and that 3.3V goes to power everything else. So it seems like there should be no difference if I supply 3.3V directly or have Vbus get converted down to 3.3V.

So I’ve already checked that power is getting to the display panel; I guess my next step can be to see if what’s being sent over the SPI data lines is correct, but I don’t get how that would change depending on how the Xiao is powered.

Edit to add: while I haven’t checked the data going to the display yet, I did find that if the Xiao is powered on or reset while being powered with 5V (either USB or the 5V pin), I can disconnect the 5V and leave it powered by the battery, and everything still works.

Perhaps there is a “while(!Serial)” in your sketch’s setup()?

1 Like

Hi,
I apologize for being late. What is your intended use case? What size e-paper display do you need to drive? E-paper has specific startup current requirements, and if these are not met, it may not function properly.

Best Regards!

I’m not using Serial; I’m using the LEDs to show status. And it works without USB connected if I supply power on the 5V pin.

Are you using this device?

I just want to show pictures on the display. It’s a Waveshare 5.65 inch 7-color panel. If the problem was current, wouldn’t that show up when powering via USB, since current could be limited by the 3.3V regulator? But not when powering directly via the 3V3 pin, since the panel is getting its power directly from the power supply (which can supply enough current… the same supply set to 5V can power everything when connected to the Xiao’s 5V pin).

No, I’m using Waveshare’s driver board, which I’ve been using for a while (I’ve had my project working with an Arduino Nano 33 BLE, but wanted to see if I could switch to the Xiao nRF52840)

1 Like

Hi there,

Can you post a picture of the setup?, You’re close it will work.
stay with it. (worth it for the sleep current 2~4 uA) :wink:
You may need a capacitor on the display Power line. the start up current is substantial , you won’t get a good POR (power on reset in the display)
the other methods of power connection you tried allow for Higher inrush current than the Lipo circuit (battery charger may be getting in the way):grin: the limit on charge current.

Your last edit , Kinda bears that out…

HTH
GL :slight_smile: PJ :v:

ps, I think waveshare has some info on this on their forum. :v:
I don’t like to use the 3.3v pin on Xiao to power anything but Temp/Humid sensors real light loads with no startup slurp job YMMV

1 Like

You can try to power up the Xiao with the LiPo battery while also connecting the USB (or 5V).It will ensure the regulator receives a good initial voltage to stabilize. Once the system is running, disconnect the USB or 5V to see if it continues working.

1 Like

Can you post a picture of the setup?

Sure, it’s hard to see where all the wires go though. Here are the pin connections

  • 5V: power supply red lead
  • GND: breadboard - rail, display GND
  • 3V3: breadboard + rail
  • MOSI: display DIN
  • SCK: display CLK
  • D0: display CS
  • D1: display DC
  • D2: display RST
  • D3: display BUSY

The breadboard + rail is connected to display VCC. The breadboard - rail is connected to the power supply black lead. There’s a 440µF 10V capacitor across the breadboard +/- rails.

To simplify the scenarios, let’s just look at supplying 5V and 3.3V from a bench PSU, with no USB or battery involved at all.

https://azeotrope.org/xiao_epaper5v.mp4 shows it being powered with 5V. The Xiao LED turns blue when my code starts running, then yellow after it’s sent the command to clear the display and while it’s waiting for the display’s BUSY line to become non-busy. You can see when it turns yellow, the display starts to flash.

Then https://azeotrope.org/xiao_epaper3v3.mp4 shows it with the PSU set to 3.3V and connected to the breadboard + rail. The only changes are that the PSU red lead has been moved from the red wire that goes to the 5V pin to the yellow wire that goes to the breaboard + rail, and the PSU voltage set to 3.3V. Nothing is connected to the 5V pin. You can see the LED turn yellow, showing that it’s sent the clear display command, but nothing happens to the display.

You may need a capacitor on the display Power line

Yeah, I have one.

battery charger may be getting in the way

I wouldn’t think that the charger would be involved when not charging. The VBAT just goes through the MOSFET for power path selection and then to the 3.3V regulator, right? But in any case, the problem occurs when powering with an external 3.3V source, so neither the charger IC nor the 3.3V regulator are involved.

Hi there,

OK, so check out the E-ink Demo I have on here,
may or may not add anything useful :crossed_fingers:

I think you need to toggle a pin before the reset or something, let’s see the code, You are using the SPI interface pins, some of the pins derive their power from different power group sections of the chip. perhaps that is only resolved if you toggle the Pins first before you use a “begin spi” type situation. If any of that makes sense to you. I had to do something similar if I recall to finally get it to work, or added a delay in the setup to give the slow interface a chance I think :v:

HTH
GL :slight_smile: PJ :+1:

Stay at it , you are going to get it going.

LOOk here this was the most helpful.

nice screen! I know we have heard of people having problems when powering thru the 5v and 3.3v pins… I have always said the 3v3 pin is designed as a supply not a point of intake… but people call me a lier and dumb all the time…

I cant think of any reason the power would do this other that a voltage - current issue… you already checked the while serial thing so as long as the processor is working and not hung in a setup loop… it must be power… if you have a variable power supply try applying 5v on the pin and letting the internal regulator produce the 3v3