Skip to content

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

Open
@g6094199

Description

@g6094199

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: enhancementProposed improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions