Skip to content

softReset does not clear shadow registers #22

@t6z

Description

@t6z

The softReset function only clears the SW_RST bit after initiating a soft reset. I believe it should reset all four shadow registers to zero. According to the datasheet:

Writing “1”will cause the part to reset, similar to power-up. It will clear all registers and also re-read OTP as part of its startup routine. The power on time is 10mS.

Image

bool SFE_MMC5983MA::softReset()
{
// Set the SW_RST bit to perform a software reset.
// Do this using the shadow register. If we do it with setRegisterBit
// (read-modify-write) we end up setting the reserved and BW_0 bits too as they
// always seems to read as 1...? I don't know why.
bool success = setShadowBit(INT_CTRL_1_REG, SW_RST);
clearShadowBit(INT_CTRL_1_REG, SW_RST, false); // Clear the bit - in shadow memory only
// The reset time is 10 msec. but we'll wait 15 msec. just in case.
delay(15);
return success;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions