Hello,
While writing a code for pwm generation in MCUXPRESSO for the FRDMKV31F board with a MKV31F512VLL12 controller on it , I realized that I wasn't able to access registers like FTMx_CnSC ,CnV unlike the rest of them. What is the proper syntax to access such registers?
Thank You,
Apurv.
Solved! Go to Solution.
Hi,
FTMx_CnSC , and CnV are accessed through the "CONTROLS" register from the FTM_Type structure. Please check the fsl_ftm.c driver file for the FRDMKV31F , where you will see that these registers are accessed like in the following example:
void FTM_SetupOutputCompare(FTM_Type *base,
ftm_chnl_t chnlNumber,
ftm_output_compare_mode_t compareMode,
uint32_t compareValue)
{
uint32_t reg;
.
.
.
/* Setup the channel output behaviour when a match occurs with the compare value */
base->CONTROLS[chnlNumber].CnSC = reg;
/* Set output on match to the requested level */
base->CONTROLS[chnlNumber].CnV = compareValue;
.
.
.
}
Best Regards,
Ricardo Delsordo
sir i have problem in register read in MKV6F16 controller card
problem like hard fault
Hi,
FTMx_CnSC , and CnV are accessed through the "CONTROLS" register from the FTM_Type structure. Please check the fsl_ftm.c driver file for the FRDMKV31F , where you will see that these registers are accessed like in the following example:
void FTM_SetupOutputCompare(FTM_Type *base,
ftm_chnl_t chnlNumber,
ftm_output_compare_mode_t compareMode,
uint32_t compareValue)
{
uint32_t reg;
.
.
.
/* Setup the channel output behaviour when a match occurs with the compare value */
base->CONTROLS[chnlNumber].CnSC = reg;
/* Set output on match to the requested level */
base->CONTROLS[chnlNumber].CnV = compareValue;
.
.
.
}
Best Regards,
Ricardo Delsordo
Hey Ricardo,
Thank you for your help! Appreciate it!
Kind Regards,
Apurv.