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

From this:

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);

1 Like

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

PMIC pmic; 
// pmic.disableOTG();

…based on a quick look at spark_wiring_power.cpp


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?

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.

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

1 Like

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 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.

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

1 Like