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.

AM2434: SDFM peripheral - questions

Part Number: AM2434
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Tool/software:

Hi, 

  1. Is the SDFM IP the same as in the C2K family ? 
  2. What is the gen of the SDFM version in the AM24x ? (see Table 3-48. Sigma Delta Filter (SDFM) Module Type Description in https://www.ti.com/lit/ug/spru566u/spru566u.pdf?ts=1760442862279
  3. is it possible to change the OSR dynamically without resetting the SDFM module ?
  4. Is all the SW related to the SDFM module available, or some is delivered as library ?

Regards

Geoffrey

  • Hi Geoffrey,

    We have firmware support for SDFM. You can find example projects in the Motor Control SDK:
    https://www.ti.com/tool/download/MOTOR-CONTROL-SDK-AM243X/11.00.00.06

    For information about supported features, please refer to the Motor Control SDK documentation, which provides detailed information about available features and support in the SDK:
    https://software-dl.ti.com/processor-industrial-sw/esd/motor_control_sdk/am243x/11_00_00_06/docs/api_guide_am243x/CURRENT_SENSE.html

    Regarding the SDFM hardware interface available on the AM243x, please see section "6.4.5.2.2.3.5 Sigma Delta (SD) Decimation Filtering" in the AM243x Technical Reference Manual (TRM):
    www.ti.com/.../spruim2h.pdf

    Thanks & regards,

    Achala Ram  

  • Hi Achala, 

    Thanks for the link sot the documentation but it doesn't answer my questions. In particular :

    1. is it possible to change the OSR dynamically without resetting the SDFM module ?
    2. Is all the SW related to the SDFM module available in source files, or some is delivered as library ?

    Regards

    Geoffrey 

  • Hi Geoffrey,

    is it possible to change the OSR dynamically without resetting the SDFM module ?

    can you share more details about use case side how and when you want to change ?Yes, You can change the OSR value at runtime without resetting modulr, but note that the accumulator and differentiator will still contain old values. It will take 2-3 samples (depending on the filter type) for all register values to stabilize after changing OSR. 

    Is all the SW related to the SDFM module available in source files, or some is delivered as library ?

    All software related to the SDFM module is available in the SDK only. Examples are available in the examples folder, and the firmware and driver source files are present in the source folder. 

     BR,

    Achala Ram

  • Hi, 

    Geoffrey's questions are for my needs, so I could complete them:

    1. and 2. for example C2000 SDFM have fifo but it seems to not be the case for PRU SDFM. So do you have a list of difference between C2000 SDFM and AM243x PRU SDFM?

    3. I already have this question for C2000 (TMS320F28P650DH: Change OSR dynamically - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums) but as AM243x PRU SDFM is combination of HW ad SW, the answer could be differente. With C2000 I've tried to change OSR in SDFM ISR and this have impact on output datas, but on AM2434, nothing happened as if my new OSR value has not been taken into account

    4. The questions is about the PRU software, not the driver. Is the SDFM functionnality only available as binary, or is it possible to have the source code if I want to enhance it?

    Thanks

    Gildas

     
  • Hi Gildas,

    1. and 2. for example C2000 SDFM have fifo but it seems to not be the case for PRU SDFM. So do you have a list of difference between C2000 SDFM and AM243x PRU SDFM?

    PRU SDFM does not have features like FIFO or data formatting. You can find details of PRU SDFM features in the software-dl.ti.com/.../CURRENT_SENSE.html. If you have specific requirements or features you would like to discuss, please let us know..

    I already have this question for C2000 (TMS320F28P650DH: Change OSR dynamically - C2000 microcontrollers forum - C2000︎ microcontrollers - TI E2E support forums) but as AM243x PRU SDFM is combination of HW ad SW, the answer could be differente. With C2000 I've tried to change OSR in SDFM ISR and this have impact on output datas, but on AM2434, nothing happened as if my new OSR value has not been taken into account

    Can you provide details on which SDK version you are using and how you are changing the OSR value?

    The questions is about the PRU software, not the driver. Is the SDFM functionnality only available as binary, or is it possible to have the source code if I want to enhance it?

    Yes, you can enhance the PRU SDFM firmware. The source files and firmware projects are available here: `motor_control_sdk_am243x_09_02_00_11\source\current_sense\sdfm\firmware` 

    BR,

    Achala Ram

  • Hi Achala,

    Ok, so C2000 SDFM and PRU SDFM don't have the same functionnalities.

    On C2000 I use C2000Ware_6_00_00_00 and C2000Ware_MotorControl_SDK_5_04_00_00. I change OSR with call to SDFM_setFilterOverSamplingRatio inside fifo level ISR

    On AM243 I use mcu_plus_sdk_am243x_11_01_00_17 and motor_control_sdk_am243x_11_00_00_06. I try to change OSR with call to SDFM_setFilterOverSamplingRatio inside data ready ISR

    Thanks for path to SDFM source code

    Regards

  • Hi Gildas,

    On AM243 I use mcu_plus_sdk_am243x_11_01_00_17 and motor_control_sdk_am243x_11_00_00_06. I try to change OSR with call to SDFM_setFilterOverSamplingRatio inside data ready ISR

    could you please share which example you are using?

    can you also check and verify whether the SDFM register value (specifically the OSR field) is being updated ?

    The register address can be found in section " 6.4.14.5 PRU_ICSSG_CFG Registers" in am243x TRM:  ti.com/lit/ug/spruim2h/spruim2h.pdf?ts=1761112036321&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FAM2434

    see the debug guide for instructions on how to check the register:

    https://software-dl.ti.com/processor-industrial-sw/esd/motor_control_sdk/am243x/11_00_00_06/docs/api_guide_am243x/EXAMPLES_CURRENT_SENSE.html#autotoc_md114

    BR, 

    Achala 

  • Hi Achala,

    I use TI's example icss_sdfm_three_channel_with_continuous_mode_am243x-lp_r5fss0-0_freertos_ti-arm-clang in which I've modified pruSdfmIrqHandlerCh0 to add SDFM_setFilterOverSamplingRatio(gHPruSdfm, SDFM_CH0, 124); after 10 interrupts and back to 125 after 20 interrupts.

    I have a look to register PRU_ICSSG0_PR1_CFG_SLV_PR1_CFG__SLV__REGS_pru0_sd_sample_size_reg0 and it's value is not impacted by SDFM_setFilterOverSamplingRatio.

    I've tried to manually change register value inside memory browser and I it is take into account and I can see impact on filter's output values

    Gildas

  • Hi,

    Can you share the updated file? You need to ensure that snoop mode is not enabled and the SDFM handle is correctly initialized before calling SDFM_setFilterOverSamplingRatio.

    BR,

    Achala Ram

  • Hi,

    void pruSdfmIrqHandlerCh0(void *args)
    {
        /* debug, inncrement PRU SDFM IRQ count */
        gPruSdfmIrqCntCh0++;
        /* Clear interrupt at source */
        PRUICSS_clearEvent(gPruIcssHandle, PRU_TRIGGER_HOST_SDFM_EVT_CH0);
    
        if(sdfmPruIdxCntCh0 < MAX_SAMPLES)
        {
            sdfm_ch_samples[SDFM_CH0][sdfmPruIdxCntCh0] = SDFM_getFilterData(gHPruSdfm, 0) >> 6;
    
            sdfmPruIdxCntCh0++;
        }
    
        if (sdfmPruIdxCntCh0 == 10)
        {
            SDFM_setFilterOverSamplingRatio(gHPruSdfm, SDFM_CH0, 124);
        }
        if (sdfmPruIdxCntCh0 == 20)
        {
            SDFM_setFilterOverSamplingRatio(gHPruSdfm, SDFM_CH0, 125);
        }
    }
    

    I have updated sample copy to stop storing samples when buffer is full instead of cyclic storage and I have added the OSR value set.

    Regarding snoop mode, I don't know how to check it but I've validated that my default OSR (value in sysconfig) is set in sdfm_exemple.c line 463 by 

            if(pSdfmPrms->snoopModeEnable != 1)
            {
                SDFM_setFilterOverSamplingRatio(hSdfm, SDFM_CH, pSdfmPrms->channelPrms[SDFM_CH].filterOsr);
            }
    

    so snoop mode is disabled

    Regards

  • Hi Gildas,

    I checked that the OSR configuration is done by the firmware. It performs a one-time configuration during the initialization sequence, so any changes made at runtime will not be considered by the firmware. We will fix this, and it will be available in the next release.

    As a workaround, you can directly write the register value through the R5 core.

    .

    Example:

    ``

        if (sdfmPruIdxCntCh0 == 10)
        {
            //HW_WR_FIELD32(Register_address, register_field, value);
            HW_WR_FIELD32((gHPruSdfm->pruicssCfg + CSL_ICSSCFG_SDPRU0SAMPLESIZEREGISTER0 + (SDFM_CH_NUMBER * 8)),
                CSL_ICSSCFG_SDPRU0SAMPLESIZEREGISTER0_PRU0_SD_SAMPLE_SIZE0, osr_value - 1);
        }

    You can get the details about sdfm register and its field here: software-dl.ti.com/.../EXAMPLES_CURRENT_SENSE.html

    BR,

    Achala 

  • Thanks, workaround is OK