I’m working with ultrasonic ping sensor interfacing with Toradex platform.
Sensor works on basic principle of setting a GPIO pin as output HIGH and then LOW, so that sending a signal burst. After 5 microsecond delay, the GPIO pin should receive the signal in INPUT mode and calculate the timing between signal transmission and reception.
Is there any method to measure the timing of signal?
Is there any internal millis() function which I can marking time reference at beginning and end?
It’s not possible to measure so short interval on user (application) level with accepted accuracy. You have an option to write a kernel level driver or use external circuitry. How precise should be a an interval measurement?
Hi Alex, Thanks for the clarification. I have to measure the distance based on the time interval so it need to be very precise.
As per my previous question regarding driver issue, I am not able interface Arduino (as external circuitry). So wanted to interface the intended sensor directly on Toradex eval board.
As you suggested, writing the application at kernel level, I hope it is like writing device driver. Is it very difficult to do? Could you send me some relevant links to help me accomplish this task?
If you have a ready to use solution on Arduino - you can connect it to Colbri using SPI, UART or I2C bus. This way you don’t need a USB driver. However it’s much more efficient to use an M4 core at iMX7 module as Daniel mentioned.
You’re right. I used UART A pins to get data directly from microcotroller board and it is working. I shall consider the option of iMX7 with heterogeneous multicore solution during deployment phase.