AnsweredAssumed Answered

Comparator Frequency detection mode

Question asked by surneni on Feb 17, 2018
Latest reply on Mar 19, 2018 by surneni

we are having issues with frequency measurement. we saw DAC disabled in the comments but in the defination structure we noticed that DACEN bit is SET which is enabled.can you help me out in setting comparator frequency detection.
/**************************************************************************/ /*!
* @brief Comparator Frequency Detection Setting:
* - filter disabled,
* - hysteresis 5mv,
* - sample, windowing and trigger modes disabled,
* - high speed mode,
* - non-inverting polarity,
* - unfiltered signal propagated to output (disabled),
* - comparator enabled,
* - CMP filter disabled when CR1[SE]=0,
* - IRQ and DMA disabled,
* - DAC disabled.
*****************************************************************************/
#define CMP_FREQ_DETECT_MODE_CONFIG_EN_DAC(dac) \
(tCMP){ \
/* CR0 */ SET(CMP_CR0_FILTER_CNT(0)) |SET(CMP_CR0_HYSTCTR(3)), \
/* CR1 */ CLR(CMP_CR1_SE_MASK) |CLR(CMP_CR1_WE_MASK)| \
CLR(CMP_CR1_TRIGM_MASK) |SET(CMP_CR1_PMODE_MASK)| \
CLR(CMP_CR1_INV_MASK) |CLR(CMP_CR1_COS_MASK)| \
CLR(CMP_CR1_OPE_MASK) |SET(CMP_CR1_EN_MASK), \
/* FPR */ SET(CMP_FPR_FILT_PER(0x00)), \
/* SCR */ CLR(CMP_SCR_DMAEN_MASK) |CLR(CMP_SCR_IER_MASK)| \
CLR(CMP_SCR_IEF_MASK), \
/* DACCR */ SET(CMP_DACCR_DACEN_MASK) |CLR(CMP_DACCR_VRSEL_MASK)| dac \
}

 

Regards,

jagadeesh

Outcomes