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.

AM2431: SDFM Phase compensation on PRG1_PRU1_GPO3

Part Number: AM2431

Tool/software:

Hi, 

I am testing phase delay base on example https://software-dl.ti.com/processor-industrial-sw/esd/motor_control_sdk/am243x/09_02_00_09/docs/api_guide_am243x/BASIC_SDFM_EXAMPLE_WITH_PHASE_DELAY.html

An issue is that our hardware design is different compared to the demo. GPI1 is not connected to SD chip and I need to modify it to GPI3.

Currently it would stuck in waiting for ack from PRU if phase compensation is enabled.

Based on the description of the sdfm_firmware_signle_axis_signle_pru, it seems is because GPO1 is not connected.

How do I modify the code so it can measure the delay in other GPIO? 

Another question is that, I measured the SD_data and SD_Clk (20Mhz).

So the calculated result should be (50-20) = 30 ns?

Thanks,

Jianyu

  • Hi Jainyu,

    How do I modify the code so it can measure the delay in other GPIO? 

    Below is steps to measure delay with other GPIO, I made changes for GPIO3 

    • SDFM_11_MASK, need to update mask value for CLK and Data pin in sdfm.h file 
      • GPI16 is CLK & GPI3 is data pins so mask value will be 0x00010004 (3rd and 16th bits are set)
      • SDFM_11_MASK                    .set   0x00010004

     

    • Need to update GPI number which used with all wbc and wbs instructions to detect rising edge on data line.  
      • sdfm.asm file 

                                           ; waiting zero

                                            wbc  R31.b0, 3  ;GPI3 is used for DATA line

                                              ;waiting for rising edge of sd data

                                             wbs  R31.b0, 3  ;GPI3 is used for Data line

      • sdfm_macro.h file 
        • M_SDFM_PHASE_DELAY_FOR_RAISING_EDGE .macro

          ; waiting for one on SD data line

                  wbc  R31.b0, 3

                  ;waiting for rising edge of sd data

                  wbs  R31.b0, 3  ;GPI3 is used for Data line

             

          M_SDFM_PHASE_DELAY_FOR_FALLING_EDGE .macro

          ; waiting for one on SD data line

                  wbc  R31.b0, 3

                  ;waiting for rising edge of sd data

                  wbs  R31.b0, 3  ;GPI3 is used for Data line

                                           

    Thanks & Regards,

    Achala Ram

  • Based on the description of the sdfm_firmware_signle_axis_signle_pru, it seems is because GPO1 is not connected.

    Yes, Firmware is waiting to detect 1 on GPI1

    So the calculated result should be (50-20) = 30 ns?

    Can you add some additional details here ?

    Thanks & Regards,

    Achala Ram

  • It is based on https://software-dl.ti.com/processor-industrial-sw/esd/motor_control_sdk/am243x/09_02_00_09/docs/api_guide_am243x/BASIC_SDFM_EXAMPLE_WITH_PHASE_DELAY.html

    5. Compare this time with measured delay(stored in DMEM at offset 0x18) Both value should be same or have a maximum variation of 1 PRU cycle

  • The phase compensation is working. Thanks!

    So for the data measurement. The result from PRU (offset 0x18) is 4.

    I remeasured SD_data rising edge, yellow, and next SD_Clk rising edge, green, which is 30.8 ns.

    I am wondering if phase measure function is incorrect or I measured incorrect edge. The test case says,

    4. Take time stamp of any rising edge of SD0_D pin and upcoming active SD8_CLK edge

    Jianyu

  • The PRU core clk is 200Mhz, so PRU result 4 should be 20 ns?

  • The PRU core clk is 200Mhz, so PRU result 4 should be 20

    Yes, correct