An Introduction To The BeagleBone PRU

BBB While the BeagleBone is usually compared to the Raspberry Pi, there are a few features that make the ‘Bone a vastly more capable single board computer. There is a small difference in the capabilities of the processor, but the real power of the BeagleBone comes from the PRUs available: two small cores that give the BeagleBone the hardware equivalent of bitbanging pins. [Texane] has put up two great tutorials for using the PRU in the BeagleBone that should be required reading for every BeagleBone owner.

The first tutorial goes over the capabilities of the PRUs in the BeagleBone and setting up the software environment to develop your own hardware interfaces with the PRU. While writing code for the PRU has usually involved the Beagleboard packages, TI has recently released a version of Code Composer Studio that gives the option to compile C code for the PRU.

[Texane] used this C compiler to rehash the earlier, assembly only PRU program, making development significantly easier. There’s still a bit of inline assembly, and the inline assembly support isn’t as advanced as in GCC, but it’s still much easier than the assembly only variant.

While [Texane] is using the PRU in his BeagleBone to develop something at a synchrotron facility, three are a few things where really fast hardware bitbanging comes in handy: it can be used to make a video card for a vintage mac, or any sort of VGA video card, really. Very cool stuff, especially now that you can write something in C.

Comments

  1. DeKay says:

    “Also, those of you familiar with the GNU assembler syntax should feel at home”

    I blogged about how you can wrangle GNU assembler to understand NASM-type syntax on x86. If anybody has any luck doing the same on ARM, let me know!

    http://madscientistlabs.blogspot.ca/2013/07/gas-problems.html

  2. Charper says:
  3. Rogan Dawes says:

    So I was actually thinking of using the PRU to sample a VGA signal, effectively making a video grabber. Can anyone suggest the best way of digitising the analog VGA signal at the appropriate rate?

    • rj says:

      As a cheapo first draft, a biased BJT or 7404 as a 1-bit ADC.

      • Rogan says:

        Right, I was thinking that single-bit resolution would be fine initially, I guess the bias would be to set the level at which the bit flips? Something like a potentiometer would probably help to figure out what makes sense. Not too sure how to get the voltage from VGA spec 0-0.8V up to 4-5V, though, which seems to be required by the 7404?

        • rj says:

          You don’t have to think of the 7404 as a digital device. It’s just a pair of MOSFETs, so it’s basically a really high-gain amplifier with an arbitrary transition voltage. The potentiometer to bias things up really just moves the voltage range from 0-0.7V so that it straddles the high-gain region of the 7404.

          • Rogan says:

            Looks like the “correct” approach is to use something like the TVP7002, which will do all the signal processing for me. Thanks again for the suggestions.

  4. rasz_pl says:

    Do PRUs have serializers/deserializers?

  5. Yes PRUs are decidedly cool – I’ve been using them to drive many long WS2812 based LED strips – making those 800kHz PWM signals having instructions that let you waay things like “wait until 450nS have passed from point X /// do something, now wait until 65nS have passed” is really useful

  6. qwerty says:

    Too bad the BBB is unobtanium, at least here in the EU.

  7. Ty Tower says:

    Don’t you think it would help if you first told us what a PRU is ?
    Did you just assume that because you do, everyone does!

    • Truth says:

      I was wondering exactly the same thing “Programmable Real-Time Unit, a subsystem of certain ARM microprocessors”. I hate it when people use TLA’s or ETLA’s without expanding them at least once :)

    • it’s basically a tiny extra super-fast risc core optimised for doing bitbanging on GPIOs in real-time (which in this case means 10-100nS sorts of times (or more)

      This way you can have your main CPU run a non-realtime OS like linux and still be able to do stuff at sub 1uS timings

  8. Ty Tower says:

    Pick Rocks Up …I mean

  9. jkridner says:

    There’s now a GCC compiler: http://elinux.org/Ti_AM33XX_PRUSSv2#GCC

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,520 other followers