I am migrating from another platform (IoT) to a BBB, in that other device I had an interruption through a “timer” which was executed every 200us, a very precise interruption (±2us max measured with an oscilloscope) that the only thing I did was monitor the states of the digitals, a timer was used due to the little precision that handling each digital through external interruption gave us.
My initial questions are:
1.- How are timers managed in BBB? Does anyone have any idea of the accuracy?
2.- How efficient are the external interruptions?
I plan to use Cloud9 with the BoneScript library
Forget about interrupts!
The BBB CPU includes two real-time units called PRU. Use ASM code to poll the digitals in the required timing (±0us). A 200 us loop is 1000 PRU cycles.
Thanks @DTJF, looking some examples (cloud9-examples/BeagleBone/Black/pru at master · jadonk/cloud9-examples · GitHub) i saw that the PRU can work like my previous development (and better than this one), but I don’t have any idea about how to do that. That is to say, in my previous development when the timer fulfilled the established time it made a call to a function that verified the state of +20 digitals, does it possible to do using the PRU? do you know any example to configure the PRU like this way?
Hi @Fredd ,
what I always does is working with the internal timer of the pru.(https://community.element14.com/products/devtools/single-board-computers/next-genbeaglebone/b/blog/posts/beaglebone-pru---timer-functionality)
The internal PRU cycle is 5ns so you need to sum the current timer value + loop timer and inside the loop control the comparison of the current timer value X your variable.
Thanks for your support, reviewing the example I understood that the PRU (correct me if I’m wrong) must be programmed independently of the CPU, if so, how is it possible to communicate the PRU with CPU programming?
there is a shared memory between PRU and CPU
I recommend the excellent PRU Cookbook PRU Cookbook
Thank you very much, I will continue documenting myself to learn more about the PRU that I see is one of the best ways.
Seth here. The book, both versions, have specific files and background docs. all dedicated to the chip in question.
I can try to post the
how to port the PRUSS TI docs. if I can scramble and find them. It may be of some interest…
Now, things change and I am sure some of it is still relevant but I will post the files on Youtube.com if I am allowed to do so.
I have only Sitara Bootcamp files leftover. They are PPS…I thought I could still find the files.
I am sorry. I may still have the PRU Docs. in case they are difficult to track down. I will need to open some files I have not seen in some time. Get ready! Okay and so…
- I found some files from the past but some may not be able to be witnessed. I have no clue as to how to handle things but I found some preliminary material on some old 'puters.
a. PRU Read Latencies (Rev. A) (ti.com)
b. Updates to that may have taken place since then…
c. I will contact someone to see if sharing is allowed from me.
PRU Assembly Instruction User Guide
a. I am kind of bouncing around now…
b. My PRU Expertise is not concrete…