Updated 24 September 2020
Kits and Gadgets Electronics Inc.
Farwaniya, Kuwait 80003
Kuwait
ph: +965 99571844
kits
In Raspberry Pi Model B Rev. 2, there are four more GPIOs available on P5 headerless terminal as shown below that can be accessed if the 17 GPIOs on P1 expansion header are not enough for your application.
Since there is no header soldered on this terminal, you have the option to solder an 8 pin header or direct wire connection to utilize this extra GPIO port. However, soldering an 8 pin header on this port maybe a bit tricky and even dangerous for the inexperience because of lack of extra space and proximity to the P1 expansion header. I suggest to just solder a length of #24 AWG wires on it and connect each wires to an insulated 'D' Connector female pins.
To access and control these extra GPIOs under RISCOS, load first the GPIO Module and copy the following BBC BASIC Program code routines to Strong Editor and SAVE as BASIC then RUN.
THE PROGRAM CODE
REM RASPBERRY PI MODEL B Revision 2 P5 Test
REM Programmed by Rolly Estomaguio
REM 10 August 2015
MODE 20: OFF
GCOL 3
COLOUR 26: PRINT TAB(1,14); "Press Key to activate:"
COLOUR 7: PRINT TAB(1,18); "H = All P5 GPIOs are HIGH"
PRINT TAB(1,20); "L = All P5 GPIOs are LOW"
COLOUR 18: PRINT TAB(1,1); "Raspberry Pi Model B Rev. 2 P5 GPIO Test"
COLOUR 12: PRINT TAB(1,3); "PROGRAMMED BY: Rolly Estomaguio - 10 Aug. 2015"
PROCinit
PROC_p5_test
DEFPROC_p5_test
S%= INKEY (1)
IF INKEY (-85) PROC_p5_high: REM "H" KEY
IF INKEY (-87) PROC_p5_low: REM "L" key
PROC_p5_test
DEFPROCinit
OSCLI "RMEnsure GPIO 0.00 RMLoad GPIO"
OSCLI "RMEnsure GPIO 0.40 ERROR Please install the GPIO module"
DIM G%(4)
G%()= 28,29,30,31
ENDPROC
DEFPROC_p5_high
SYS "GPIO_WriteMode",28,1: SYS "GPIO_WriteData",28,1
SYS "GPIO_WriteMode",29,1: SYS "GPIO_WriteData",29,1
SYS "GPIO_WriteMode",30,1: SYS "GPIO_WriteData",30,1
SYS "GPIO_WriteMode",31,1: SYS "GPIO_WriteData",31,1
FOR D%= 1 TO 50000: NEXT
H%= INKEY (1)
IF INKEY (-99) PROC_p5_low
IF INKEY (-87) PROC_p5_low
PROC_p5_high
DEFPROC_p5_low
SYS "GPIO_WriteMode",28,1: SYS "GPIO_WriteData",28,0
SYS "GPIO_WriteMode",29,1: SYS "GPIO_WriteData",29,0
SYS "GPIO_WriteMode",30,1: SYS "GPIO_WriteData",30,0
SYS "GPIO_WriteMode",31,1: SYS "GPIO_WriteData",31,0
FOR D%= 1 TO 50000: NEXT
L%= INKEY (1)
IF INKEY (-99) PROC_p5_high
IF INKEY (-85) PROC_p5_high
PROC_p5_low
OR YOU CAN USE:
DEFPROC_p5_high
FOR P%= 28 TO 31
SYS "GPIO_WriteMode",P,1: SYS "GPIO_WriteData",P%,1
NEXT
L%= INKEY (1)
IF INKEY (-87) PROC_p5_low
PROC_p5_high
DEFPROC_p5_low
FOR P%= 28 TO 31
SYS "GPIO_WriteMode",P,1: SYS "GPIO_WriteData",P%,0
NEXT
L%= INKEY (1)
IF INKEY (-85) PROC_p5_high
PROC_p5_low
Copyright 2013 Kits and Gadgets Electronics Inc. All rights reserved.
Kits and Gadgets Electronics Inc.
Farwaniya, Kuwait 80003
Kuwait
ph: +965 99571844
kits