A simple input example for using the PRU to recieve input from a pin.
C OpenEdge ABL Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
device-tree
Makefile
Readme.md
input.c
input.hp
input.p

Readme.md

BBB PRU Input Program

A simple PRU input example. This program runs on PRU1 and waits for P8.28 to go high and then pulls P8.29 high.

Circuit

A switch should be placed between the 3.3V and P8.28. An LED should be placed in series with a 1k resistor between P8.29 and ground.

Installation

An updated device tree compiler may be needed:

wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh; chmod +x dtc.sh; ./dtc.sh

The PRU Drivers must be installed also.

The HDMI must be disabled by adding the following line to /boot/uEnv.txt

optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

The following will compile all the code for the PRU and main cpu:

make

Compile the device tree overlay and enable it:

cd device-tree
make enable

Running

./input