Skip to content
Snippets Groups Projects
Commit c559ab33 authored by Jake Read's avatar Jake Read
Browse files

add pru

parent ca6d180a
No related branches found
No related tags found
No related merge requests found
Pipeline #3218 passed
<html>
<head>
<style>
pre code {
background-color: #eee;
border: 1px solid #999;
display: block;
padding: 20px;
}
</style>
</head>
<body>
<h1>BeagleBoard PRU</h1>
<figure>
<img src='ring.jpg' height=50%>
<figcaption>Ring oscillator with the BeagleBoard's PRU</figcaption>
</figure>
<p>The crowned champion of the ring test, the PRU hits 16.6MHz</p>
<p>This ring oscillator runs on the beagleboard's PRU -> 'Programmable Realtime Unit'. The PRU is especially insteresting for the ring test because it (a 200MHz cpu) shares memory with the Beagleboards' larger onboard processor. This is probably exciting when we run big (and asychronous) software on the large processor, (i.e. an OS, which processes operations in a queue) and want to do tightly controlled realtime work at the same time. Memory sharing means we can pass messages between these contexts quickly.</p>
<a href="https://github.com/beagleboard/cloud9-examples/blob/master/extras/pru/ring.pru0c">Here's a link to the source code on github, along with other beagleboard pru examples</a>
<pre>
<code>
/*
*
* Build and run with:
* make -C /var/lib/cloud9/examples/extras/pru PRUN=pru0 TARGET=ring
*
* Makefile source at:
* https://github.com/beagleboard/bone101/blob/gh-pages/examples/extras/pru/Makefile
*
*/
#include <stdint.h>
#include <pru_cfg.h>
#include <pru_ctrl.h>
#include <stddef.h>
#include <rsc_types.h>
volatile register unsigned int __R30;
volatile register unsigned int __R31;
struct my_resource_table {
struct resource_table base;
uint32_t offset[1]; /* Should match 'num' in actual definition */
};
#pragma DATA_SECTION(pru_remoteproc_ResourceTable, ".resource_table")
#pragma RETAIN(pru_remoteproc_ResourceTable)
struct my_resource_table pru_remoteproc_ResourceTable = {
1, /* we're the first version that implements this */
0, /* number of entries in the table */
0, 0, /* reserved, must be zero */
0, /* offset[0] */
};
#pragma DATA_SECTION(init_pins, ".init_pins")
#pragma RETAIN(init_pins)
const char init_pins[] =
"/sys/devices/platform/ocp/ocp:P2_30_pinmux/state\0pruout\0" \
"/sys/devices/platform/ocp/ocp:P2_32_pinmux/state\0pruin\0" \
"\0\0";
void main(void) {
/* Read GPIO input 2 and invert to GPIO output 3 */
while(1) {
if(__R31 & (1<<2))
__R30 = 0;
else
__R30 = (1<<3);
}
}
</code>
</pre>
<p><a href='../../index.html'>Back</a></p>
</body>
</html>
\ No newline at end of file
gpio/beagleboard_pru/ring.jpg

1.17 MiB

......@@ -64,6 +64,16 @@
}
],
"gpio":[
{ "name":"Beagleboard PRU",
"serial_number":"",
"subdirectory_path":"gpio/beagleboard_pru",
"dev_board_price":27.36,
"dev_board_sales link":"https://www.digikey.com/product-detail/en/ghi-electronics-llc/POCKETBEAGLE-SC-569/POCKETBEAGLE-SC-569-ND/7603326",
"ic_price":43.73,
"ic_sales_link":"https://www.digikey.com/product-detail/en/octavo-systems-llc/OSD3358-512M-BSM/1676-1002-ND/7644258",
"cpu_frequency":200,
"ring_period":0.06
}
{
"name":"ATSAMD51",
"serial_number":"",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment