Yo, so this one counts for checking the GPIO response of Raspberry pi.
What it means ?
How much it takes of a Raspi to give a response on GPIO when trigger action is received on another GPIO.
How am I doing this ?
Raspi GPIO 7 (set as output) —> Arduino pin 13
Raspi GPIO 8 (set as input ) —> Arduino pin 12
Open up arduino IDE and write a simple program to give a little pulse on pin 12 of Arduino which is connected to GPIO 8 of Raspi.
Upload the sketch onto your arduino.
So, I am testing this via two simplest possible ways, i.e
1. Using Shell Script
echo 7 > /sys/class/gpio/export
echo 8 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio7/direction
echo in > /sys/class/gpio/gpio8/direction
if [ $x = 1 ]
echo 1 > /sys/class/gpio/gpio7/value
echo 0 > /sys/class/gpio/gpio7/value
Now, open up the Saleae Analyzer and lets check the response, Here is what I got:
So, raspi took 2.5 miliseconds to give the output on the pin for rising edge.
2. Using Python based GPIO library:
import RPi.GPIO as GPIO
And probing on the pins, here is what I got :
Look at the response time, 11.125 micro secods!!!
Hell yeah! this is all the way too good for my work. Even though this is not as good as AVR using avr IO library but I guess works for quite a lot things in use.
All the processes are working as normal as they do. I have not deliberately changed the nice value of my shell script AND/OR python script.
No sleep is given in both the while loops INTENTIONALLY
I did the above on the my raspi with following config :
pi@raspberrypi:~$ uname -a
Linux raspberrypi 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux
Overclocking : None 700MHz ARM, 250MHz core, 400MHz SDRAM, 0 overvolt