Digital GPIO readout speed xu4

Post Reply
pettaa123
Posts: 23
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Digital GPIO readout speed xu4

Post by pettaa123 »

Hi, I could already finish one analog signal readout project successfully using ordoids xu4. In my next project I would like to read the TTL signal of a length measurement unit's incremental encoder. The length measurements minimum signal period is 5 micro seconds. But I wont reach the corresponding speed. Can I use an odroid xu4 with linux running again? Is there a different odroid, which is more suitable?

mad_ady
Posts: 8820
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 528 times
Contact:

Re: Digital GPIO readout speed xu4

Post by mad_ady »

Do you need to measure pulse widths? It should be doable by listening to irqs generated by gpios. As far as I know all odroids support it with their stock kernel, but N2/C4 may not support it with mainline kernel.
There's also a limit on how many active irqs you can have.

pettaa123
Posts: 23
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Digital GPIO readout speed xu4

Post by pettaa123 »

No, I dont need pulse width. I need to register if a level changed from HIGH to LOW (LOW to HIGH) and the level itself (gray code). Furthermore I need to readout 2 different lines in order to know the direction.

mad_ady
Posts: 8820
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 528 times
Contact:

Re: Digital GPIO readout speed xu4

Post by mad_ady »

Oh, in that case it's not TTL (logical signal), but ADC. I know most odroids have two ADC inputs, but I don't know their maximum sample rate.
You'll probably have to poll.

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 909 times
Contact:

Re: Digital GPIO readout speed xu4

Post by odroid »

I think XU4 ADC input sampling rate could be up to 200Khz if you use 'C' code instead of sysfs.
https://wiki.odroid.com/odroid-xu4/appl ... e/gpio/adc

But if you use an incremental encoder, consider using two GPIOs IRQ with timer to detect the direction and speed.

pettaa123
Posts: 23
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Digital GPIO readout speed xu4

Post by pettaa123 »

ok that was misleading. I dont need to know the actual level in volts, just if it is HIGH or LOW. I said that because I read that one could also only register an edge without knowing if it is falling or rising. Thank you so far.

User avatar
odroid
Site Admin
Posts: 35871
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 909 times
Contact:

Re: Digital GPIO readout speed xu4

Post by odroid »

The GPIO IRQ can detect falling and rising edges.
https://wiki.odroid.com/odroid-xu4/appl ... e/gpio/irq

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest