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

setMinimumSystemVoltage: allow values below 3.0V on non LiPo #37

Open
g6094199 opened this issue Sep 26, 2023 · 0 comments
Open

setMinimumSystemVoltage: allow values below 3.0V on non LiPo #37

g6094199 opened this issue Sep 26, 2023 · 0 comments
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@g6094199
Copy link

g6094199 commented Sep 26, 2023

I see the min voltage for the sysvol setting is 3.0v. i can successfully run MKR WAN 1310 as low as 2.6-2.7V even with one sensor attached. i use 18650 which have 2.5V as min voltage. it is ok to uncharge up to 2.7v

so it would be nice to have the chance to set 2.7v as min voltage.

bool PMICClass::setMinimumSystemVoltage(float voltage) {

    int DATA = readRegister(POWERON_CONFIG_REGISTER);

    if (DATA == -1) {
        return 0;
    }

    byte mask = DATA & 0xF0;
    if (voltage > 3.7f) {
        voltage = 3.7f;
    } else if (voltage < 3.0f) {
        voltage = 3.0f;
    }

    return writeRegister(POWERON_CONFIG_REGISTER, (mask | ((round((voltage - 3.0) * 10) * 2) + 1)));
}
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

2 participants