Interfacing the Raspberry Pi        to the WorldUp close and personal with P1 (and P5!)    @OmerK | OSHCAMP 2012 | 15 Sep ...
omer.kilic.name
Agenda●   Mechanical Details●   Electrical Details●   Software Details●   Tips for headless operation●   Questions
Mechanical●   Standard 100mil (2.54mm) spacing    –   P1 → 2x13 way    –   P5 → 2x4 way
M/F Jumper Cables
M/F Jumper Cables
IDC CableRe-use old floppy cables!
http://www.raspberrypi.org/archives/1404
“Breakout” boards Pi Cobbler from Adafruit
Slice of Pi from Ciseco      Pi Plate from AdafruitMore at: http://elinux.org/RPi_Expansion_Boards
Electrical●   P1    ●  Power       ● 3.3V (max I: ~50mA)       ● 5V (max I: Power Supply - 700mA)    ● 17 GPIO Pins, multi...
Revision 2 – Changes●   Fuses protecting the USB outputs have been removed    –   Power the board via back-feeding hub●   ...
Revision 2
Power (5V)
Electrical             3.3V!
3.3V
http://www.flickr.com/photos/56601859@N00/3064468115
Use protection●   Level Shifting    –   Logic buffers (74HCT242)    –   Birectional translators (TXB0108)    –   Discrete ...
Recommended Distro                      Occidentalis by Adafruithttp://learn.adafruit.com/adafruit-raspberry-pi-educationa...
Software●   Peripherals are memory mapped    –   Access via /dev/mem        ●   Faster, needs root, hacky, dangerous!    –...
Software – GPIO●   /sys/class/gpio/ (export|direction|value|interrupt|unexport)●   Example:    –   echo 17 > /sys/class/gp...
Software – I2C●   /dev/i2c-0 and /dev/i2c-1●   Install the i2c-utils package    –   i2cdetect, i2cdump, i2cget, i2cset●   ...
Software – SPI●   /dev/spidev0.0 and /dev/spidev0.1    –   Chip select pins●   Support for kernel hardware modules:    –  ...
Software – PWM●   No kernel module (or libgpio) support, memory    mapped voodoo necessary.●   WiringPi example:    –   pi...
Libraries●   Python    –   Quick2wire, Rpi.GPIO●   C    –   WiringPi, pihwm●   Bindings also available for Java(!), Ruby, ...
Tips for headless operation●   Use 240/16 (CPU/GPU) RAM split    –   No need for graphical stuff●   Setup avahi/zeroconf  ...
Questions?
Upcoming SlideShare
Loading in...5
×

Interfacing the Raspberry Pi to the World

7,791

Published on

Presentation from the Open Source Hardware Camp held at Hebden Bridge on 15-16 Sepmtember 2012. Event details at: http://oshug.org/event/oshcamp2012

Published in: Technology, Business
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
7,791
On Slideshare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
201
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Interfacing the Raspberry Pi to the World

  1. 1. Interfacing the Raspberry Pi to the WorldUp close and personal with P1 (and P5!) @OmerK | OSHCAMP 2012 | 15 Sep 2012
  2. 2. omer.kilic.name
  3. 3. Agenda● Mechanical Details● Electrical Details● Software Details● Tips for headless operation● Questions
  4. 4. Mechanical● Standard 100mil (2.54mm) spacing – P1 → 2x13 way – P5 → 2x4 way
  5. 5. M/F Jumper Cables
  6. 6. M/F Jumper Cables
  7. 7. IDC CableRe-use old floppy cables!
  8. 8. http://www.raspberrypi.org/archives/1404
  9. 9. “Breakout” boards Pi Cobbler from Adafruit
  10. 10. Slice of Pi from Ciseco Pi Plate from AdafruitMore at: http://elinux.org/RPi_Expansion_Boards
  11. 11. Electrical● P1 ● Power ● 3.3V (max I: ~50mA) ● 5V (max I: Power Supply - 700mA) ● 17 GPIO Pins, multiplexed with: ● UART ● I2C ● SPI ● PWM● P5 ● 4 extra GPIO pins ● Power● More signals broken out to S2 and S5 (Camera and flat panel connectors) ● Fiddly!http://elinux.org/RPi_Low-level_peripherals
  12. 12. Revision 2 – Changes● Fuses protecting the USB outputs have been removed – Power the board via back-feeding hub● JTAG on P1● I2C peripherals swapped● P5 – New header: 4 more GPIO + Power● P6 – Reset Jumper● Mounting holes!!!!!!!!!!!! http://www.raspberrypi.org/archives/1929
  13. 13. Revision 2
  14. 14. Power (5V)
  15. 15. Electrical 3.3V!
  16. 16. 3.3V
  17. 17. http://www.flickr.com/photos/56601859@N00/3064468115
  18. 18. Use protection● Level Shifting – Logic buffers (74HCT242) – Birectional translators (TXB0108) – Discrete shifters (FETs + Rs)● Current limiting R
  19. 19. Recommended Distro Occidentalis by Adafruithttp://learn.adafruit.com/adafruit-raspberry-pi-educational-linux-distro/overview
  20. 20. Software● Peripherals are memory mapped – Access via /dev/mem ● Faster, needs root, hacky, dangerous! – Use kernel modules/sysfs ● /sys/class/gpio/gpioX/value etc. ● Slower, doesnt need root, easier, (relatively) safer
  21. 21. Software – GPIO● /sys/class/gpio/ (export|direction|value|interrupt|unexport)● Example: – echo 17 > /sys/class/gpio/export – echo “out” > /sys/class/gpio/gpio17/direction – echo “1” > /sys/class/gpio/gpio17/value● Interrupt support – Use poll() on /value
  22. 22. Software – I2C● /dev/i2c-0 and /dev/i2c-1● Install the i2c-utils package – i2cdetect, i2cdump, i2cget, i2cset● Support for kernel hardware modules: – echo ds1307 0x68 > /sys/class/i2c-adapter/i2c- 0/new_device● i2c-dev details: – http://kernel.org/doc/Documentation/i2c/dev-interface
  23. 23. Software – SPI● /dev/spidev0.0 and /dev/spidev0.1 – Chip select pins● Support for kernel hardware modules: – Need to rebuild kernel!● spidev details: – http://kernel.org/doc/Documentation/spi/spidev
  24. 24. Software – PWM● No kernel module (or libgpio) support, memory mapped voodoo necessary.● WiringPi example: – pinMode(1, PWM_OUTPUT); – PwmWrite(500);
  25. 25. Libraries● Python – Quick2wire, Rpi.GPIO● C – WiringPi, pihwm● Bindings also available for Java(!), Ruby, Erlang
  26. 26. Tips for headless operation● Use 240/16 (CPU/GPU) RAM split – No need for graphical stuff● Setup avahi/zeroconf – No need to remember IP address ● ssh raspberrypi.local● Setup mosh – Great for intermittent networking
  27. 27. Questions?
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×