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.

sdfm 比较器 hlt llt问题



各位好,

最近在使用SDFM的内部比较器时遇到了问题,无法正常触发over/under value 的状态。

根据iddk的代码,hlt = 0x7fff, llt = 0

将其改变为hlt = 100。并没有触发相应标志位,

代码如下:

 
#define  SDFM_TICKS    5
#define  OSR_RATE      OSR_127

/*******************************************************/
 /* Input Control Module */
 /*******************************************************/
 //Configure Input Control Mode: Modulator Clock rate = Modulator data rate
 Sdfm_configureInputCtrl(1,FILTER1,MODE_0);
 Sdfm_configureInputCtrl(1,FILTER2,MODE_0);
 Sdfm_configureInputCtrl(1,FILTER3,MODE_0);

 /*******************************************************/
 /* Comparator Module */
 /*******************************************************/

 //Comparator HLT and LLT
 //Configure Comparator module's comparator filter type and comparator's OSR value,
 // high level threshold, low level threshold
 Sdfm_configureComparator(1, FILTER1, SINC1, OSR_8, HLT, LLT);
 Sdfm_configureComparator(1, FILTER2, SINC1, OSR_8, HLT, LLT);
 Sdfm_configureComparator(1, FILTER3, SINC1, OSR_8, HLT, LLT);

 /*******************************************************/
 /* Sinc filter Module */
 /*******************************************************/
 //Configure Data filter modules filter type, OSR value and enable / disable data filter
 // 16 bit data representation is chosen for OSR 128 using Sinc3, from the table in the TRM
 // the max value represented for OSR 128 using sinc 3 is +/-2097152 i.e. 2^21
 // to represent this in 16 bit format where the first bit is sign shift by 6 bits
 Sdfm_configureData_filter(1, FILTER1, FILTER_ENABLE, SINC3, OSR_RATE, DATA_16_BIT, SHIFT_6_BITS);
 Sdfm_configureData_filter(1, FILTER2, FILTER_ENABLE, SINC3, OSR_RATE, DATA_16_BIT, SHIFT_6_BITS);
 Sdfm_configureData_filter(1, FILTER3, FILTER_ENABLE, SINC3, OSR_RATE, DATA_16_BIT, SHIFT_6_BITS);

 //PWM11.CMPC, PWM11.CMPD, PWM12.CMPC and PWM12.CMPD signals cannot synchronize the filters. This option is not being used in this example.
    Sdfm_configureExternalreset(1,FILTER_1_EXT_RESET_ENABLE, FILTER_2_EXT_RESET_ENABLE, FILTER_3_EXT_RESET_ENABLE, FILTER_4_EXT_RESET_ENABLE);


    DELAY_US(1000000);

    Sdfm_configureInterrupt(1, FILTER1, IEH_ENABLE, IEL_ENABLE, 0, 0);
    Sdfm_configureInterrupt(1, FILTER2, IEH_ENABLE, IEL_ENABLE, 0, 0);
    Sdfm_configureInterrupt(1, FILTER3, IEH_ENABLE, IEL_ENABLE, 0, 0);

    // Enable master filter bit of the SDFM module 1
    Sdfm_enableMFE(1);
    Sdfm_enableMIE(1);