Skip to content
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

incorrect documentation in lgt8f/libraries/lgt_LowPower/examples/powerDown-Dps2/powerDown-Dps2.ino #324

Open
whyameye opened this issue Oct 22, 2024 · 6 comments

Comments

@whyameye
Copy link

The documentation in powerDown-Dps2.ino states:
In DPS2 mode, no need to set up IOs against leakage current because all IOs have a weak internal pull-up resistor which automatically turned on. Thats why the built-in LED on the MiniEVB board will be glow dimly during sleep

This is not correct. Measuring the IO pins they are clearly floating when in DSP2 mode. I verified this running the example unaltered in several ways:

  • connecting any D port pin to GND through a 100K resistor and pin measures 0V when in DSP2
  • connecting any D port pin to Vcc through 100K resistor and pin measures Vcc when in DSP2
  • with nothing connected to the pin just touching the D2 or D4 pin with a probe from the multimeter sometimes wakes the MCU up from DSP2

The manufacturer's documentation (v1.0.5 English) confirms that the pull-ups will not be on. It states: In DPS2 mode, because of core voltage disable and register data lost, interface control status all resume to input status, all IO output drive and pull-up will disable.

I tested with a MiniEVB board and the built-in LED did not glow dimly.

I can submit a PR if you wish.

@dwillmore
Copy link
Collaborator

dwillmore commented Oct 22, 2024 via email

@whyameye
Copy link
Author

I'm happy to submit a PR but was just looking for some consensus and confirmation I didn't miss something obvious. @LaZsolt did such a good job putting this library together and they wrote the documentation so I especially was hoping for some confirmation from them before I go about changing things.

@LaZsolt
Copy link
Collaborator

LaZsolt commented Oct 22, 2024

Investigation is in progress...

@whyameye
Copy link
Author

I feel like I must be losing my mind.

I found issue #289 from previous me stating the exact opposite i.e. that the pins do go high when in deep sleep. So I tested another miniEVB and it acted the same as the first: pins were floating not high. Both of my miniEVBs were brand new unused before I tested. Then I tested on a 48 pin version and the pins went high when in deep sleep.

I'm not sure what to say except I'm sorry to be so confused and confusing. An inconsistency in hardware seems unfathomable and yet I don't have another explanation.

@dwillmore
Copy link
Collaborator

dwillmore commented Oct 22, 2024 via email

@LaZsolt
Copy link
Collaborator

LaZsolt commented Nov 17, 2024

I measured the current which flows through the glowing LED when DPS2 mode is on. It is between 3 and .8 microamps.
This current much lower than a pull-up resistor allows.
Not every LEDs can glow such a small current.
So 100K resistor easily can pull down to GND or pull up to VCC the pin voltage when DPS2 mode active.

Conclusion: The LED's glow is not caused by the internal pull-up resistance, but by other leakage currents come from of VCC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants