Wednesday, May 20, 2015

RPi GPIO Test #2: Loopback Testing

In this system configuration (GPIO_TEST), the Raspberry Pi GPIO configuration and loopback connection are identical to those of the previous example, with the addition of HMI elements such that the operation is as follows:
  • Clicking on the OUTPUT check box causes the OUTPUT.OUT value to flip; this value is passed to the PIN3.X input.
  • An event is passed from OUTPUT.IND to PIN3.REQ; this causes the flipped value at PIN3.X to be written to pin 3 of the Raspberry Pi 2 GPIO header.
  • The output state is passed electrically from pin 3 to pin 5 of the GPIO header.
  • An event is passed from PIN3.CNF to PIN5.REQ, which causes the value of the input at pin 5 of the header to appear at PIN5.X, which is passed to INPUT.IN.
  • An event is passed from PIN5.CNF to INPUT.REQ, which causes the INPUT display to be updated with the new value of PIN5.IN.

RPi GPIO Test #1: Service Interfaces

Here's a shot of a test of the first two General Purpose I/O Service Interface Function Blocks (GPIO SIFBs) for the Raspberry Pi 2:
  • Pin 3 of the Raspberry Pi 2 GPIO header is configured as an output using an instance of the GP_OUT2 type.
  • Pin 5 is configured as an input using an instance of the GP_IN2 type.
  • The output on pin 3 is looped back to the input on pin 5 for testing.
  • The value at the X input (0=LOW, 1=HIGH) of the GP_OUT instance is written to pin 3 when the REQ input is triggered.
  • The value at pin 3 is conducted electrically to pin 5.
  • The value at pin 5 can be read at the X output of the GP_IN2 instance by triggering its REQ input.
  • For more information, see the following documentation: GP_IN, GP_OUT, PIN_PULL.