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/MSP432P401R: [SVSMH monitor mode] Is PSS interrupt re-configuring in a project possible?

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi,

I would like to make my MSP432P401R MCU behaves differently depending on supply voltage.

(For example, MCU executes a program with LDO_VCORE0 48MHz in 2.8V ~ 3.3V range, and runs another program with LDO_VCORE0 8MHz in 2.0V~2.8V.) 

Before configuring MCU power modes, I searched for how to check MCU is in different Vcc range.

And I found SVSMH monitor mode of PSS in several MSP432 datasheet and technical reference. The mode checks if Vcc falls below the device-specific threshold and generates an interrupt.

Therefore, I downloaded pss_monitor example in 'Resource Explorer,' and tested the example in different trigger voltage levels.

But checking different Vcc ranges requires multiple PSS_IRQ configuration as far as I understand.

The reason why I thought like that is "there is only one interrupt condition form PSS that is triggered by SVSMH module while operating in the monitor mode. (by MSP432P4xx SimpleLink™ Microcontrollers Technical Reference Manual (Rev. H) 7.2.4)".

So, I think re-configuring PSS_IRQ several times to next trigger point whenever it called might work.

Example scenario: 

1. At first, PSS interrupt was configured to happen when voltage level 7 (=2.8V).

2. Supply voltage dropped near to 2.8V, and the interrupt occurred.

3. I disabled and enabled the PSS interrupt again to occur when voltage level 4 (=2.25V).

4. If the interrupt occurred again because of low supply voltage 2.25V, PSS interrupt was reconfigured again to the voltage level 1 (=1.62V)

The rough psuedo code I tried to implement the program is followed:

main() {

  while(1) {

    set_new_PSS_IRQ(next_trigger_point);

  }

}


PSS_IRQ() {

if(PSS_getTrigger() == 2.8V)

next_trigger_point = 2.25V;

else if(PSS_getTrigger() == 2.25V)

next_trigger_point = 1.62V;


disable_PSS_IRQ();

}

The program was build and executed without an error, but an unexpected result turned out.

I thought if current-voltage is near to 2.8V, only initial PSS IRQ occurred and stayed in main's while(1) before supply-voltage drops to 2.25V.

However, re-configured PSS interrupt (whose trigger point is 2.25V and then 1.62V) kept occurring despite its current-voltage near of 2.8V.

I seemed like the very first PSS interrupt trigger point is satisfied(2.8V), and all PSS interrupt occurs regardless of trigger point re-configuration to me.

Q1. Is PSS interrupt re-configuring in a project possible?

Q2. Is there any other way to execute MCU differently depending on Vcc range> 

Sincerely, Koo

  • I will need to look into item Q1, but for Q2 I would recommend using the default device settings and then use the internal ADC channel for battery voltage which is simply AVCC/2 and determine the voltage before applying the application specific settings.

    There is an example here which uses the internal temp sensor. Simply replace that with the battery monitor, ADC_BATTMAP.

    Regards,
    Chris
  • Thank you for your reply.

    I continuously worked on the re-configuration of PSS Interrupt (related to Q1).

    During the process, I found out the SVSMHIFG is not properly cleared after an interrupt occurred.

    That's why re-configuration seemed not working.

    The IFG pin of the PSS module was expected to be clear by PSS_clearInterruptFlag() function as far as I know.

    I used PSS_getInterruptStatus() function to check if the IRQ handler was ready for a new interrupt, however, it was not cleared.

    So, I tried hardcoding " BITBAND_PERI(PSS->IFG,PSS_IFG_SVSMHIFG_OFS) = 0;", which was not working. (I changed IFG bit to be __IO) 

    Is there any other way to clear PSS->IFG bit?

  • I would recommend looking at the source code for the associated APIs in driverlib.

    uint32_t PSS_getInterruptStatus(void)
    {
        return PSS->IFG;
    }
    
    void PSS_clearInterruptFlag(void)
    {
        __PSSUnlock();
        BITBAND_PERI(PSS->CLRIFG,PSS_CLRIFG_CLRSVSMHIFG_OFS) = 0;
        __PSSLock();
    }

    It can be found here (depending upon your install directory):

    C:\ti\simplelink_msp432p4_sdk_2_30_00_14\source\ti\devices\msp432p4xx\driverlib

    Regards,

    Chris

  • I already tried PSS_clearInterruptFlag() function, and It did not work.

    However, I found out that there existed an error in the function PSS_clearInterruptFlag().

    After reviewing some technical reference about PSS register bits, I thought clearing Interrupt flag of the register should be set CLRIFG bit to 1.

    Making own function named clearingInterruptFlag(below) which is exactly same function except changing CLRIFG bit 0 to 1 resolved my problem.

    void clearingInterruptFlag(void)
    {
        __PSSUnlock();
        BITBAND_PERI(PSS->CLRIFG,PSS_CLRIFG_CLRSVSMHIFG_OFS) = 1;
        __PSSLock();
    }

    void PSS_clearInterruptFlag() function in driverlib might be modified.

  • Thank you for finding this bug. I will report to software development team.

    Best Regards,
    Chris

**Attention** This is a public forum