Skip to content

Raspberry Pi 2 Pin Assignment Micro


Raspberry Pi Pinout Diagram | Circuit Notes

How to Navigate Your Raspeberry Pi 3 Model B

If you build it, they will program. The genesis of the Raspberry Pi came from a few college students concerned about the dwindling number and skills of students applying to study Computer Science.

Newer computers and game consoles have replaced the old machines where most of us learned to program. The creators capitalized on the powerful and affordable processors designed for the booming mobile device arena, and they were able to create an economical, programmable computer with attractive graphics that could boot into the programming environment and not break the bank.


Buy Raspberry Pi 3 Model B Now

The Raspberry Pi is a credit card sized single-board computer with an open-source platform that has a thriving community of its own, similar to that of the Arduino. It can be used in various types of projects from beginners learning how to code to hobbyists designing home automation systems.

There are a few versions of the Raspberry Pi, but the latest version, has improved upon its predecessor in terms of both form and functionality. The Raspberry Pi Model B features:

• More GPIO
• More USB
• Micro SD
• Lower power consumption
• Better audio
• Neater form factor

This higher-spec variant increases the Raspberry pi GPIO pin count from 26 to 40 pins. There are now four USB 2.0 ports compared to two on the Model B. The SD card slot has been replaced with a more modern push-push type micro SD slot. It consumes slightly less power, provides better audio quality and has a cleaner form factor.

To get started you need a Raspberry Pi 3 Model B, a 5V USB power supply of at least 2 amps with a micro USB cable, any standard USB keyboard and mouse, an HDMI cable and monitor/TV for display, and a micro SD card with the operating system pre-installed. The NOOBS (New Out Of the Box Software) OS is recommended for beginners, and you may choose one of several from the download page.

This pinout diagram will help you get familiar with the layout of the board and get started in immersing yourself into your own passion projects.


Click to enlarge

Raspberry Pi Products and Kits:

Raspberry Pi 3 Model B
Raspberry Pi Accessories
Raspberry Pi Books
LED Kit for the Raspberry Pi

Download the PDF here












Return to “Interfacing (DSI, CSI, I2C, etc.)”

Who is online

Users browsing this forum: No registered users and 7 guests

baconfatlabs
Posts:1
Joined: Tue Jul 17, 2012 11:05 pm

Use GPIO as USB?

Wed Jul 18, 2012 3:24 am

Has anyone given any consideration as to whether the GPIO pins can be configured to be USB ports? If so, what are the pitfalls, or steps necessary? I would like to develop a board to stack on top of the Pi, but the majority of the stack will be USB.

Thanks for any help!
timothy3592
Posts:64
Joined: Wed Jun 13, 2012 6:06 am

Re: Use GPIO as USB?

Wed Jul 18, 2012 6:22 am

An interesting idea. I remember a post on this forum (not sure which post) stating that the pi's gpio pins can be operated at something approaching the Megahertz range at maximum. This seems like an issue to using the gpio as a usb. Usb cables have 4 wires 2 for power and 2 for data of which one could be a clock line or something. Which means you essentially have one pin that's passing data and at one bits wide even 1Mhz is a transfer rate of 1Mb/s; usb 1.0 is 12Mb/s and 2.0 is up to 480Mb/s. So you'll have some throughput issues, even assuming that the usb standard allows operating the bus much slower than just what the maximum allows. Might make for a fun tinkering project though, and please feel encouraged to try, just don't mix the pins up, the logic pins can't take 5 volts.
not-a-number
Posts:1
Joined: Mon Jul 02, 2012 2:54 pm
Location: Germany

Re: Use GPIO as USB?

Wed Jul 18, 2012 8:44 am

