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.

TMS320F280049: F280049 SDFM data acquisition issue

Part Number: TMS320F280049
Other Parts Discussed in Thread: AMC1306EVM

Hi

I use sdfm_ex5_filter_sync_fifo_cpuread example to check data acquisition from AMC1306EVM board.

I made the following changes to the code:

1. Use PWM1 to provide SDFM an 10MHz clock(for both AMC1306EVM and SD1.C1).

2. Use DACA to provide a 0 - 0.5V sawtooth output to AMC1306EVM. (Use internal +1.65V as voltage reference)

    DAC data change is done at ISR sdfmFIFO1ISR after data has been converted. (I have confirmed DACA output)

3. To check if the data is correct, the program saves PWM8.TBCTR and 3 converted data from FIFO, so

    I can check if data acquisition time is correct (it can also as a delimiter to distinguish which 3 data are got at the same time).

4. Only check SDFM1.Filter1  and set SDFM1.D1 to GPIO16, SDFM1.C1 to GPIO17.

The changed code is as follows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//###########################################################################
//
// FILE: sdfm_ex5_filter_sync_fifo_cpuread.c
//
// TITLE: SDFM Type 1 Filter FIFO Example.
//
//! \addtogroup driver_example_list
//! <h1> SDFM Type 1 Filter FIFO </h1>
//!
//! This example configures SDFM1 filter to demonstrate data read through
//! CPU in FIFO & non-FIFO mode. Data filter is configured in mode 0
//! to select SINC3 filter with OSR of 256. Filter output is configured
//! for 16-bit format and data shift of 10 is used.
//!
//! This example demonstrates the FIFO usage if enabled. FIFO length is set
//! at 16 and data ready interrupt is configured to be triggered when FIFO is
//! full. In this example, SDFM filter data is read by CPU in SDFM Data Ready
//! ISR routine.
//!
//! \b External \b Connections \n
//! Connect Sigma-Delta streams to (SD-D1, SD-C1 to SD-D4,SD-C4)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

After running the code, I found the ISR is entered at an accurate time but 3 acquisition data are not even close to each other (see below).

Looking forward a TI technician or expert to point out the issue in the program.

Thanks,

Jiakai

  • Jiakai,

    In your code, PWM8 is configured to generate sync pulse to SDFM every 655.2 us. So, SDFM.FILTER1 (data filter) will get reset every 655.2 us. Once a Sinc3 filter is reset, 1st two samples will be incorrect and filter produces correct filter output only from 3rd sample. That is the reason why you are seeing two incorrect samples. To avoid this problem ignore first 2 samples and start recording from 3rd sample.

    Another suggestion would be to first provide DC input rather than saw tooth input to debug this problem.

    Regards,

    Manoj

  • Hi Manoj,

    Awesome!

    You are right! I have confirmed it.

    Thank you very much!

    Jiakai

  • Hi Manoj,

    I have tried to calculate SDFM results from registry value to voltage value as below (AMC1306EVM input comes from DACA

    and DACA output signal is a sawtooth waveform from 0 to 0.25v):

    buf[loopCounter1] = 0.25 * (SDFM_getFIFOData(SDFM1_BASE, SDFM_FILTER_1) >> 16U) / ((1L*256*256*256) >> 10);

    In above statement, 0.25 is Vclipping value (250mv).

    The voltage values are saved to buf array (I merge RAMLS6 and RAMLS7 to RAMLS5 in 28004x_sdfm_ram_Lnk.cmd), 

    the array values are displayed as follows:

    From the above graph, the maximum value is near to 0.125v (only 1/2 of the real input value).

    Do I have any mistake on the calculation? What's the correct calculation method?

    The source code is as follows:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //###########################################################################
    //
    // FILE: sdfm_ex5_filter_sync_fifo_cpuread.c
    //
    // TITLE: SDFM Type 1 Filter FIFO Example.
    //
    //! \addtogroup driver_example_list
    //! <h1> SDFM Type 1 Filter FIFO </h1>
    //!
    //! This example configures SDFM1 filter to demonstrate data read through
    //! CPU in FIFO & non-FIFO mode. Data filter is configured in mode 0
    //! to select SINC3 filter with OSR of 256. Filter output is configured
    //! for 16-bit format and data shift of 10 is used.
    //!
    //! This example demonstrates the FIFO usage if enabled. FIFO length is set
    //! at 16 and data ready interrupt is configured to be triggered when FIFO is
    //! full. In this example, SDFM filter data is read by CPU in SDFM Data Ready
    //! ISR routine.
    //!
    //! \b External \b Connections \n
    //! Connect Sigma-Delta streams to (SD-D1, SD-C1 to SD-D4,SD-C4)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    thanks,

    Jiakai

  • Jiakai,

    The correlation between analog input of the SD-modulator and SDFM digital filter output is captured in "Theoretical SDFM Filter Output" section in F28388D TRM.

    This information also applies to F280049 SDFM and will be updated in the next release of TRM.

    Regards,

    Manoj




  • Hi Manoj,

    Thank you for your reply.

    I have found the bugs in my code ():

    1. In line 325, the expression is wrong, the correct statement is as follows:

             DAC_setShadowValue(DACA_BASE, (int)(dacVal * 4095.0 / 3300.0));

    2. In line 309, Vclipping is set to 0.25 (250mV), it should be 0.32 (320mV as in the manual).

    thanks,

    Jiakai