diff --git a/GPIO/BeagleBoard/index.html b/GPIO/BeagleBoard/index.html new file mode 100644 index 0000000000000000000000000000000000000000..df46b0c7e8ce81f6e781fc5d43b10e677368b62a --- /dev/null +++ b/GPIO/BeagleBoard/index.html @@ -0,0 +1,89 @@ +<html> +<head> +<style> +pre code { + background-color: #eee; + border: 1px solid #999; + display: block; + padding: 20px; +} +</style> + + +</head> +<body> + +<h1>PocketBeagle PRU</h1> + +<figure> +<img src='ring.jpg' height=50%> +<figcaption>Ring oscillator with the PocketBeagle'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 PocketBeagle's PRU -> 'Programmable Realtime Unit'. The PRU is juse one component of the SOC which makes up a pocket beagle, namely the <a href="https://octavosystems.com/octavo_products/osd335x-sm/">Octavo Systems' OSD3358</a> with 256 BGA pads. The same PRU is embedded in the <a href="http://www.ti.com/product/AM3356/samplebuy">TI Sitara AM3356</a> processor.</p> + +<p>The PRU is especially insteresting for the ring test because it (a 200MHz cpu) shares memory with the PocketBeagle's 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/v2020.01/PocketBeagle/pru/ring.pru0.c">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> diff --git a/GPIO/BeagleBoard/ring.jpg b/GPIO/BeagleBoard/ring.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f26144420d1cb8397461062ea1b686634925c139 Binary files /dev/null and b/GPIO/BeagleBoard/ring.jpg differ diff --git a/index.html b/index.html index 6fa84f42688f6f803df1e0fd94f0d92338dc9546..2e0baa8561f4516dc5fa5354d81f0423678c2e07 100644 --- a/index.html +++ b/index.html @@ -39,6 +39,13 @@ The GPIO test measures how quickly pins can communicate with a processor core; t <th>date</th> </tr> +<tr> +<td>16.66</td> +<td>PocketBeagle</td> +<td><a href=GPIO/BeagleBoard/index.html>PRU</a></td> +<td>March, 2019</td> +</tr> + <tr> <td>4.000</td> <td>ATxmega8E5</td>