generate 40kHz squarewave signal

Hi what is the highest frequency squarewave the GPIO can generate? Thanks

hello blp_engineer,

may I know what’s your use-case.
suggest you also refer to Topic 1030443.
thanks

Hi Jerry Chang thanks for the reply. the user case would be ultrasonic phased array. I am able to generate that 40kHz signal easily with Raspberry Pi because I have the datasheet for the CPU and just write a simple C code for it.

two difficulty I am facing:

  1. CPU datasheet…I know it is a ARM® Cortex®-A57 based design and there is a generic datasheet for it. But my previous development experience has always been with manufacture provided header file and datasheet.
  2. If you read this post: What is the Max Input Frequency supported by J41 header GPIO pins? - Jetson Nano - NVIDIA Developer Forums
    this guy is also try to write C code for GPIO yet faced difficulties with regard to memory access.

hello blp_engineer,

suggest you refer to below and have implementation to generate square-wave.
thanks

<i>$l4t-r32/kernel_src/kernel/nvidia/kernel-4.9/include/linux/gpio.h</i>

static inline void gpio_set_value(unsigned int gpio, int value)
{
 	__gpio_set_value(gpio, value);
}

thanks a lot JerryChang