This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Temperature Sensor in CC2533

Other Parts Discussed in Thread: CC2533

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Hello,

We are trying to use the temperature sensor in CC2533, but for some reason, BATTMON_OUT remains at ‘0’ for any value in BATTMON_VOLTAGE (14-22).

Procedure we are following:

  • 1)         Configure ATEST, TR0, BATTMON_VOLTAGE and MONMUX registers.
  • 2)         Enable battery monitor, BATTMON_PD.

 

We would like to know, if there are any other registers which needs to be configured or any other hardware which needs to be rigged up for getting the temperature sensor up and running.

Thanks and Regards,

Nikhil S.

  • Hi,

    sorry for the delay of the answer.

    The actual bit which activates the temperature sensor is bit#1 in ATEST register, not bit#0. There's a typo on the user guide which is being corrected in the new user guide version which will be released soon. Unfortunately the one currently available on the webfindicates bit#0 as the bit to activate the temp sensor. Please use bit #1.

    No need to activate any other register besides the battery monitor space registers.

     

    As a programming guide, please use the below code snippet the temperature sensor feature on CC2533:

     

      // Enable the temperature sensor

      ATEST = 0x2;

      // Select the batt mon input to compare the battery monitor voltage set through BATTMON_VOLTAGE field with the temperature sensor

      MONMUX = 0x1;  

     

      // Select the battmon voltage to compare with

      unsigned char battmon_voltage = 14;

    #define BATTMON_VOLTAGE_MASK (0x1F << 1)  

      // Mask out previous set bits

      BATTMON &= ~(BATTMON_VOLTAGE_MASK);

      BATTMON |= (battmon_voltage << 1);

     

      // Turn on the battery monitor

      BATTMON &= ~(0x1);

      // Hold the battery monitor for at least 2 usecs

      for(unsigned int j=0; j<5000;j++)

      {

        asm("NOP");

      }

    #define BATTMON_OUT_MASK (1 << 6)

      unsigned char result = ((BATTMON_OUT_MASK & BATTMON) >> 6);   

      // Turn off the battery monitor

      BATTMON |= 1;  

    Thanks,
    TheDarkSide

  • Hi,

           Thanks for the reply. Changed "ATEST" register values. Its working now.

    Thanks and Regards,

    Nikhil S.

  • Nikhil,

    glad it worked. Would you please verify the answer so we close the post?

    Thanks,

    TheDarkSide