Discussion

Banana Pro - using GPIO

5 3860
FuLgOrE  
Hi guys,

sorry to bother you again but I have some problems to understand the usage of wiringpi.
I installed it WiringPi for the Banana Pro according to this instruction:
WiringPi

Then I tried to follow the German instruction how to use the GPIOs directly from the console:
http://www.bananapi-kaufen.de/gpios-steuern-mit-wiringpi/

According to that instruction I can set up the GPIOs to output with for example:
  1. gpio export 17 out
Copy the Code
When I check with
  1. gpio readall
Copy the Code
I can see that BCM No. 17 switched to output.
Now I can switch GPIO 0 to high with
  1. gpio -g write 17 1
Copy the Code
Up to now everything is fine and I also measured the output.

When I try to do the same steps with GPIO2 and 3 it works fine, too.
But for some GPIOs it is mixed up. From my understanding I should be able to switch for example GPIO21 to output when I use the command
  1. gpio export 5 out
Copy the Code
but this doesn't work. I get the error message
  1. gpio: Warning: File not present: /sys/class/gpio/gpio5/edge
Copy the Code
That's not the only error message. It's the same behavior on GPIO7 and 22. I didn't try them all.


Did I misunderstand something or is something wrong in the program WiringPi?

This is the output of gpio readall:
  1. bananapi@lemaker ~/WiringBP $ gpio readall
  2. +-----+-----+---------+------+---+--Banana Pro--+---+------+---------+-----+-----+
  3. | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
  4. +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
  5. |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |
  6. |   2 |   8 |   SDA.1 | ALT5 | 0 |  3 || 4  |   |      | 5V      |     |     |
  7. |   3 |   9 |   SCL.1 | ALT5 | 0 |  5 || 6  |   |      | 0v      |     |     |
  8. |   4 |   7 | GPIO. 7 |   IN | 0 |  7 || 8  | 0 | IN   | TxD     | 15  | 14  |
  9. |     |     |      0v |      |   |  9 || 10 | 0 | IN   | RxD     | 16  | 15  |
  10. |  17 |   0 | GPIO. 0 |  OUT | 0 | 11 || 12 | 0 | OUT  | GPIO. 1 | 1   | 18  |
  11. |  27 |   2 | GPIO. 2 |  OUT | 0 | 13 || 14 |   |      | 0v      |     |     |
  12. |  22 |   3 | GPIO. 3 |  OUT | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |
  13. |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |
  14. |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |
  15. |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | ALT4 | GPIO. 6 | 6   | 25  |
  16. |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 0 | IN   | CE0     | 10  | 8   |
  17. |     |     |      0v |      |   | 25 || 26 | 0 | IN   | CE1     | 11  | 7   |
  18. |   0 |  30 |   SDA.0 | ALT4 | 0 | 27 || 28 | 0 | ALT4 | SCL.0   | 31  | 1   |
  19. |   5 |  21 | GPIO.21 |   IN | 0 | 29 || 30 |   |      | 0v      |     |     |
  20. |   6 |  22 | GPIO.22 | ALT4 | 0 | 31 || 32 | 0 | ALT4 | GPIO.26 | 26  | 12  |
  21. |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |
  22. |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |
  23. |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |
  24. |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |
  25. +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
  26. | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |
  27. +-----+-----+---------+------+---+--Banana Pro--+---+------+---------+-----+-----+


Copy the Code
Do you have an idea?

Thank you in advance!
Georg
Some pins on Banana Pro/Pi has no edge. The error would not make you trouble unless you use the interrupt function of the pins that has no edge.
You can download the attachment from here  http://forum.lemaker.org/thread- ... pin_definition.html   to see which pins has the edge function(EINT).

FuLgOrE  
Sorry for my stupid questions, but I'm new to that.

If I understand the document right, than PIN
7, 8, 10, 11, 13, 15, 16, 18, 19,  21, 22, 23, 24 and 26 are marked as ENIT and could be used as binary output.
11, 13, 15, 16, 18, 19, 21, 22, 23, 24 and 26 can be set to output as described in the document. They all can also be set to high.
8, 10 cannot be set as output but don't give a error message in the console. The are still shown as IN in "gpio readall"
7 produces the following error message:
  1. bananapi@lemaker /root $ gpio export 4 out
  2. gpio: Warning: File not present: /sys/class/gpio/gpio4/edge
Copy the Code
Please help me to get an understanding for that behavior. Thank you!

FuLgOrE  
No idea why it is like described before?

FuLgOrE replied at Mon Jan 5, 2015 02:00
No idea why it is like described before?

gpio4.jpg

hodoors  
Note: The author has been banned or deleted.

You have to log in before you can reply Login | Sign Up

Points Rules