Real time processing on the Beaglebone AI

19th Jul 2021

The Beaglebone AI offers a distinctive advantage over the Raspberry Pi and other boards. It allows you to perform real time data processing or operations or to perform actions in “hard real time”, and this can be critical for IoT projects. A Programmable Real Time Unit is used by Beaglebone.

Introducing the PRU ICS

The Programmable Real-time Unit and Industrial Communications Subsystem is a small processor that is tightly integrated with an IO subsystem, offering low-latency control of IO pins on SoC devices. This subsystem can be used to implement simple and flexible control functions, peripherals and state machines that directly access IO pins of the device, as well as communicate with the application cores. ​The programmable real-time unit (PRU) is a 200 Mhz processor with single-cycle I/O access to a number of the pins. It also features full access to the internal memory and peripherals on the AM3358 processor on the BeagleBone, BeagleBone Black, BeagleBone Green, and other BeagleBone Boards. They provide software-defined peripherals as part of the Programmable Real-time Unit Industrial Control SubSystem (PRU-ICSS) and are capable of implementing things like 25 pulse-width modulators, 4 soft UARTs, stepper motor drivers and much more. Having these controllers integrated saves on having to add in another device to control or interface to a new peripheral. The real power comes when you need high-bandwidth between the main CPU and these controllers, as explained in the following projects BeagleLogic.net, MachineKit or LEDscape.

Why would “hard real time” be needed?

These separate 200 Mhz micro controllers support tasks where there is critical need for very low latency or time-critical tasks. This could include controlling motor drivers or controlling an LED signage panel and refreshing the LED matrix using the PRU. This means that when you are using a button that is connected to a device, something will happen on the screen as you click the button. You will likely want to see this happen as quickly as possible. You want this to be fast but not necessarily real time. This is called “soft real time”, but in other situations, you will need the events to happen in “hard real time.” In the latter case, after an event happens, you will want to precisely tell the time between the two events. For example, this could be important in robotic orchestration in industrial use cases or in a car safety mechanism where an object is detected where there needs to be action triggered in hard real time so you can know with certainty that the response will happen in real time. This is essential in safety critical situations. Beaglebone has the units to support this. Separate processors to the CPU are dedicated to controlling these real time operations. Sensors and robotics arms would be typical types of peripherals that would be connected to the board in this type of case. This would also be important in audio signal processing and vision processing in audiovisual IoT projects.

Read these other articles on setting up a Beaglebone in an embedded Linux project: