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

How to see battery monitor.

I made boards with the nrf52832 chip and the MAX8808X chip. The MAX8808X chip has battery monitoring. But I do not know what to do. The number of GPIO pins connected to this chip is P0.03 and IN / OUT is IN. Is it possible to roughly match the source code below? If it is an input, it does not know how to receive the output. Please help me.

ret_code_t err_code;

nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
in_config.pull = NRF_GPIO_PIN_PULLDOWN;

err_code = nrf_drv_gpiote_in_init(BAT_CK, &in_config, battery_event_handler);
APP_ERROR_CHECK(err_code);

nrf_drv_gpiote_in_event_enable(BAT_CK, true);
Parents
  • Hello maK

    According to the MAX8808X datasheet the CHG pin can be used to monitor if the chip is currently charging the battery (fast charge) or if it is charging with trickle current or is powered down. The pin will be pulled low by the MAX chip when fast-charging, and will otherwise be high impedance (see page 5). The datasheet recommends a pull-up resistor for interfacing with an MCU. You could therefore connect a GPIO with an enabled pull-up resistor to monitor the status of the CHG pin. I have not found any other battery monitoring functionality mentioned in the datasheet, so if you find I have overlooked something please let me know.

    I don't quite understand how you have connected the nRF52832 to the MAX8808X. Do you have a schematic showing the connection between them?

    EDIT

    I see now you can use the Iset pin to control and monitor the fast-charge current. To monitor it you would need to use the ADC to monitor the voltage generated by the current output by the pin. The reference circuit for measuring the current can be seen on page 9.

    Best regards

    Jørn Frøysa

Reply
  • Hello maK

    According to the MAX8808X datasheet the CHG pin can be used to monitor if the chip is currently charging the battery (fast charge) or if it is charging with trickle current or is powered down. The pin will be pulled low by the MAX chip when fast-charging, and will otherwise be high impedance (see page 5). The datasheet recommends a pull-up resistor for interfacing with an MCU. You could therefore connect a GPIO with an enabled pull-up resistor to monitor the status of the CHG pin. I have not found any other battery monitoring functionality mentioned in the datasheet, so if you find I have overlooked something please let me know.

    I don't quite understand how you have connected the nRF52832 to the MAX8808X. Do you have a schematic showing the connection between them?

    EDIT

    I see now you can use the Iset pin to control and monitor the fast-charge current. To monitor it you would need to use the ADC to monitor the voltage generated by the current output by the pin. The reference circuit for measuring the current can be seen on page 9.

    Best regards

    Jørn Frøysa

Children
No Data
Related