Nrf52840 one wire protocol usage with MAX17211 IC.

Hello Everyone,

                     I am trying to implement one wire protocol for interfacing MAX17211 fuel guage IC with NRF52840. I wand to know if there is any one wire library or any example which we can use to read the registers of MAX17211. Can we read the registers of MAX17211 directly from the data pin??Or we have to follow some particular signal pattern to read the data?

Thanks & Regards,

Snehal.

Parents Reply
  • Hi Vidar,

               Actually the IC which we are using(MAX17211)  in our hardware supports only 1 wire. I asked the Maxim support team if we can communicate via I2c, so they replied that MAX17211 can be communicated using only One wire protocol. How can it be implemented in NRF52840 ??

    I saw the link which you had shared so driving the bus high and low and giving the reset pulse is possible with appropriate delays. That can be done. But if I want to read any register from the MAX17211, how to do that? How to sample the bus to read the data from a particular register?? 

    Also can I use this library "">github.com/.../Nordic-DS18B20" to read data from MAX17211?? will have to modify reg values?? Is it possible? 

    Regards,

    Snehal.

Children
  • Hi Snehal,

    I see. At first glance it looked like all the variants had i2c support.

    Timing requirements, communication sequences, etc. are documented in the datasheet (starting on page 104 - section 1-Wire Bus System (MAX17211/MAX17215 Only)), and you may have to implement this yourself. I am not aware of any third party examples for this IC.

    sne_333 said:
    Also can I use this library "">github.com/.../Nordic-DS18B20" to read data from MAX17211?? will have to modify reg values?? Is it possible? 

    It may serve as a starting point. You will still need to make sure the timing is correct and implement the command sequences to control the chip.

    Regards,

    Vidar

  • Hi Vidar,

                Thank you so much for your reply. I am trying to implement the above shared code in my project for MAX17211. I will check the timings for sure. Now I had one question. The github code shows how to read temperature from READSCRATCH method(Reading the Scratch Pad Memory). The Scratch Pad memory provides the user with all the necessary device data including temperature, TH and TL programmable thermometer settings, as well as the Count Remain and Count Per C data used in fractional temperature measurements. The CRC byte is also included in Scratch Pad memory. This was for temperature sensor. If I want to read another register from MAX17211, how to read that register?? I can't use the scratchpad method as I directly want to read the register. Will I have to use it this way?? 

    ds18b20_send_byte(0x00A);

    uint16_t data =ds18b20_read_byte();

    Is this the right way to read register?

    Regards,
    Snehal

  • Hi Snehal,

    The read and write sequences seem to be well documented in the datasheet. For instance, Figure 82 on page 109 which show the communication sequences. There's also guide for the SW implementation for this sensor here: https://www.maximintegrated.com/en/design/technical-documents/userguides-and-manuals/6/6260.html

    sne_333 said:
    Scratch Pad memory

    I'm not familiar with the driver, but isn't it just a buffer to hold the received data?

    Regards,

    Vidar

  • I am not sure. I am really going in circles on how to read data from MAX17211. Can you please help me. I want to read data 0x06h REPSOC. I am using the below function but I am not able to get proper values

    float max1720x_getSOC1()
    {
    unsigned char check;

    check=max17211_reset();
    if(check)
    {

    max17211_send_byte(0xCC); //skip rom command
    max17211_send_byte(0x69); //READ command
    max17211_send_byte(0x06); //SOC REGISTER
    max17211_send_byte(0x00); //SOC REGISTER
    max17211_reset();
    //val1=max17211_read_byte();
    val1=OneWire_read(); //read_byte();
    }

    soc = (double)val1/256;
    return soc;

    }

    Your help will be appreciated.

    Thanks & Regards,
    Snehal

  • I think you need a logic analyzer or oscilloscope if you don't have one already and confirm if the transaction meet the timing requirements outlined in the datasheet. It will be difficult to do much troubleshooting without it.

    Regards,

    Vidar

Related