TMDS64EVM: How to generate a 40 MHz signal using a GPIO pin as output on AM64x (TMDS64EVM)

Part Number: TMDS64EVM
Other Parts Discussed in Thread: AM6442,

Hello TI Team,

Processor SDK Linux RT 09.02.01.10 & board TMDS64EVM (AM6442).

I am working on the AM6442 (TMDS64EVM) and I need to generate a 40 MHz output signal on one of the GPIO pin.
I have already configured a pin as GPIO output through the device tree and verified the signal toggling, but GPIO toggling speed is very low (~64Hz range).

k3-am642-evm.dts configuration:-

main_gpio0_31_pins_default: main-gpio0-31-pins {
            pinctrl-single,pins = <
                           AM64X_IOPAD(0x007C, PIN_OUTPUT, 7)  /* GPIO0_31 */
            >;
    };

&main_gpio0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&main_gpio0_31_pins_default &main_gpio0_52_pins_default>;
    gpio-line-names =
        "", "", "", "", "", "", "", "", "", "",         /* 0-9 */
        "", "", "", "", "", "", "", "", "", "",         /* 10-19 */
        "", "", "", "", "", "", "", "", "", "",         /* 20-29 */
        "", "GPIO0_31", "", "", "", "", "", "", "", "", /* 30-39 */
    "", "", "", "", "", "", "", "", "", "",        /* 40-49 */
    "", "", "", "", "", "", "", "", "", "";         /* 50-59 */
};

Validated by using using command:

root@am64xx-evm:~# gpioset gpiochip1 31=1
root@am64xx-evm:~# gpioset gpiochip1 31=0

1) What is the maximum supported GPIO toggling(high and low) frequency?

2) What is the recommended hardware block on AM64x to generate a 40 MHz clock/square wave?

3) Provide gpio toogle example on TM6S64EVM board?

 

Thanks & Regards,

Ravilla Dinesh.

  • Hi team,

    Any update on this.

    Thanks & Regards,

  • Hi Ravilla, 

    For a GPIO toggle example, I would take a look at the following FAQ for the correct syntax:  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1494485/faq-processor-sdk-getting-started-with-gpios-in-linux-using-the-am62-and-am64-family-processors. I will need some time to get back to you on your first 2 questions. 

    Regards,

    Shriya

  • Hello Ravilla,

    We call it "bit-banging" when a processor core manually toggles a signal high and low.

    Linux cannot bitbang a regular GPIO signal at 40MHz rate for many different reasons. However, depending on your usecase, you could use other parts of the processor.

    Please tell us more about this signal that you want to drive.

    For example, is this a repeating PWM signal? If so, then you can use a PWM peripheral to drive the signal.

    Is this a communication protocol? If so, what communication protocol are you trying to implement?

    Is this a custom communication protocol? You may be able to implement it by bit-banging with a PRU core.

    Regards,

    Nick

  • Hi Nick,

    SDK: ti-processor-sdk-linux-rt-am64xx-evm-09.02.01.10.

    Board: TMDS64EVM (AM6442)

    How to configure ECAP to measure 25 MHz input?

    I have successfully configured EPWM to generate a 40 MHz output, which is verified on the oscilloscope.

    &epwm4 {
        pinctrl-names = "default";
        pinctrl-0 = <&main_epwm4_pins_default>;
        status = "okay";
    };

    main_epwm4_pins_default: main-epwm4-pins-default {
                pinctrl-single,pins = <
                    AM64X_IOPAD(0x0088, PIN_OUTPUT, 3)  /* EHRPWM4_A, mode 3 R18*/
                AM64X_IOPAD(0x008C, PIN_OUTPUT, 3)  /* EHRPWM4_A, mode 3 T21*/
                
                >;
    };


    Now I need to measure a 25 MHz input signal using ECAP how?

     main_ecap2_pins_default: main-ecap0-pins-default {
            pinctrl-single,pins = <
                AM64X_IOPAD(0x025C, PIN_INPUT, 0) /* (D17) ECAP2_IN_APWM_OUT */
            >;
        };

    &ecap2 {
        pinctrl-names = "default";
        pinctrl-0 = <&main_ecap2_pins_default>;
        status = "okay";
    };

    Driver also available:

    == /sys/class/pwm/pwmchip0 ==
    ../../devices/platform/bus@f4000/23100000.pwm/pwm/pwmchip0
    of:NpwmT(null)Cti,am64-ecap
    == /sys/class/pwm/pwmchip1 ==
    ../../devices/platform/bus@f4000/23000000.pwm/pwm/pwmchip1
    of:NpwmT(null)Cti,am64-epwm
    == /sys/class/pwm/pwmchip3 ==
    ../../devices/platform/bus@f4000/23040000.pwm/pwm/pwmchip3
    of:NpwmT(null)Cti,am64-epwm

    Now I need to read an external input signal of ~25 MHz using ECAP, and the requirement is to do this from Linux user space only ?

    Please suggest any example to read the input PIN with ~25MHZ? 

    Thanks & Regards,

    Ravilla Dinesh.