Updated 24 September 2020

Kits and Gadgets Electronics Inc.
Farwaniya, Kuwait 80003
Kuwait

ph: +965 99571844

kits@kits-gadgets.com

  • Electronic Kits
  • Parts on Sale
  • Parts in StockClick to open the Parts in Stock menu
    • Resistor
    • Potentiometer
    • Capacitor
    • Trimmer Capacitor
    • Transistor
    • Crystal
    • Diode
    • LED
    • Diac
    • Thyristor
    • IC Socket
    • IC - Logic
    • IC - Linear
    • IC - Op-Amp
    • IC - VLSI
    • Relay
    • Motor
    • Lamp
    • Transducer
    • Gear
    • Switch
    • Heatsink
    • Parts Store Inventory
  • Brand New Items
  • Used Items
  • Power Supply
  • Raspberry Pi VaultClick to open the Raspberry Pi Vault menu
    • Demonstration Kit
    • Demonstration Kit - R3
    • The P1 Header Guide
    • BBC BASIC Tutorials
    • Activating the GPIO
    • LED Program
    • Motor Program
    • Solenoid Program
    • Stepper Motor
    • 8 Relay Program
    • GPIO as Input
    • Motors and Sensors Connection Diagram
    • Autonomous Program
    • Infrared Sensor
    • Ultrasonic Sensor
    • Camera Controller
    • PWM Program
    • Robotic Arm
    • STRYDER Robot
    • Demo Kit Program
  • Arduino VaultClick to open the Arduino Vault menu
    • Stepper Motor w/ LED
    • DCMotor
  • NodeMCU ProjectsClick to open the NodeMCU Projects menu
    • Running 8 LEDs
    • 8 LEDs and ULN2803
    • 8 LED Active Modes
    • ON-OFF Switch
    • Switch, Relay and LEDs
    • Motor Drive Interface
    • Connecting to Wi-Fi
    • IR Sensor
  • More GPIOsClick to open the More GPIOs menu
    • Accessing the P5 GPIOs
  • Prototypes
  • Computer Parts
  • Picture GalleryClick to open the Picture Gallery menu
    • Other Prototypes
    • Revived HP Laptop
    • Dismantled Helicopter
    • Dismantled Phone
    • ACER Laptop Repair
    • Revived Laptop
    • Inside of Electric Drill
    • Video Cam Automation
    • My Tours and Travels
  • My Original DesignClick to open the My Original Design menu
    • Handycam Automation
    • Autonomous Robot
  • What's New!Click to open the What's New! menu
    • Article-1
    • Article-2
    • Article-3
    • Article-4
    • Article-5
    • Article-6
    • Article-7
    • Article-8
    • Article-9
    • Article-10
    • Article-11
    • Article-12
    • Article-13
    • Article-14
    • Article-15
    • Article-16
    • Article-17
    • Article-18
    • Article-19
    • Article-20
    • Article-21
    • Article-22
    • Article-23
    • Article-24
    • Article-25
    • Article-26
    • Article-27
    • Article-28
    • Article-29
    • Article-30
    • Article-31
  • Forum
  • Video GalleryClick to open the Video Gallery menu
    • IR Proximity Sensor
    • Robot Vacuum Cleaner
    • Robotic Arm - RPi
    • Raspberry Pi Demo Kit
  • About Us
  • Contact Us

Accessing the P5 GPIOs

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.

Web Hosting by Yahoo

Kits and Gadgets Electronics Inc.
Farwaniya, Kuwait 80003
Kuwait

ph: +965 99571844

kits@kits-gadgets.com