Post Go back to editing

"AD5940_WriteReg(REG_AFE_SWMUX, 1<< 1) " is Valid?

HI.

I have a question about some code in BATImpedance.cpp.

------------------------

AD5940_WriteReg(REG_AFE_SWMUX, 0);

or 

AD5940_WriteReg(REG_AFE_SWMUX, 1<< 1);

-----------------------

In the datasheet REG_AFE_SWMUX  (0x0000235C)

[2:0] reserved ,  3 only avaiable. 

Would you show me why 0 or 1 was used instead of 1<<3 ?

Parents
  • Hi,

    In the block diagram below:

    AIN2 measures RCAL impedance.

    AIN3 measures Battery impedance.

    REG_AFE_SWMUX[2:0] = 001; //enable common mode switch on AIN3

    REG_AFE_SWMUX[2:0] = 000; //enable common mode switch on AIN2

    REG_AFE_SWMUX[2:0] = 010; //disable common mode switch on both AIN2 and AIN3

Reply
  • Hi,

    In the block diagram below:

    AIN2 measures RCAL impedance.

    AIN3 measures Battery impedance.

    REG_AFE_SWMUX[2:0] = 001; //enable common mode switch on AIN3

    REG_AFE_SWMUX[2:0] = 000; //enable common mode switch on AIN2

    REG_AFE_SWMUX[2:0] = 010; //disable common mode switch on both AIN2 and AIN3

Children