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 example code with PWM synchronizing

Part Number: TMS320F280049
Other Parts Discussed in Thread: C2000WARE, AMC1305M25

Hi,

I had asked F280049 SDFM example before one year.

https://e2e.ti.com/support/microcontrollers/c2000/f/171/p/699474/2578448

And still not release  in latest c2000ware.

Does TI release it now?

I have some troubles with using SDFM on F280049.

thanks,

best regards,

Simen

  • Simen,

    Let me check when this example code is planned to release and get back with you.

    Regards,

    Manoj

  • Simen,

    Can you please explain the problem you are facing?

    Regards,

    Manoj

  • Manoj,

    I use F2838x SDFM example and modify it to fit F280049.  (F2838x_sdfm_ex4_pwm_sync_cpuread.c)

    When the program execute run .

    It does not enter SDFM ISR and get data.

    But just pause the program and go on running again.

    It  can run correctly and get the right data.

    I have no idea why .

    attach my code , SDFM register value ,and use AMC1305M25 EVM

    ----------------------------------------------------------------------

    sdfm_ex4_pwm_sync_cpuread_bsp006.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    //###########################################################################
    //
    // FILE: sdfm_ex4_pwm_sync_cpuread.c
    //
    // TITLE: SDFM PWM Sync Example
    //
    //! \addtogroup driver_example_list
    //! <h1> SDFM PWM Sync </h1>
    //!
    //! In this example, SDFM filter data is read by CPU in SDFM ISR routine. The
    //! SDFM configuration is shown below:
    //! - SDFM1 is used in this example. For using SDFM2, few modifications
    //! would be needed in the example.
    //! - MODE0 Input control mode selected
    //! - Comparator settings
    //! - Sinc3 filter selected
    //! - OSR = 32
    //! - hlt = 0x7FFF (Higher threshold setting)
    //! - llt = 0x0000(Lower threshold setting)
    //! - Data filter settings
    //! - All the 4 filter modules enabled
    //! - Sinc3 filter selected
    //! - OSR = 256
    //! - All the 4 filters are synchronized by using PWM
    //! (Master Filter enable bit)
    //! - Filter output represented in 16 bit format
    //! - In order to convert 25 bit Data filter
    //! into 16 bit format user needs to right shift by 10 bits for
    //! Sinc3 filter with OSR = 256
    //! - Interrupt module settings for SDFM filter
    //! - All the 4 higher threshold comparator interrupts disabled
    //! - All the 4 lower threshold comparator interrupts disabled
    //! - All the 4 modulator failure interrupts disabled
    //! - All the 4 filter will generate interrupt when a new filter data
    //! is available
    //!
    //! \b External \b Connections \n
    //! - SDFM_PIN_MUX_OPTION1 Connect Sigma-Delta streams to
    //! (SD-D1, SD-C1 to SD-D8,SD-C8) on GPIO16-GPIO31
    //! - SDFM_PIN_MUX_OPTION2 Connect Sigma-Delta streams to
    //! (SD-D1, SD-C1 to SD-D8,SD-C8) on GPIO48-GPIO63
    //! - SDFM_PIN_MUX_OPTION3 Connect Sigma-Delta streams to
    //! (SD-D1, SD-C1 to SD-D8,SD-C8) on GPIO122-GPIO137
    //!
    //! \b Watch \b Variables \n
    //! - \b filter1Result - Output of filter 1
    //! - \b filter2Result - Output of filter 2
    //! - \b filter3Result - Output of filter 3
    //! - \b filter4Result - Output of filter 4
    //!
    //
    //###########################################################################
    // 20190722(sdfm_ex4_pwm_sync_cpuread_bsp002.c) ePWM2 for AM1305 CLK, SDFM ISR ok
    // 20190722(sdfm_ex4_pwm_sync_cpuread_bsp005.c) SDFM ISR bug.
    //###########################################################################
    //
    // Included Files
    //
    #include "driverlib.h"
    #include "device.h"
    #include <stdio.h>
    //
    // Defines
    //
    #define MAX_SAMPLES 1024
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    SDFM001.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    521177 40
    R Sdfm1Regs_SDIFLG 0x0000000B 0x80000100
    R Sdfm1Regs_SDIFLGCLR 0x0000000B 0x00000000
    R Sdfm1Regs_SDCTL 0x0000000F 0x2000
    R Sdfm1Regs_SDMFILEN 0x0000000F 0x0800
    R Sdfm1Regs_SDSTATUS 0x0000000F 0x0000
    R Sdfm1Regs_SDCTLPARM1 0x0000000F 0x0000
    R Sdfm1Regs_SDDFPARM1 0x0000000F 0x0FFF
    R Sdfm1Regs_SDDPARM1 0x0000000F 0x5000
    R Sdfm1Regs_SDCMPH1 0x0000000F 0x7FFF
    R Sdfm1Regs_SDCMPL1 0x0000000F 0x0000
    R Sdfm1Regs_SDCPARM1 0x0000000F 0x0200
    R Sdfm1Regs_SDDATA1 0x0000000B 0xC1000000
    R Sdfm1Regs_SDDATFIFO1 0x0000000B 0x00000000
    R Sdfm1Regs_SDCDATA1 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPHZ1 0x0000000F 0x0000
    R Sdfm1Regs_SDFIFOCTL1 0x0000000F 0x0000
    R Sdfm1Regs_SDSYNC1 0x0000000F 0x0440
    R Sdfm1Regs_SDCTLPARM2 0x0000000F 0x0000
    R Sdfm1Regs_SDDFPARM2 0x0000000F 0x0000
    R Sdfm1Regs_SDDPARM2 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPH2 0x0000000F 0x7FFF
    R Sdfm1Regs_SDCMPL2 0x0000000F 0x0000
    R Sdfm1Regs_SDCPARM2 0x0000000F 0x0000
    R Sdfm1Regs_SDDATA2 0x0000000B 0x00000000
    R Sdfm1Regs_SDDATFIFO2 0x0000000B 0x00000000
    R Sdfm1Regs_SDCDATA2 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPHZ2 0x0000000F 0x0000
    R Sdfm1Regs_SDFIFOCTL2 0x0000000F 0x0000
    R Sdfm1Regs_SDSYNC2 0x0000000F 0x0400
    R Sdfm1Regs_SDCTLPARM3 0x0000000F 0x0000
    R Sdfm1Regs_SDDFPARM3 0x0000000F 0x0000
    R Sdfm1Regs_SDDPARM3 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPH3 0x0000000F 0x7FFF
    R Sdfm1Regs_SDCMPL3 0x0000000F 0x0000
    R Sdfm1Regs_SDCPARM3 0x0000000F 0x0000
    R Sdfm1Regs_SDDATA3 0x0000000B 0x00000000
    R Sdfm1Regs_SDDATFIFO3 0x0000000B 0x00000000
    R Sdfm1Regs_SDCDATA3 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPHZ3 0x0000000F 0x0000
    R Sdfm1Regs_SDFIFOCTL3 0x0000000F 0x0000
    R Sdfm1Regs_SDSYNC3 0x0000000F 0x0400
    R Sdfm1Regs_SDCTLPARM4 0x0000000F 0x0000
    R Sdfm1Regs_SDDFPARM4 0x0000000F 0x0000
    R Sdfm1Regs_SDDPARM4 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPH4 0x0000000F 0x7FFF
    R Sdfm1Regs_SDCMPL4 0x0000000F 0x0000
    R Sdfm1Regs_SDCPARM4 0x0000000F 0x0000
    R Sdfm1Regs_SDDATA4 0x0000000B 0x00000000
    R Sdfm1Regs_SDDATFIFO4 0x0000000B 0x00000000
    R Sdfm1Regs_SDCDATA4 0x0000000F 0x0000
    R Sdfm1Regs_SDCMPHZ4 0x0000000F 0x0000
    R Sdfm1Regs_SDFIFOCTL4 0x0000000F 0x0000
    R Sdfm1Regs_SDSYNC4 0x0000000F 0x0400
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    best regards,

    Simen

  • Manoj,

    Any update?

    Does  your software team finish the F280049 SDFM example code?

    thanks,

    best regards,

    Simen

  • Simen,

    I’m currently held up with some urgent project which I need to complete by end of this week. I can look into your issue early next week. Please expect a response by Monday / Tuesday next week.

    Regards,

    Manoj

  • Manoj,

    I have found out the solution.

    Because F28388D example code has "SysCtl_configureType(SYSCTL_SDFMTYPE, 0, 1)" function.

    But F280049 does not have this function.

    I have added the below code into my program and it works.

       EALLOW;
       HWREGH(DEVCFG_BASE + SYSCTL_O_SDFMTYPE) = (config | ((lock << SYSCTL_TYPE_LOCK_S) &  SYSCTL_SDFMTYPE_LOCK));
       EDIS;

    best regards,

    Simen