Beagle Board - beagleboard.org

PRU-ICSS Resources

This page is still in development. For now, visit http://elinux.org/Ti_AM33XX_PRUSSv2.

Why PRUs

A programmable real-time unit (PRU) is a fast (200-MHz, 32-bit) processor with single-cycle I/O access to a number of the pins and full access to the internal memory and peripherals on the AM3358 processor on BeagleBones (BeagleBone, BeagleBone Black, BeagleBone Green, etc.). They are design to 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 is really handy to avoid throwing 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, such as in BeagleLogic.net, MachineKit or LEDscape. Those are all supper cool projects to check out.

Ron's presentation at ELC

PRU Workshop

Materials from the PRU workshop held at the SE Michigan BeagleBone Users' Group meetup will be uploaded here shortly.

Workshop BealgeBone Black flasher image

The image used in the workshop is http://debian.beagleboard.org/images/20141104_pru_sensortag_workshop.img.7z and needs at least a 2GB microSD card. Don't worry if you run out of space flashing your 2GB microSD as it was copied off of a larger card. This image doesn't have bug that you'll see in the video where I forgot to install the 'ply' Python library--instead this image has it already installed.

To create the image, I roughly did the following steps

Workshop videos

Help in editing this videos, by combining them into one, switching screens at the right point, adding annotations and indexing, would be very welcome.

Slides

slides

Steps

  1. Flash the BeagleBone with the provided build, and boot it up.
  2. Go to Cloud-9 - http://192.168.7.2:3000/
  3. Disable HDMI in /boot/uEnv.txt (back in Cloud9 IDE terminal window)
    sed -i '/cape_disable=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN$/ s/^#//' /boot/uEnv.txt
  4. Restart the BeagleBone
    shutdown r now
  5. Load the kernel module (back in Cloud9 IDE terminal window)
    modprobe pru_speak
  6. Load the device tree overlay (from Cloud9 IDE terminal window)
    config-pin overlay BB-PRUSPEAK
    This the remote proc server, which loads firmware and manages communication between files and the PRU. It is placed inthe OS Kernel.
  7. (skip) Install 'ply' Python library (not required on provided image, but was needed to be done during the recording of the workshop)
    • Enable Internet Connection Sharing on your host to the BeagleBone network port
    • Obtain an IP address (in a Cloud9 IDE terminal subwindow)
      dhclient eth0
    • Install the 'ply' Python library using 'pip'
      pip install ply
  8. Run PRU Speak tcp server (in a Cloud9 IDE terminal window)
    cd /var/lib/cloud9/examples/extras/pruspeak
    python bs_tcp_server.py
            
    PRU Speak should now be running
  9. Use 'netcat' to connect to running PRU Speak server (in a separate Cloud9 IDE terminal window)
    nc localhost 6060
  10. Place an LED (that includes an internal resistor or using a resistor in series) between P9_42 (round side) and P9_46 (flat side). The GPIO mapping can be found in the PRU headers image on the main bone101 support page under where the location of the headers on the board is shown. Sparkfun has a nice article describing the polarity of an LED.
  11. Execute SET DIO[4],1 in PRU Speak to turn the LED on.
  12. Blink LED (to Cloud9 IDE terminal window running netcat connected to PRU Speak server)
    SCRIPT
    SET DIO[4], 1
    WAIT 100
    SET DIO[4], 0
    WAIT 100
    GOTO 0
    ENDSCRIPT
    RUN            
            

Another PRU tutorial (WIP)

PRU tutorial

Last updated by jkridner.wordpress.com on Fri Nov 18 2016 03:46:04 GMT-0000 (UTC).
45601