Battery Monitor

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

The following sequences are defined:


PHY_SET_BATMON

The battery monitor is configured with two parameters vrange and vthres. The voltage level ubatlow 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 has a range from 0...15 and adjusts the threshold voltage.
The trigger voltage ubatlow depends on the values of vrange and vthres:

inline_mscgraph_65
Code example

PHY_SIGNAL_BAT_LOW

If the supply voltage drops below the configured threshold voltage ubatlow, the TRX_IRQ_BAT_LOW interrupt is generated. It is recommended to mask this interrupt after its first occurence, 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 current 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 a signal, that the battery capacity starts to become low and should be monitored more carefully from this point in time.

inline_mscgraph_66
Code example
    /* 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_67
Code example

Generated on Fri Aug 10 16:10:06 2007 for SWPM AT86RF230 Rev. A by  doxygen 1.5.2