Hi,
I need a simple PRU code:
1. Wait until a start event or a counter value shared from code running on CPU
2. Flicker 2 LEDs using 2 GPIOs using a timer expiration logic. For
example the CPU code
decided to flicker one LED with 10Hz and the other one with
18Hz. Seen that a
single instruction completes in 5ns, the code running in CPU may
calculate two expiration
counters and pass them through the shared memory. (Any other
easier solution is appreciated)
3. If a stop event or a specific counter value shared from CPU
arrives, stop flickering and goto 1
The logic can be implemented for example in Python like this though I
don't know if this is the most efficient/precise way of doing this:
while 1:
tic = time.time()
if previous_ts_1 + period_1 <= tic:
led1 ^= 1
GPIO.output(PIN_LEFT, led1)
previous_ts_1 = time.time()
if previous_ts_2 + period_2 <= tic:
led2 ^= 1
GPIO.output(PIN_RIGHT, led2)
previous_ts_2 = time.time()
I enabled the virtual PRU cape using device tree overlay and
successfully compiled and launched the blink code I found on the
internet but I'm quite confused in finding out which GPIO pins are
accessible/available from PRU. There are a lot of documents, specs,
pin names, gpio offsets, pinmuxes, etc. Do I need to apply a dtbo for
having 2xGPIO or are there already available ones that the PRU can
access?
I'll be controlling the PRU using PyPruss from Python. The python code
should do this:
1. Send a start event and some information related flickering periods
2. Do something else
3. Send a stop signal.
4. Do something else and goto 1
If anyone can help me on the assembly side about timing logic, I'd be
happy. Maybe we can arrange an IRC session to talk about this.
Thanks!
--
Ozan Çağlayan
Research Assistant
Galatasaray University - Computer Engineering Dept.
http://www.ozancaglayan.com
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.