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.

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:
    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.


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

thanks a lot JerryChang