How to enable OTG on the PMID to provide 5v from battery

electron
Tags: #<Tag:0x00007f1ca8de64f0>

#1

From this: https://docs.particle.io/datasheets/cellular/e-series-datasheet/#pmid

PMID
This pin is the output of the internal boost regulator of the PMIC that can source 5.1VDC from the battery in OTG (On The Go) mode. This feature is useful when your circuitry needs a 5V source from the E series module when powered by the battery alone.

Does anyone know how to enable this functionality? Is it just as simple as:

bool enableOTG(void);

https://docs.particle.io/reference/device-os/firmware/electron/#enableotg-


#2

No experience with using OTG, but it appears this should work:

PMIC pmic; 
pmic.begin();
pmic.enableOTG();
// pmic.disableOTG();

…based on a quick look at spark_wiring_power.cpp


#5

There seems to be something strange with the OTG behavior.

Powered and turned on with USB input of 5.0V, the PMID pin reads 4.6V.
Remove the USB power supply, now the PMID reads 3.6V

If I restart the device while in battery, NOW the PMID reads 5.1V
Now if I plug in the USB power that pin still reads 5.1V.

Why does it not initalizae to 5.1V when its turned on with the USB supply?


#6

You know, you can edit posts that you have already committed?
There is no point to have three posts in a row of which the first two don’t really mean anything.
I have incorporated the first two quotes in your last post and deleted the previous ones.


#7

I tried to delete them in a rush but it didnt allow me to. Im currently working on a huge bug in my product that 1200 people have. I’ll take note of the that though. Thanks


#8

I don’t think that it’s supposed to.

The PMIC chip is pretty sophisticated. You answer is likely in the datasheet.

(Just an initial guess) - Boost Mode is used when you’re on Battery Power Only, according to Section 8.3.1.5. Boost Mode wouldn’t normally be needed when USB source is available.

Read the Registers as shown in spark_wiring_power.cpp after you change your input source and follow along in the PMIC datasheet.

I could be way-off-base. Hopefully someone with experience using the PMID pin on the E-Series can help.

If you can explain what you need to accomplish, people here might have other suggestions besides the PMID pin.


#9

I figured it out, I just need to enable it when there is a change to the power source