Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Raspberry Pi Computer Architecture Essentials

You're reading from  Raspberry Pi Computer Architecture Essentials

Product type Book
Published in Mar 2016
Publisher
ISBN-13 9781784397975
Pages 232 pages
Edition 1st Edition
Languages
Authors (2):
Andrew K. Dennis Andrew K. Dennis
Profile icon Andrew K. Dennis
Teemu O Pohjanlehto Teemu O Pohjanlehto
Profile icon Teemu O Pohjanlehto
View More author details

Table of Contents (18) Chapters

Raspberry Pi Computer Architecture Essentials
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Introduction to the Raspberry Pi's Architecture and Setup 2. Programming on Raspbian 3. Low-Level Development with Assembly Language 4. Multithreaded Applications with C/C++ 5. Expanding on Storage Options 6. Low-Level Graphics Programming 7. Exploring the Raspberry Pi's GPIO Pins 8. Exploring Sound with the Raspberry Pi 2 9. Building a Web Server 10. Integrating with Third-Party Microcontrollers 11. Final Project Index

Running tests on the OS and configuration changes


There are ranges of hardware tests we can run on the Raspberry Pi to learn more about it. These include checking voltage readings, the temperature of the device, and testing that the GPIO pins work correctly.

You can run these tests by either connecting to the Pi over SSH or loading up the LXTerminal from the desktop.

Diagnostic tests

The following diagnostic tests provide basic information on your Raspberry Pi. This just provides a taster and many more are available. A more comprehensive list of commands is available via the links at the end of this section.

You should, however, run these tests to get a basic idea of what is possible.

The system information of your Raspberry Pi can be run via the following command:

cat /proc/cpuinfo

Version information can be seen via the following command:

cat /proc/version

Memory information can be accessed using the following command:

cat /proc/meminfo

The microSD cards partitions via the following command:

cat /proc/partitions

To check the temperature of the device we can use the vcgencmd command:

vcgencmd measure_temp

We can also use this command with a different parameter to see the voltages. The basic command is as follows:

vcgencmd measure_volts id

In this command, id is one of the following items:

  • core for the core voltage

  • sdram_c for the sdram Core voltage

  • sdram_i for the sdram I/O voltage

  • sdram_p for the sdram PHY voltage

You can find more commands at elinux.org where a guide to vcgencmd can be found (http://elinux.org/RPI_vcgencmd_usage).

Over and underclocking the Raspberry Pi

You may want to tweak the performance of your Raspberry Pi 2. This can be achieved by overclocking the device.

Overclocking is the process of forcing the CPU or other component, for example the GPU, to operate faster than its advertised or OS configured clock frequency. In the process of overclocking it is also possible to change the operating voltage to increase the device's speed.

There is a risk associated with overclocking a device, such as instability of its operation or faster degradation of components.

The raspi-config menu provides a set of screens to guide you through this process.

You can access raspi-config from the command line by typing this command:

sudo raspi-config

Then you select an overclock option from the menu that is presented.

Alternatively, you can modify the boot configuration file directly from inside the terminal window.

You will need to edit the /boot/config.txt file.

Once you have this open you will see a number of commented out values, for example, #arm_freq=800.

In the case of our Raspberry Pi 2 the processor runs at 700MHz. We could uncomment this line and up the speed of the processor to 800MHz.

An in-depth guide to overclocking the Raspberry Pi 2 can be found at Hayden James' website: http://haydenjames.io/raspberry-pi-2-overclock/.

Going further – testing the GPIO pins

For those interested in exploring diagnostic tools further there is the option of downloading the pigpio GPIO pin test. As you start to work more with the pins this test will come in handy for debugging problems, and allow you to check if you have accidentally damaged a pin.

You can download the pigpio library directly to your Raspberry Pi from http://abyz.co.uk/rpi/pigpio/download.html.

An overview and instructions on use can be found at http://abyz.co.uk/rpi/pigpio/index.html.

Example applications and tests can be found at http://abyz.co.uk/rpi/pigpio/examples.html.

For those looking for a digital waveform view for the Raspberry Pi's GPIO pins you can install piscope from http://abyz.co.uk/rpi/pigpio/piscope.html.

You have been reading a chapter from
Raspberry Pi Computer Architecture Essentials
Published in: Mar 2016 Publisher: ISBN-13: 9781784397975
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}