Inbedded

The Inside of an Embedded world !

Getting Up to Speed With the BeagleBone Black

With Debian installed on the BBB it is now time to start building something. While looking for tutorial and documentation I found this page which explains how to recycle an old phone LCD display. It happened that I had two old Nokia 3330 in my drawer. After taking one of them apart I had in my hand a TYPE 1 Nokia 3330 LCD display ready to connect to the BBB.

The Nokia 3330 Display is a 84x48 monochrome LCD display, nothing fancy here but it can be attached to a SPI port which is convenient since I also plan to use the SPI bus for some more advanced projects later on so it is a good “free” test device. The LCD is driven by a Philips PCD8544 which is nice since the datasheet is available online. If you don’t have an old phone around and want to reproduce my experience you can get the same LCD by Sparkfun or on Adafruit.

The BBB has two hardware SPI ports but the SPI1 port pins are used by the HDMI cape so we are left with the SPI0 port unless you want to sacrifice the HDMI output. The problem is that the SPI0 port is not enabled by default. To enable it we have to modify the device-tree configuration.

The 3.8 Kernel I use on the BBB is a patched version of the mainline Kernel. It has a set of new features that are not available upstream yet. One of these feature is the possibility to override the device tree at run-time. For that you need a patched device tree compiler (dtc) which supports the “-@” parameter. Once patched you will need to re-generate the device-tree of the BeagleBone using the “-@” option to allow run-time override. You can download the files I use to generate the custom device tree. The archive contains the patched dtc built for x86 (I prefer to develop on my laptop) and the specially crafted device-tree overlay for the Nokia LCD.

To generate the device tree that allows for run-time override you must:

1
./dtc -O dtb -o am335x-boneblack.dtb -b 0 -@ am335x-boneblack.dts

And then generate the overlay for the Nokia LCD:

1
./dtc -O dtb -o cape-nokia-00A0.dtbo -b 0 -@ cape-nokia-00A0.dts

These two files must be copied to the target. am335x-boneblack.dtb goes in /boot/uboot/dtbs/ (make a backup of the existing file first) and cape-nokia-00A0.dtbo goes in /lib/firmware/

To load our overlay we now have to:

1
sudo echo "cape-nokia" > /sys/devices/bone_capemgr.9/slots

I’ll be giving more information and publishing the source code quickly but you can already see the result of my first experiments with the BeagleBone Black in the following video:

Next time I’ll be describing in more details the device-tree file we used for the Nokia LCD display and I’ll be talking about my new project which is making use of an independently addressable RGB leds strand.

Happy hacking !

Comments