Difference between revisions of "Raspberry Pi Interfacing"

From CDOT Wiki
Jump to: navigation, search
(Precautions)
(Precautions)
Line 30: Line 30:
 
# Connecting any pin to a voltage greater than 3v3 or less than 0v.
 
# Connecting any pin to a voltage greater than 3v3 or less than 0v.
  
To fully protect a pin, attach a moderate resistance (220+ ohms) and a reversed zener diode to ground rated just above 3v3.
+
To fully protect a pin, attach a moderate resistance (220+ ohms) and a reversed zener diode to ground rated just above 3v3. If you don't do this, double- and triple-check your circuits before attaching them to your Pi -- having another pair of eyes look at your circuit is also a good idea.
  
 
It is also important to protect the Pi against:
 
It is also important to protect the Pi against:
Line 37: Line 37:
 
# Over/under-voltage from the power supply.
 
# Over/under-voltage from the power supply.
 
# Short circuits due to stray tools, wire snippets, solder blobs, hardware, foil, conductive work surfaces, or liquids. Keep your workspace clean and clear while hardware hacking.
 
# Short circuits due to stray tools, wire snippets, solder blobs, hardware, foil, conductive work surfaces, or liquids. Keep your workspace clean and clear while hardware hacking.
 +
 +
== Using the Raspberry Pi with a Breadboard ==
 +
 +
There are three ways to attach the Pi's GPIO pin header to a [http://en.wikipedia.org/wiki/Breadboard solderless breadboard]:
 +
# Use an [http://en.wikipedia.org/wiki/Insulation-displacement_connector IDC] ribbon cable assembly which terminates in a [http://en.wikipedia.org/wiki/Dual_in-line_package DIP] adapter plug or a small PCB with two rows of pin headers 0.3" apart.
 +
# Use female-to-male [http://en.wikipedia.org/wiki/Jump_wire jumper wires]. The female end is connected to a selected pin in the GPIO pin header, and the male end is attached to the breadboard.
 +
# Use micro test clips (J-clips, grabber clips) to attach to individual header pins. The micro test clips can be attached to wires inserted into the breadboard, or you can use double-ended test clip cables and attach to devices plugged into the breadboard.

Revision as of 01:11, 26 September 2012

Important.png
This is a draft only!
It is still under construction and content may change. Do not rely on this information.
Note.png
Model B - Revision 1
Most of these notes apply specifically to the Raspberry Pi Model B Revision 1 board. They are not applicable to the Beta boards, and there are some small differences between the Revision 1 and Revision 2 boards.

Available Interfaces

The Raspberry Pi (model B, revision 1 or 2) is equipped with these standard interfaces:

  • USB 2.0 (x2)
  • 10 or 100 Mbps ethernet on twisted pair
  • HDMI at up to 1080p30 resolution (1920x1080, progressive scan, 30 frames/second). Note that DVI-D and HDMI are equivalent except for the connectors and the inclusion of sound in HDMI - therefore, the Pi can be connected to a DVI monitor with the appropriate HDMI to DVI-D cables and/or adapters.
  • Composite video (NTSC/NTSC-J or PAL/PAL-M format). This output can be used to drive older video monitors, or small composite LCD displays.
  • Analog stereo audio (on a 3.5 mm (1/8") TRS jack).
  • Pin header exposing GPIO, SPI, I2C, serial, and (in board revision 2) JTAG. All of these signals are provided at TTL 3v3 (+3.3 volts DC (VDC) +/-10% for a logical "high" or "1", 0 VDC for a logical "low" or "0"). A +5 VDC supply is also provided.
  • CSI - Camera serial interface. The connector accepts a [fttp://en.wikipedia.org/wiki/Flexible_flat_cable flexible flat cable].
  • DSI - Display serial interface, for connection to a small LCD panel or similar interface. The connector accepts a [fttp://en.wikipedia.org/wiki/Flexible_flat_cable flexible flat cable].

For custom-designed devices, the GPIO pin headers (and sometimes the audio output and/or USB connections) are usually used.

PinMux

The Broadcom BCM2835 system-on-a-chip used in the Raspberry Pi, like other SOCs, uses pin multiplexing (pinmux) to select which signals will be present on the pins/balls of the chip. This is done because the number of available signals exceeds the number of available pins.

Precautions

The BCM2835 is directly connected to signals present on the GPIO connector. Therefore, when you connect to the GPIO pin header, you are directly attaching to the SOC, and an over-voltage or over-current condition can seriously and irreversibly damage or destroy the SOC and render the Raspberry Pi useless.

Two conditions lead to disastrous consequences;

  1. Grounding a pin which is expected to be an input when it is configured as a high output (3.3 volts, often written as 3v3), either through the GPIO configuration or the PinMux configuration. This will cause a large current flow, probably damaging the Raspberry Pi. Likewise, connecting a pint which is expected to be an input to 3v3 when it is configured as a low output (0v) will have a similar effect.
  2. Connecting any pin to a voltage greater than 3v3 or less than 0v.

To fully protect a pin, attach a moderate resistance (220+ ohms) and a reversed zener diode to ground rated just above 3v3. If you don't do this, double- and triple-check your circuits before attaching them to your Pi -- having another pair of eyes look at your circuit is also a good idea.

It is also important to protect the Pi against:

  1. Electrostatic discharge (however, it should be noted that the Pi is reasonably ESD-tolerant)
  2. Excessive current draw (including total current drawn by all attached devices).
  3. Over/under-voltage from the power supply.
  4. Short circuits due to stray tools, wire snippets, solder blobs, hardware, foil, conductive work surfaces, or liquids. Keep your workspace clean and clear while hardware hacking.

Using the Raspberry Pi with a Breadboard

There are three ways to attach the Pi's GPIO pin header to a solderless breadboard:

  1. Use an IDC ribbon cable assembly which terminates in a DIP adapter plug or a small PCB with two rows of pin headers 0.3" apart.
  2. Use female-to-male jumper wires. The female end is connected to a selected pin in the GPIO pin header, and the male end is attached to the breadboard.
  3. Use micro test clips (J-clips, grabber clips) to attach to individual header pins. The micro test clips can be attached to wires inserted into the breadboard, or you can use double-ended test clip cables and attach to devices plugged into the breadboard.