Documentation Center

  • Trials
  • Product Updates

Contents

BeagleBoard GPIO Read, Overo GPIO Read, PandaBoard GPIO Read, Raspberry Pi GPIO Read

Read logical value of GPIO pin configured as input

Library

Simulink Support Package for BeagleBoard Hardware

Simulink Support Package for Gumstix Overo Hardware

Simulink Support Package for PandaBoard Hardware

Simulink Support Package for Raspberry Pi Hardware

Description

Use this block to:

  • Create a physical input from a GPIO pin.

  • Read the logical value of the GPIO pin at intervals that are determined by Sample time.

  • Send the logical value to other blocks in the model as a stream of boolean values.

  • The maximum input voltage of the GPIO pin is 1.8 V.

    Warning   You can damage your target hardware by:

    • Shorting a GPIO pin to ground.

    • Shorting a GPIO pin with high voltage to another GPIO pin with low voltage.

    • Connecting a GPIO pin to a voltage source greater than the maximum voltage.

    • Exceeding the maximum current by driving multiple GPIO pins high simultaneously.

Dialog

Board

Select the specific board you are using. You can find this information on the target hardware, product packaging, or product documentation.

Changing Board updates the GPIO number choices and the View pin map diagram.

You can print the pin map to refer to it later.

GPIO number

After selecting the Board, select the number of the GPIO pin. Do not use the same GPIO number in multiple blocks within a model.

To see the locations of the GPIO pins on the target hardware, click the View pin map button.

Internal resistor

This parameter is not available for Raspberry Pi™ hardware.

Set the GPIO internal resistor to:

  • Off — Do not use a pull-up or pull-down resistor.

  • Pull-up — Use the internal pull-up resistor. When the physical input is inactive, disconnected, or has high impedance, the voltage of the GPIO pin goes high, settling at the voltage of Vdd on the processor.

  • Pull-down — Use the internal pull-up resistor. When the physical input is inactive, disconnected, or has high impedance, the voltage of the GPIO pin goes low, settling at the voltage of ground on the processor.

Changing this parameter updates the diagram to the right of the parameter.

Sample time

Select the sample time for reading the state of the GPIO pin. This parameter value defaults to 1/10 second.

Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.

See Also

| | | | |

External Web Sites

Was this topic helpful?