How to speed up Beaglebone Black

Hello Everyone,

I am trying to build a sensor using Beaglebone Black (BBB) and Python and I would like to get as many data points as possible from the sensor. Using the code below, I get around 120 000 points per second.

import Adafruit_BBIO_GPIO as GPIO
import time

GPIO.setup(“P8_11”, GPIO.IN)

def get_data(n):
start_time = time.time()
my_list = [GPIO.input(“P8_11”) for i in range(n)]
end_time = time.time() - start_time
print “Time: {}”.format(end-time)
return my_list

n = 120000
get_data(n)

I am wondering if it is possible to speed up BBB, ideally to get the rate of 1 MHz. What are the options to do that?

Thanks,
Vitlai

If your just reading a gpio pin, use the pru...

Regards,

Hello Robert,

Thank you very much for the fast reply. I am new to electronics so could you please tell me what pru is? Thanks

Vitali,

just google for this: beaglebone black pru gpio

you will find a ton of info

Thank you!

Vitali