LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-15-2019, 04:33 AM   #1
huuchinh02
LQ Newbie
 
Registered: Oct 2019
Posts: 1

Rep: Reputation: Disabled
Question Performance external GPIO interrupt on Orange Pi Zero


I am using OPi.GPIO to detect one interrupt from my peripheral module. It worked fine with the low trigger but it was missing some signals at a higher frequency (It was latency). I jumped into the source code of the library, it seemed to handle the interrupt with using polling output logic level, not true interrupt same as the microcontroller.
I want to ask whether orange pi is possible to make a true interrupt.
I looked for the internet and found some libraries in python better than OPi.GPIO such as: wiring-pi, pigpio...

1. The wiring-pi was implemented by C language but I am using python
2. The pigpio seem to support only for Raspberry Pi but I am using Orange Pi

Which the best way should I do now to implement my project? I think about some ideas to resolve it below:

- Build the new hardware include microcontroller and the peripheral. I'll use the MCU to handle it and making one connection between this board and Orange Pi through some basic interfaces such as SPI, I2C or UART.
- Switch to Raspberry and use pigpio. I don't ensure whether the performance better than OPi.gpio
- Is it possible to build another library by myself? If yes, how can I build it?

I hope to get the best suggestion. Many thanks!
 
Old 10-17-2019, 08:46 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,251

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
My basic understanding was: GPIO is slow in hardware terms; Python is slow in software terms. I'm not surprised to see latency. I'm surprised you designed that, but maybe other factors forced your hand (As often happens).

The sort of hardware bodge I might attempt is to OR your gpio pin with a real interrupt, and stick in a routine which basically asks "Is the gpio pin low?" and act accordingly. There were also inventive ways of getting more interrupts than interrupt pins on early cpus like the Z80. IIRC, it used to float the databus in response to an interrupt in some mode, and read the number some interrupt controller put on it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] GPIO UIO Interrupt error on Zynq 7020 abhinav007 Programming 4 03-01-2018 04:11 AM
LXer: Raspberry Pi Zero WH adds 40-pin GPIO header to Zero W LXer Syndicated Linux News 0 01-14-2018 04:40 AM
GPIO access on a Fujitsu Mini-ITX Industrial Mainboard, PCI Driver for GPIO mechatrix Linux - Embedded & Single-board computer 3 11-20-2011 03:57 PM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration