-
Notifications
You must be signed in to change notification settings - Fork 39
GPIO pin and current consumption odd behavior #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi folks, Just to note that I also tested the MMDLCB and can confirm the high quiescent draw when the LDO that controls power to the microSD is disabled. @derekpickell, as Paul mentioned on the forums you should have a @PaulZC did you notice any jump in the quiescent draw of the OLA after you migrated to v2.x of the Apollo3 Core? Cheers, |
Hi Adam ( @adamgarbo ), I did indeed... On OpenLog Artemis: I haven't had time to investigate further... Cheers, |
PS. your Forum Post link is broken. ;-) |
Thanks, @PaulZC! The other Paul provided some additional information regarding the changes to SPI in v2.x on the forums. I'm seeing 18 mA when the LDO on the MMDLCB is disabled, while @derekpickell is seeing ~200 mA. I'm wondering if this is a different issue than with the OLA. Cheers, |
Finally got some time to look into this, and have found the root cause. Test1 : When you only switch ON and OFF the LDO (pin 33), the current usage is dropping (to 3.5mA in my case) when OFF. (pin 3 is low) I also have an external SD card reader. Also from Sparkfun (DEV-13743) that I connected to the header.
Test 4: Same test as test 3, and ** the current is dropping off** !!!! Looking at the LDO specification it has 60-ohm discharge resistors which are only set with LDO ENABLE is low. So it could draw current in low, but where is the positive input coming from that leak through the card? The 26mA in my case is caused by a resistor 126 ohm. Is it leak current coming through the card? YES, somehow... Test 6: Setting the card IDLE After a number of tests, I could prove that if the LDO is turned off (pin 33 LOW) and EITHER CS is HIGH or COPI is HIGH, it will cause the high current following from these lines through the micro SD card, through the discharge resistors of the LDO. By setting the pins in tristate you can solve/bypass this issue. No impact from CIPO (as one would expect), but also SCK was not having an impact. Still, I would advise following the same solution as for CS and COPI. Might it was my card. Also depending on the card type, vendor etc, you might see different current when LDO is turned off. Unlike V2, in V1.2.3 the IOM and pins are really reset. Use the sketch in the following way :
|
Hey @paulvha, reading thru this, it sounds like if the core properly de-inited the pins, there wouldn't be a problem here. So I need to find a way to properly implement setting this pins to tristate in SPI.end. |
hi Kyle, Yes, indeed. However, it is half the solution. We should actually do a proper de-init and shutdown of the IOM for both SPI and I2C. I worked on an OpenLog issue recently with I2C. sparkfun/OpenLog_Artemis#117. Many people like to use the low power capabilities of the Apollo3 chip. If you look at the issue that PaulCZ posted before in this issue. Much higher pwer consumption in V2 compared to V1. The root cause is not the LDO, as Openlog uses a FET. But looking at the Openlog V2 code, it is not even trying to power off the IOM for SPI and I2C as Openlog will "hang" on wake-up. With a couple of more changes, a complete solution could be possible. For I2C I have worked that out, I could spend a couple of hours this week to also find a similar solution for SPI. Have a look and let me know. regards, |
Hey Paul, This is great stuff! I admittedly haven't been monitoring the OLA issues, and it turns out that has been a mistake! I think it is interesting you have to call the _deinit function explicitly. It was my impression (that I am now finding to probably be wrong) that MbedOS used some C++ wizardry to stitch the de-init functions in with the destructors, such that you could just delete the object to deinit it. It seems like the intention, but it looks like this has been an issue for a while and isn't changing. This certainly complicates the implementation. -Kyle |
Hi Kyle, Mbed constant reminds me of a remark from a marketing manager who I used to work with during my active career in IT: The difference between us and competition? Well, it at least is good to know we are not alone to understand what is happening (or not happening). Will take time later this week to better understand. regards, |
Hi All,
Found a bug experimenting with the Sparkfun MMDLCB with v2 of the Apollo3 Core.
Issue: Essentially, when disabling onboard LDOs, I measure an increase in current consumption, not a decrease as expected (as in v1.2.3). These LDOs have an enable pin that when driven low should cut all power downstream to peripherals, such as SD sockets, which is what I was experimenting with), but this is no longer the case.
I'm attaching my code below where I observed this behavior. Opening this issue following posting to sparkfun forums here.
Thanks!
The text was updated successfully, but these errors were encountered: