Hardware Reference
In-Depth Information
The big question, however, revolves around whether it is worth it. Currently, it costs €40 for the bridge, which is
around the same price as the Arduino Due, and twice the price of an Uno. So, although it is an interesting idea, this
device is only worth using if the cost (in time) of connecting an Arduino directly through I 2 C exceeds €20.
However, in those cases in which there is a good Arduino shield available for use, and there is nothing similar to
the Raspberry Pi, then this shield can easily justify the cost. (Provided, of course, that you couldn't alleviate the need
of a Raspberry Pi by processing the data on an Arduino, and transmitting the data to a suitable machine for display.)
Software Options
Being a Linux machine in its own right means you are able to run any of the traditional open source software on
the Raspberry Pi. The official Raspbian distribution is recommended for this because they have compiled most of
the Debian packages to be suitable for the Raspberry Pi's ARM chip. Software that is not open source, or has been
distributed in binary form, will need a Raspberry Pi-specific version, as you'd expect for any non-Intel architecture.
If you find you need to compile your own packages from source, then you may need to amend the make file to
ensure it uses hard floats:
CFLAGS="-O2 -pipe -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard"
The “hard float” options ensure that all floating-point operations are done in hardware, on the CPU, and not emulated
in software. The reason for this is that software emulation is at least 10 times slower than the hardware-based solution.
N If you have an old install of the Foundation's Raspberry Pi Linux distribution (based on Squeeze), it is likely to
have been compiled with the soft float version, making your hard float compilation incompatible. Although it is possible
to recompile the libraries to use hard floats, and regain some speed, it is easier to simply download a new image and
reinstall. These newer images are called Raspbian and all use armhf. Also, the memory controller on the Model B changed
(when they doubled the RAM), so you will need a new install image in this case also.
Tip
Even without building (or rebuilding) your own packages, there is a lot of standard software already available.
You can therefore turn your Raspberry Pi into a print server, BitTorrent client (such as with Seed Field), NAS server,
and so on, without any effort whatsoever. Note that, whereas its small size would suggest a nice compact file server,
the interrupt cascade problems on the USB could mean issues if you intend to use it for media streaming as opposed
to data backup. Also note that the Raspberry Pi is sometimes temperamental with USB hubs. (The newer drivers are
better, but the issues still exist.) Therefore, it is recommended to fit a single drive to the system, which is as large as
you can currently afford. It might not be able to do software-based RAID, but because it's a predominantly read-only
device (as you have original media files on DVD, or there's a backup), it's not necessary.
As you know, the Pi in Raspberry Pi stems from Python, the scripting language intended to be the de factor
standard for the machine. However, with the inclusion of a full development tool chain, most other languages are
available for use. If you're writing small programs (of, say, fewer than 10,000 lines), then you can happily build out
your Raspberry Pi software on the device itself. For larger projects, it's usually better to build (and test) on a full-size
Linux box, and then cross-compile it for the Raspberry Pi.
Cross-compilation is the process of building an executable for one machine, using the compiler on another—more
specifically, building for one architecture, using the architecture of another. For example, this could be compiling
for the ARM processor while on an Intel machine. This means that you can use the improved processing power of a
desktop machine to quickly compile for the smaller, less able, machine.
 
Search WWH ::




Custom Search