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.

EN_BATSWITCH in RF430FRL152H

Other Parts Discussed in Thread: RF430FRL152H

Hi,

I'm trying to close the battery switch in the RF430FRL152H but the program stop. I have written this code for make it:

RFPMMCTL0 = PMMPW;                                    //Unlock RFPMM
RFPMMCTL0 |= RFPMM_EN_BATSWITCH;  //Enable the battery switch
RFPMMCTL0_H |= 0xFF;                                    //Lock RFPMM

Thanks in advance.

  • RFPMMCTL0 |= RFPMM_EN_BATSWITCH;  //Enable the battery switch

    The above line of code will actually read the contents of the full RFPMMCTL0 and use the read portion to set the full word. The password feature of the RFPMMCTL0 reads one value (0x96) but is set correctly with another value: 0xA5.  See the RFPMMCTL0 register description. So the above code line is causing a wrong password setting and thus a reset.

    I would recommend:

    RFPMMCTL0 = PMMPW;                                    //Unlock RFPMM
    RFPMMCTL0_L |= RFPMM_EN_BATSWITCH;  //Enable the battery switch
    RFPMMCTL0_H |= 0xFF;                                    //Lock RFPMM

    The change is from: RFPMMCTL0 to RFPMMCTL0_L, so that you are writing only to the lower part of the register, not the password part.

  • Oh, great!

    Thank you so much Alexander!!