GPIO read operation

Post Reply
barakp
Posts: 11
Joined: Tue Dec 25, 2018 6:51 am
languages_spoken: english
ODROIDs: C1+
Has thanked: 1 time
Been thanked: 0
Contact:

GPIO read operation

Unread post by barakp » Sun Apr 14, 2019 10:21 pm

Hi,

I use python wiringPi to check GPIO input pin with digitalRead funcion.

I tested the time of this operation and noticed that the reading time is about 1 micro second. This time is the minimum time that I can achieve??
I want to use GPIO pin to sample clock with frequency of 4Mhz.

Thanks,
Barak.

User avatar
tobetter
Posts: 3908
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 38 times
Been thanked: 155 times
Contact:

Re: GPIO read operation

Unread post by tobetter » Sun Apr 14, 2019 10:34 pm

barakp wrote:
Sun Apr 14, 2019 10:21 pm
Hi,

I use python wiringPi to check GPIO input pin with digitalRead funcion.

I tested the time of this operation and noticed that the reading time is about 1 micro second. This time is the minimum time that I can achieve??
I want to use GPIO pin to sample clock with frequency of 4Mhz.

Thanks,
Barak.
I guess it's not feasible to sample 4MHz in the user space due to heavy operation and scheduler, as well as 4MHz itself is too fast unless you try it in the kernel space using hardware interrupts. I hope someone else who tried the same or similar...

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 0 guests