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.

Linux/AM3358: AM335x SoC precise gpio control for pps generation

Part Number: AM3358

Tool/software: Linux

I'm using github.com/.../pps-gen-gpio kernel module on AM335x SoC to generate PPS signal. Everything works as expected but accuracy is somewhat bad. The average delay of entering an interrupt and the delay for setting the pin is taken into account, however there is a jitter of PPS impulse anyway (2-7 us approximately). I am almost sure that the reason is floating time of gpiod_set_value() function (I've measured it and it floats from 2.3 to 6.3 us). Is there a way of getting rid of it and achieve an accuracy of at least <1us? I was thinking about attachment of hardware timer right to the gpio output (not sure that it is possible though) or using RTU cores that AM335x SoC possesses... I'm using gpio2_4 pin...

  • Hi,

    This code is not provided by TI, therefore we do not support it. However, you cannot expect highly precise timing output in a Linux environment, due to the very nature of the OS, e.g. task switching, etc... I suggest you try to implement this on the PRU-ICSS, which is a 200MHz independent core. Latencies and jitter will be much lower there, and easier to control.
  • Thank you for the response!) By the way while searching through linux-menuconfig options I ran against "TI 1PPS dm timer implementation" kernel module. Is it accurate? May be I should try and use it, thanks)