step 3. Simple polling with a shell script
Now,
1] launch a normal load on your machine, i am compiling Ruby
in my BBB for example.
2] Connect pin P9.21 with P9.23 (i put in the middle a 1KOhm resistor,
you never know)
3] Launch the polling script
This will run for a minte.
Considerations:
1] The script does not eat much resources, I am a bit surprised i confess.
2] You can see the script is extremely unreliable, indeed the speed of samplig varies in time ! And also you can see the distribution of "0" and "1" is not simmetric, where the wave is completely simmetric ==> It is not sampling uniformly in time.
3] If you do
=> It means the script sampled 1476/60 => ~25 Hz
=> This speed is very very low, and most importantly we saw the sampling is not uniform in time.
TODO.
Final step would be to do the sampler in C starting from obsigna code.
I expect an improvement factor of about x50 - x100.
But I guess the principle remains valid, the sampling will be faster but never homogeneous in time => this is a problem, unsolvable in a non RTOS, AFAIK.
Goodnight !
Code:
------ poll1.sh --------------
# We read continuously pin P9.23 for one minute
# $> timeout 1m ./poll1.sh | tee 1m-out.txt
# Set P9.23 as input pin pull-down
gpioctl -f /dev/gpioc1 -c 17 IN PD
# read continuously pin state
while `true`; do
out=`gpioctl -f /dev/gpioc1 17`
echo -n "$out "
done
Now,
1] launch a normal load on your machine, i am compiling Ruby
in my BBB for example.
2] Connect pin P9.21 with P9.23 (i put in the middle a 1KOhm resistor,
you never know)
3] Launch the polling script
timeout 1m ./poll1.sh | tee 1m-out.txt
This will run for a minte.
Considerations:
1] The script does not eat much resources, I am a bit surprised i confess.
2] You can see the script is extremely unreliable, indeed the speed of samplig varies in time ! And also you can see the distribution of "0" and "1" is not simmetric, where the wave is completely simmetric ==> It is not sampling uniformly in time.
3] If you do
wc -w 1m-out.txt
you count "0" and "1", i get 1476=> It means the script sampled 1476/60 => ~25 Hz
=> This speed is very very low, and most importantly we saw the sampling is not uniform in time.
TODO.
Final step would be to do the sampler in C starting from obsigna code.
I expect an improvement factor of about x50 - x100.
But I guess the principle remains valid, the sampling will be faster but never homogeneous in time => this is a problem, unsolvable in a non RTOS, AFAIK.
Goodnight !