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.

CCS/MSP430F5529: Question about F5529 sample code to increase PMMCORE levels

Part Number: MSP430F5529

Tool/software: Code Composer Studio

Hello all,

I have a question regarding the algorithm used to increase the PMMCORE levels detailed in the 5529 User's Guide.

SVSMHCTL = SVSHE + SVSHRVL0 * level + SVMHE + SVSMHRRL0 * level;

According to the user's guide, the Reset value of SVSHRVL and SVSMHRRL are 0h. Same goes for PMMCOREV and all the supervisors/monitors.

If we want to increase the SVS and SVM levels one at a time, the variable level would begin at 1(unsigned int).

On the msp430.h documentation, SVSHRVLis the first bit of the 2 bits that compose SVSHRVL. How does multiplying 0 by an unsigned int value of 1, result in 1? Or this has to do with some abstraction behind the scenes done by CCS that knows the intention is to set the bit.

  • Hello FLD,

    Yes, within the datasheet, SVSHRVL0 and SVSMHRRL0 are the '0' bit within the register fields. Within CCS though, MSP430 has defined each of these bits. So in CCS, SVSHRVL0 evaluates to 0x0100 as it is essentially a mask for the bit that you can manipulate. In this notation, you are not actually reading the specific bits in the register and performing operations from them. You are simply using the mask to fill out the associated register.

    Typical MSP430 defines have each bit defined in this manner. In addition, they usually have an associated define that allows you to choose the different options. This is indicated with an underscore. See below for an example of how this is done.

    Example:
    SVSHRVL0 == BIT 0 (0x0100)
    SVSHRVL1 == BIT 1 (0x0200)

    SVSHRVL_0 == Option 0 (0x0000)
    SVSHRVL_1 == Option 1 (0x0100)
    SVSHRVL_2 == Option 2 (0x0200)
    SVSHRVL_3 == Option 3 (0x0300)

  • Hello JH,

    Thanks for the reply, this makes sense.

**Attention** This is a public forum