I used the following Awk Script to run a Test on the Commands Speed of Awk,
by Clocking the Toggle of the GPIO14 LED.
I tweaked I=35700 in the two for() loops until I clocked the GPIO LED close to 1Hz.
Giving about 357000 Awk Commands per Second.
I wrote the Script into /tmp :
cd /tmp
vi gpioTmr
chmod 777 gpioTmr
/tmp/gpioTmr
And, the Script :
#!/usr/bin/awk -f
## Blink GPIO #14 LED at 1Hz :
## IPS = ( 35700 * 2 * (5 cmdsPerLoop) ) = 357000 Awk InstructionsPerSecond
BEGIN
{
P = 14;
CNT = 35700;
while(1)
{
for(I=0; I<35700; I++)
{
}
print 0 > "/sys/class/gpio/gpio" P "/value"
for(I=0; I<35700; I++)
{
}
print 1 > "/sys/class/gpio/gpio" P "/value"
}
}
#!/bin/ash
## loopLeds
echo "0" > /sys/class/gpio/gpio14/value
T=0
C14=0
while [ $T -le 77000 ]
do
# echo $T
T=$((T+1))
C14=$((C14+1))
if [ $C14 -eq 1000 ]; then
echo "1" > /sys/class/gpio/gpio14/value
fi
if [ $C14 -gt 2000 ]; then
echo "0" > /sys/class/gpio/gpio14/value
C14=0
fi
C15=$((C15+1))
if [ $C15 -eq 2000 ]; then
echo "1" > /sys/class/gpio/gpio15/value
fi
if [ $C15 -gt 4000 ]; then
echo "0" > /sys/class/gpio/gpio15/value
C15=0
fi
C16=$((C16+1))
if [ $C16 -eq 4000 ]; then
echo "1" > /sys/class/gpio/gpio16/value
fi
if [ $C16 -gt 8000 ]; then
echo "0" > /sys/class/gpio/gpio16/value
C16=0
fi
done
I clocked the Compiled C code to 200 MIPS.
Supposed to be 400 MHz ?
Maybe because of LONG int ? - or MultiTasking ?
Anyway - FAST enough for ME !
I used a Loop of 400,000,000 iterations, of probably 5 commands per loop - took 10 seconds.
> ((400000000 iterations * 5 cmdsPerLoop) / 10 seconds) = 200,000,000 = 200 MIPS
I downloaded YunGcc.tgz and UnTARred it onto my SDCard,
then compiled using GCC feom SD Card :
Just plug the SD Card into the USB Port with the GCC image.
I was using the PI.
But, I should be able to install a USB on the Core Board with minimal effort,