-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broadcom Pin 21/27 : Wrong number on Raspberry Pi B+ #1
Comments
Hi, Thanks for reporting this. You're right, Physical 13 was Broadcom 21 on the Revision 1 Pi B boards, but on A, B+, Pi 2 B and Revision 2 B boards it became 27. There's a handy diagram here: http://1.bp.blogspot.com/-SRF0TOvP2xo/VIKNV_Yk1hI/AAAAAAAAVMk/EJW1gPAZrc4/s1600/Raspberry-Pi-AllModelGPIO-pinouts.png I'll need to figure out a way of handling this in the library, but in the meantime you're best either editing the code as you have done (Note that this way, your code will not have portability onto rev1 boards), or adding support for BroadcomPinNumbers.TwentySeven and using that Ideally, this could be picke up as part of supporting the expanded GPIO header of the newer boards (The rev1 boards didn't have a Broad 27 output) I'm more than happy to merge pull requests if you wish to fix this in your fork :) Sorry I've never noticed this before, |
I don't know much about the old B Rev 1.0 so I'll need more info about it, like can you use GPIO 14 and 15 for general purpose like I can do in the B+ or is it only uart specific? |
I believe that on all models. GPIO 14 and 15 are usable as GPIO, but do not default as inputs unless they are explicitly exported. As Pi# requires all pins to be explicitly exported before use, they should be usable. |
Here's a link to some code which works out some of the details of what version of Pi the code is running on, including revision. http://sourceforge.net/p/raspberry-gpio-python/code/ci/default/tree/source/cpuinfo.c It's in C but should be easy to port to C#. As well as exposing this info in the PiSharp library you could include checks in PiSharp so that an exception is thrown when an attempt is made to access a GPIO pin that is not supported by the current revsion (eg, gpio27 on revision 1, gpio21 on revision 2) Cheers, |
When using PiSharp, "Physical pin 13" is refered to "Broadcom Pin 21" which doesn't work on my Raspberry Pi B+
I don't know why but it seems that this Pin has two broadcom number, and in my case it was the number "27" so I had to edit your code and change line 45 of Entities/BroadcomPinNumbers.cs
I don't know much about it but maybe it's related to the model
The text was updated successfully, but these errors were encountered: