Battery Monitor

This section describes, how the battery monitor is configured and used.

Use Cases:


PHY_SET_BATMON

The battery monitor is configured with two parameters vrange and vthres. The voltage level vbatlow defines, at which level the battery monitor detects and signals a low voltage condition.

Parameters:
vrange This parameter can be {0,1} and adjusts the range of the parameter vthres.
vthres This parameter is in the range of {0,...,15} and adjusts the threshold voltage.
The trigger voltage vbatlow depends on the values of vrange and vthres:

inline_mscgraph_24
Code example
    /* AT86RF212::[ACTIVE] */
    trx_bit_write(SR_BATMON_HR, vrange);
    trx_bit_write(SR_BATMON_VTH, vthres);

PHY_SIGNAL_BAT_LOW

If the supply voltage drops below the configured threshold voltage vbatlow, the TRX_IRQ_BAT_LOW interrupt is generated. It is recommended to mask this interrupt after its first occurrence, because otherwise an IRQ flood can happen. This interrupt should not be reenabled before the voltage threshold is reprogrammed or the power supply has stabilized.

Due to the variable power consumption of the radio transceiver in different states, it may happen, that after an TRX_IRQ_BAT_LOW interrupt the sequence PHY_GET_BATMON_STATUS returns with OK. Nevertheless, the IRQ should be interpreted as an early indicator for low battery capacity. The battery capacity should be monitored more carefully from this point in time.

inline_mscgraph_25
Code example
    /* AT86RF212::[ACTIVE] */
    /* TRX_IRQ_BAT_LOW occurs here */
    msk = trx_reg_read(RG_IRQ_MASK);
    msk &=0x7f;
    trx_reg_write(RG_IRQ_MASK, msk);

PHY_GET_BATMON_STATUS

inline_mscgraph_26
Code example
    /* AT86RF212::[ACTIVE] */
    batstat = trx_bit_read(SR_BATMON_OK);

Generated on Mon Aug 17 13:34:59 2009 for SWPM AT86RF212 by  doxygen 1.5.6