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.

MSPM0C1104: How to enable FCC_IN

Part Number: MSPM0C1104
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi Support team,
        
   Currently I am working on MSPM0C1104 SOT-8 (DDF) package,
     I am trying to control PA27, which is PIN 1, based on the input received at FCC_IN (PA0), which is PIN 5; however, I am unable to obtain the FCC Value. What am I missing to enable the FCC_IN
    
    The frequency on the FCC_IN Pin is as mentioned below,
    MIN Frequency: 3 Hz
       MAX Frequency: 300 Hz
Below is the code for review.
#include "ti_msp_dl_config.h"

volatile uint32_t fccVal;

int main(void)
{
    SYSCFG_DL_init();
    DL_SYSCTL_startFCC();

    while (false == DL_SYSCTL_isFCCDone())
        ;

    fccVal = DL_SYSCTL_readFCC();

    if (fccVal > 55)
    {
       DL_GPIO_setPins(Head_Lamp_PORT, Head_Lamp_P1_PIN);
    }
    else
    {
        if (fccVal < 35)
            {          
                DL_GPIO_clearPins(Head_Lamp_PORT, Head_Lamp_P1_PIN);
            }
    }

    DL_SYSCTL_disableSleepOnExit();
    while (1)
    {
        __WFI();
    }
}
  • Hi Yogesh,

    I see that your code slightly resembles the SDK example sysctl_frequency_clock_counter.

    Did you also set up the configuration for the FCC in SysConfig?

    Have you tried just running the SDK example?

    How do you know you're not getting the FCC value? Did you start a debug session and create a watch expression for the fccVal variable?

    Best,

    Owen

  • Yes, I have set up the configuration for the FCC in SysConfig and, in a debug session, created a watch expression for the fccVal variable.

     while (false == DL_SYSCTL_isFCCDone())
            ;
    the code get stuck in a while loop.

  • Hi Yogesh,

    Thanks for sharing. I am trying this on my end. Looks like FCCDONE isn't getting asserted. Let me look into this and get back to you.

    Best,

    Owen

  • Hi Yogesh,

    I looked into this further and it seems like SysConfig isn't generating the necessary code to configure the FCC_IN pin. I have submitted a ticket to have this fixed in the next update.

    In the meantime, a workaround for this would to be to manually configure the pin before calling the DL_SYSCTL_startFCC function call:

    // If PA0 is used for FCC_IN
    IOMUX->SECCFG.PINCM[IOMUX_PINCM1] = IOMUX_PINCM1_PF_SYSCTL_FCC_IN | IOMUX_PINCM_PC_CONNECTED | IOMUX_PINCM_INENA_ENABLE;
    
    // If PA16 is used for FCC_IN
    IOMUX->SECCFG.PINCM[IOMUX_PINCM17] = IOMUX_PINCM17_PF_SYSCTL_FCC_IN | IOMUX_PINCM_PC_CONNECTED | IOMUX_PINCM_INENA_ENABLE;
    
    /* For other pin configurations, please reference the SDK and TRM */

    Best,

    Owen