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.

TMDS64EVM: Changing the sampling rate in the ADC example

Part Number: TMDS64EVM
Other Parts Discussed in Thread: ADC-PHI-PRU-EVM, ADS8588SEVM-PDK

Hello,

I am using TMDS64EVM with ADC-PHI-PRU-EVM and ADS8588SEVM-PDK.
I can successfully build and run the ADC example in CCS:
( mcu_plus_sdk_am64x_11_01_00_17/examples/pru_io/adc/ads85x8 )

However, I am unable to change the sampling rate.
I changed the Sampling Rate from 40,000 to 20,000 in example.syscfg file.

Sampling Rate.png

 

I checked that  ADC_CONVST_IEP_PRD_CONST was updated from 24998 to 49998 in ti_pru_io_config.inc file.

ADC_CONVST.png

 

Additionally, I checked the CONVSTA signal with an oscilloscope.
Even after changing the sampling rate in example.syscfg file, the sampling interval remained 25 µs.

CONVSTA.png

 

Could you please guide me on how to resolve this issue?


Regards,
SoonRyul Nam.

 

  • Hi

    After changing the setting, did you rebuild PRU project and R5F project both?

    Regards

    Dhaval

  • Hello Dhaval,

    Of course, I did several times. (I tested the example in OSPI mode).

    I deleted the binaries, cleaned, and rebuilt the PRU project and R5F project both.

    Regards,
    SoonRyul Nam.

  • For additional information:
    - CCS was used on Ubuntu.

    I got the following post-build errors. (I cannot modify the makefile since it is generated automatically.)
    I’d like to know whether these errors are unrelated to the sampling rate.

    "

    if linux == win32 /opt/ti/ccs1281/ccs/utils/cygwin/sed -i '0r /opt/ti/mcu_plus_sdk_am64x_11_01_00_17/source/pru_io/firmware/pru_load_bin_copyright.h' pru0_load_bin.h
    makefile:149: recipe for target 'post-build' failed
    /bin/sh: 1: Syntax error: end of file unexpected (expecting "then")
    gmake[2]: [post-build] Error 2 (ignored)
    /bin/sh: 1: Syntax error: end of file unexpected (expecting "then")
    gmake[2]: [post-build] Error 2 (ignored)
    if linux == linux sed -i '0r /opt/ti/mcu_plus_sdk_am64x_11_01_00_17/source/pru_io/firmware/pru_load_bin_copyright.h' pru0_load_bin.h
    makefile:149: recipe for target 'post-build' failed
    if linux == win32 move pru0_load_bin.h /opt/ti/mcu_plus_sdk_am64x_11_01_00_17/examples/pru_io/adc/ads85x8/firmware/pru0_load_bin.h
    makefile:149: recipe for target 'post-build' failed
    /bin/sh: 1: Syntax error: end of file unexpected (expecting "then")
    gmake[2]: [post-build] Error 2 (ignored)
    if linux == linux mv pru0_load_bin.h /opt/ti/mcu_plus_sdk_am64x_11_01_00_17/examples/pru_io/adc/ads85x8/firmware/pru0_load_bin.h
    makefile:149: recipe for target 'post-build' failed
    /bin/sh: 1: Syntax error: end of file unexpected (expecting "then")
    gmake[2]: [post-build] Error 2 (ignored)

    "

  • Hi

    This failure may be related. Can you manually copy the newly built "pru0_load_bin.h" to "ti/mcu_plus_sdk_am64x_11_01_00_17/examples/pru_io/adc/ads85x8/firmware/" folder and try?

    Regards

    Dhaval

  • Hello Dhaval,

    I manually copied the newly built “pru0_load_bin.h” file to the folder and tried again.
    However, the result was the same as before.

    Regards,
    SoonRyul Nam.

  • I manually copied the newly built “pru0_load_bin.h” file to the folder and then rebuilt the projects.
    Finally, the sampling interval was successfully changed from 25µs to 50µs.
    Thank you for your help.

    Regards,
    SoonRyul Nam.

  • Hello SoonRyul,

    The post-build errors you are observing are related to the fact that those instructions work on Windows as far as I can tell, but on Linux that "if" formatting does not work.

    Please try this so that you don't have to manually copy the PRU firmware in the future:

    1. Right click on the project in the Project Explorer menu, and navigate to Properties > CCS Build > select the "Steps" tab > Post-build steps

    2. Remove the conditional statements, and keep the commands intended for Linux.

    I would expect the code to look like this (but do NOT just copy/paste, your project will look different)

    $(CG_TOOL_ROOT)/bin/hexpru --diag_wrap=off --array --array:name_prefix=PRU1Firmware  -o pru1_load_bin.h ${BuildArtifactFileBaseName}.out
    cat ${MCU_PLUS_SDK_PATH}/source/pru_io/firmware/pru_load_bin_copyright.h pru1_load_bin.h > ../../<r5_project>/pru1_load_bin.h
    rm pru1_load_bin.h

    Let me know if this works for you. I'll update this draft page in the new PRU Academy based on your response:
    https://dev.ti.com/tirex/explore/node?node=A__AWTM5qdKV.bV6igFiAtgFQ__AM64-ACADEMY__WI1KRXP__LATEST 

    Regards,

    Nick