This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MCP7940 drivers for nrf52840

We are working on external RTC MCP7940(i2c) interfaced with nrf52840. Please check if drivers of the same for nrf52/51 are available or any implementation of CLOCK using MCP7940 with NRF?

Regards

Vishal Aditya

Embedded Software Engineer

Parents Reply
  • Yes getting 0x80

    Below is the attached Arduino init sequence:

      Wire.begin();                               // Start I2C as master device
      Wire.setClock(i2cSpeed);                    // Set the I2C bus speed
      Wire.beginTransmission(MCP7940_ADDRESS);    // Address the MCP7940M
      uint8_t errorCode = Wire.endTransmission(); // See if there's a device present
      if (errorCode == 0)                         // If we have a MCP7940M
      {
        clearRegisterBit(MCP7940_RTCHOUR, MCP7940_12_24);                      // Use 24 hour clock
        setRegisterBit(MCP7940_CONTROL, MCP7940_ALMPOL);                       // assert alarm low, default high
        _CrystalStatus = readRegisterBit(MCP7940_RTCSEC, MCP7940_ST);          // Status bit from register
        _OscillatorStatus = readRegisterBit(MCP7940_RTCWKDAY, MCP7940_OSCRUN); // Oscillator state from register
      }
    MCP7940.h

    MCP7940.cpp

Children
Related