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.

TMS320F28377D: SDFM comparator working code example

Part Number: TMS320F28377D
Other Parts Discussed in Thread: CONTROLSUITE

Hi champs,

customer want to use SDFM comparator and has some issues (TMX320F28377D Rev B on evalkit):

SDFM (IFH) Interrupt is initiated immediately, as soon HLT threshold is in resolution area of selected  filter setting, nevertheless, which data SDFM is receiving.

He looked into erratum and followed instructions.

In controlsuite, we found no examples, where SDFM comparator interrupts are activated!

Can you help with a code example ?

  • DJ,

    Is the customer enabling SDFM comparator interrupts before setting SDFM COSR / Filter type ?

    What is the SDFM settings (specially comparator)? Examples provided in control-suite can be easily adapted to what you want to do.

    Regards,

    Manoj

  • Manoj,

    sorry for replying late... I will contact customer and come back!
  • Here answers form customer:

    Is the customer enabling SDFM comparator interrupts before setting SDFM COSR / Filter type ?

    - No, the COSR value and the filter type are set before enabling the comperator interrupts.

    What is the SDFM settings (specially comparator)?

    - Sdfm1Regs.SDDFPARM1.bit.SST = 0; //Sincfast

      Sdfm1Regs.SDDFPARM1.bit.DOSR = 102;

     Sdfm1Regs.SDCPARM1.bit.CS1_CS0  = 0; //Sincfast

     Sdfm1Regs.SDCPARM1.bit.COSR = 23;

    Examples provided in control-suite can be easily adapted to what you want to do.

    - The workarounds described in the errata sheet are not considered in the example code.

     Adapting the example code by myself is similar as writing my own code.

    Manoj,

    can we provide a working code example ?

  • DJ-NG,

    We will consider this request in subsequent controlsuite release. I can't release example on forum post without license agreements you find in controlsuite(when you download)

    But, for now, all the customer needs to do in add a delay as shown below.

    Before you use Sdfm_configureInterrupt(arguments) function to enable SDFM interrupts ask customer introduce delay of (Filter_order * COSR + 5)* SDCLK period

    For customers settings:-

    Filter Type = SincFast, So Filter order = 3

    COSR = 23, Actual comparator OSR setting = 24

    SDCLK period = 50ns (assuming SDCLK freq = 20 MHz)

    So, delay by ((3 * 24) + 5) * SDCLK period = 3.9E-6 (4us approx)

    Suggested code change:

    DELAY_US(4);

    Sdfm_configureInterrupt(arguments);

    Sdfm_enableMIE(gPeripheralNumber);

    Regards,

    Manoj