The USB core of the BCM2835 is a separate part of the SoC. So it's independent of GPIO part.
Which also means: the USB-pins are cannot be mapped as alternative functions of GPIO pins.
(See http://www.elinux.org/RPi_Low-level_peripherals)
The schematics show, that the 'A' boards have the BCM's USB-pins connected directly to the USB-connector and for the 'B' boards, the BCM's USB pins are connected to the LAN controller, which then provides two downstream USB ports that are connected to the two USB connectors.
So there are no (hardware-) USB-pins available at the GPIO connector.
If you want to do software-USB (emulation) using GPIO pins, it's your choice, which pins to use.
But I'm in doubt, if - under Linux - it's possible to meet the timing specifications required for USB transfers.
Usb cables have 4 wires 2 for power and 2 for data of which one could be a clock line or something.
USB has NO clock line - differential signalling and NRZI encoding with intrinsic clock signal is used to transmit bits.
Gert van Loo
Posts:2452
Joined: Tue Aug 02, 2011 7:27 am
Contact:Website

Re: Use GPIO as USB?

Wed Jul 18, 2012 12:13 pm

baconfatlabs wrote:Has anyone given any consideration as to whether the GPIO pins can be configured to be USB ports? If so, what are the pitfalls, or steps necessary? I would like to develop a board to stack on top of the Pi, but the majority of the stack will be USB.

Thanks for any help!
No!
Not only are the pins limited is speed, there is no hardware behind it to get high speed data from/to the pins in any of the interfaces.
hippy
Posts:2574
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Use GPIO as USB?

Wed Jul 18, 2012 1:40 pm

timothy3592 wrote:An interesting idea. I remember a post on this forum (not sure which post) stating that the pi's gpio pins can be operated at something approaching the Megahertz range at maximum.
According to http://www.raspberrypi.org/phpBB3/viewt ... f=2&t=2969 50MHz may be doable so 12MHz for slowest USB should be achievable. Cheap micros manage some limited USB capabilities through bit banging so an R-Pi might be up to the task, though perhaps more feasible as bare metal than with Linux on top.
DexOS
Posts:876
Joined: Wed May 16, 2012 6:32 pm
Contact:Website

Re: Use GPIO as USB?

Wed Jul 18, 2012 3:22 pm

You could use one of there's "Microchip 24FJ64GB002 microcontroller" to add a USB Host, i have used one of these to add usb support to my bare metal OS on the R-PI, in my case it uses Uart pins and was for uses with hid devices.

Here's a ready made example: http://www.hobbytronics.co.uk/usb-host-board

Note: The "24FJ64GB002" is a lot cheaper, than that board.
Batteries not included, Some assembly required.
drlucas
Posts:87
Joined: Sat Mar 15, 2014 12:33 pm
Location: Pickering, Ontario, Canada, EH?

Re: Use GPIO as USB?

Sat Aug 16, 2014 4:31 pm

I know this is an old thread....

I do have an interesting challenge. I have a device that has a USB mini connector on it and it connects to a SCL and SDA pin on a RDS (for radio text on fm transmitter) chip. The normal use of the USB mini connector connects to a PC serial port and an app on the PC lets you set the radio text. I've been able to with some help on another group here in these forums connect directly from the RDS chip to the Pi and bit bang through a python script set the radio text. All good. What I would like to do is use a USB A to USB mini cable connect the Pi (B+ model) to the fm transmitter's mini connector. The reason I want to do this is simply to prevent others from having to solder on the transmitter (because it can void the warranty).

Is it possible to use one of the USB ports and take pins 2 and 3 and map it to a GPIO pin? The alternative for me is to just take a usb mini connector and chop the cable in half and just solder on a female GPIO at the other end.

Let me know what people think about the approach.
thanks!
Ryan
Gert van Loo
Posts:2452
Joined: Tue Aug 02, 2011 7:27 am
Contact:Website

Re: Use GPIO as USB?

Sun Aug 17, 2014 10:32 am

Let me repeat what I think you want to do:
Take a USB port of the B+, disconnect the USB wires and instead connect the I2C signals SCL and SDA from the GPIO to it.

If so: Yes, you can do that.
But this will void the warranty of your Pi.
drlucas
Posts:87
Joined: Sat Mar 15, 2014 12:33 pm
Location: Pickering, Ontario, Canada, EH?

Re: Use GPIO as USB?

Sun Aug 17, 2014 11:09 am

I believe that is one way of achieving what I want to do....but that's not how I want to do it!

I have a FM radio that has a USB mini port on it. Pin 2,3 on it connect to the SCL and SDA pins that I need to get access to.

Option 1 - solder on the chip directly and solder other end to GPIO
Option 2 - take a USB mini cable and cut in half and solder female GPIO pin on it (cleanest approach I have so far)
Option 3 - take usb port on the B+ disconnect the usb wires and connect pin 2,3 to two GPIO pins
Option 4 - wave magic wand and make the USB port dumb and map pin 2,3 to two GPIO pins (would save from having to splice a USB mini cable).

It's that's that option 4 that I'm wonder if it is at all possible to achieve.
Gert van Loo wrote:Let me repeat what I think you want to do:
Take a USB port of the B+, disconnect the USB wires and instead connect the I2C signals SCL and SDA from the GPIO to it.

If so: Yes, you can do that.
But this will void the warranty of your Pi.
Burngate
Posts:5170
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact:Website

Re: Use GPIO as USB?

Sun Aug 17, 2014 11:43 am

drlucas wrote:...
Option 4 - wave magic wand and make the USB port dumb and map pin 2,3 to two GPIO pins (would save from having to splice a USB mini cable).
...
Since the USB ports are hard-wired to the USB chip, and the GPIO pins are hard-wired to the BCM chip, the magic wand will have to cut tracks on the board.
drlucas
Posts:87
Joined: Sat Mar 15, 2014 12:33 pm
Location: Pickering, Ontario, Canada, EH?

Re: Use GPIO as USB?

Sun Aug 17, 2014 5:28 pm

OK - wasn't sure if there was some sort of way I might be able to do something in software to map it....was a long shot - the closest thing I've seen so far is the USB to TTL cable from adafruit- but would need an adapter on the USB side of things. if anyone sells a breakout USB mini cable to female pin that would likely work but I haven't found one yet...probably because no one else is trying this type of hack.
AndrewS
Posts:3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact:Website

Re: Use GPIO as USB?

Sun Aug 17, 2014 5:57 pm

...because connecting SDA and SCL to a miniUSB connector obviously violates all known USB specs
I think cutting a cable in half will be your only option - chances are if you search around you'll probably be able to find complete USB cables cheaper than you can buy just the bare connectors for. But check the pinouts (e.g. with a multimeter) because apparently not all cable manufacturers stick to the standard USB wire-colouring scheme