Questions tagged [gpio]

GPIO is an acronym for general purpose input/output. The term is typically applied to a pin on a microcontroller (or other device) that may be changed between an input and output under software control. It can be used for an application defined purpose, as opposed to being constrained to a single designated function.

Filter by
Sorted by
Tagged with
16 votes
4 answers
12k views

How to drive a 20mA LED From a 4mA max GPIO Pin

I have an IC that has an GPIO with which I would like to drive a LED. Since the device will be running off battery, keeping the power use low (Zero maybe) while the LED is off as a priority. The ...
user avatar
  • 163
71 votes
3 answers
136k views

Push-pull/open drain; pull-up/pull-down

I am reading the datasheet of an ARM Cortex chip, specifically the GPIO chapter. Ultimately, I want to configure various GPIO pins to use them in "Alternate Function" mode for read/write access to ...
user avatar
  • 10.7k
49 votes
2 answers
71k views

STM32 Understanding GPIO Settings

In STM32 Standard Peripheral library, we need to configure the GPIO. But there are 3 functions which I not sure how to configure them; GPIO_InitStructure.GPIO_Speed GPIO_InitStructure.GPIO_OType ...
user avatar
  • 881
7 votes
4 answers
24k views

Control 5v relay through 3.3v GPIO using NPN transistor

I'm not very pratical as I just started learning electronics and I'm planning to make some experiment with Raspberry Pi. I'm trying to control a 5v relay board that, I think, is made for Arduino, as ...
user avatar
  • 183
16 votes
2 answers
18k views

USB to GPIO module

I'm working on a project which involves having users press buttons on a webpage which the server needs to send onto a microcontroller in the form of a GPIO signal. The only ports available on the ...
user avatar
  • 357
19 votes
5 answers
41k views

Pull-up and Pull-down Resistor Usage on Input or Output MCU Pins

Are pull-up/down resistors (whether internal or external) only needed for MCU INPUT pins? In contrast, an MCU pin configured as an OUTPUT "knows what level it's at" because it does the driving - a "...
user avatar
  • 379
10 votes
4 answers
12k views

shorting a remote control pushbutton with GPIO and a transistor

I'm trying to control my garage door remote with a GPIO pin from my Raspberry Pi. Instead of driving a relay, it would be much easier to just short the pushbutton on the remote. Is this how I should ...
user avatar
  • 111
5 votes
1 answer
15k views

What is drive strength a measurement of?

In microcontrollers and the like that have programmable drive strengths for GPIOs, said drive strengths are defined in mA. For example you might have a choice of 2mA, 4mA, 6mA, 8mA, etc. My assumption,...
user avatar
  • 990
19 votes
1 answer
9k views

Getting a large number of (~100) digital output signals from Arduino

I would like to be able to control around 100 independent LEDs using an Arduino. The problem is that the Arduino does not have nearly enough pins that can be configured for this. What would be a way ...
user avatar
  • 2,659
8 votes
3 answers
2k views

What actually happens when we set direction on GPIOs in controllers ?

Generally, while working on GPIO pins of any controller/device, we set the directions for the GPIO pins. Let's say in LPC2148(ARM7 core) controller, we have IODIR to configure the direction of Pin. We ...
user avatar
  • 167
9 votes
3 answers
6k views

Does driving an microcontroller's GPIO when it is powered off weaken the chip?

We are using the LTC5800-IPM microcontroller in a project. The way our design is now, the IC's GPIO pins will sometimes be driven high (to 3.3V) or low when it is powered-off. Will this weaken the ...
user avatar
  • 131
2 votes
3 answers
6k views

Digital Input Clamp Circuit Protection

To be able to connect some peripheral to digital input, I'm designing the circuit protection to avoid any possible failure due to over/under-voltage issue. So, I will add a clamp protection circuit. ...
user avatar
  • 357
10 votes
2 answers
7k views

Is it safe to connect two MCU pins directly to each other?

I am working on an MSP430 project that requires me to route the output of one peripheral into the input of another peripheral. Thus, I have two MCU pins connected directly to each other. This looks ...
user avatar
  • 320
4 votes
1 answer
3k views

Is it possible to get input from a 10x10 grid of switches using an arduino board? (Uno, Mega, etc.)

I'm more of a software guy but I'm working on a prototype of a game that will use a pressure sensitive 10 by 10 grid. This will require 100 switches just for the grid. The closest I've found to off ...
user avatar
  • 211
4 votes
5 answers
862 views

Controlling flip/vane clock digits

I've obtained a vane/flip clock which has 4 digits, but the controller is long gone. I plan to control the clock using a Raspberry Pi and the usual relay boards you get for them - I've done something ...
user avatar
1 vote
2 answers
891 views

How to interface UART servo? (LX-224HV)

I am trying to interface a RaspberryPi (2B) GPIO-UART to the this serial servo (Hiwonder LX-224HV), as a first step before to switch the Raspberry by an ARM MCU (STM32F407ZE on custom circuit). The ...
user avatar
1 vote
1 answer
448 views

Microcontroller GPIO in audio circuits

I'm designing an analog synthesizer, which is controlled by an STM32 -microcontroller. In several parts of the circuit, I intend to use a GPIO pin to control switches in the circuit, and in two ...
user avatar
  • 1,117
1 vote
2 answers
3k views

Solenoid Valve - Transistor or Relay?

bit of an amateur looking for some advice. I looked at the other question concerning my problem but i didn't find what i was looking for. I need to switch ON and OFF a solenoid valve using my RPI. I ...
user avatar
5 votes
4 answers
9k views

What is the common pin configuration upon microcontroller reset?

I have looked through two datasheets and user manuals now for two different microcontrollers (LPC2387 and STM32F4xx), and I haven't found (probably missed) anywhere where the initial state of the GPIO ...
user avatar
  • 4,490
2 votes
3 answers
3k views

Is it possible to use SIM900 GPIO to control relays without using external MCU?

From the product manual / reference guide it looks like SIM900 / SIM900A is already equipped with 12 GPIOs. But could not find information on how to use these GPIOs to control relays directly, instead ...
user avatar
1 vote
5 answers
3k views

How to measure voltage of a floating GPIO (Raspberry Pi)

I would like to measure that voltage of a floating GPIO on a Raspberry Pi 3. When I use a multi meter or an oscilloscope it looks like the pin is pulled to ground and shows 0. Another way of asking ...
user avatar
1 vote
2 answers
926 views

How to read decade counter with minimum pins

I just obtained some of these counters for a project: They have five connections for each slice labelled C, 1, 2, 4, and 8. As you increment the digit, the pins for the appropriate binary encoding ...
user avatar
  • 2,044
1 vote
1 answer
124 views

2 logical inputs on the same circuit

Is the below a valid circuit implementation and are there any things to watch out for? It's a simplification of the larger circuit but the crux of it is that I need to sink current into two GPIO input ...
user avatar
1 vote
1 answer
3k views

NRST pin of unpowered STLINK V2

I am using the STLINK from a Nucleo board in order to flash and debug a STM32F7 MCU on a custom board. Everything works fine except when STLINK is connected to my custom board AND unpowered. Indeed, ...
user avatar
  • 117
1 vote
3 answers
2k views

What are the mechanisms at work in a pull-up or pull-down resistor circuits with a push-buttons and a GPIO?

I have a question regarding the GPIO (from a Arduino board for example). How does it work exactly when you use it as an input pin? What are the mechanisms at work when you use it in a pull-up and pull-...
user avatar
-3 votes
1 answer
91 views

Configuration of Used Microcontroller Pins [closed]

I am using S32K142 64-pin Microcontroller. I want to configure the IO pins in RUN Mode, Sleep mode and Reset mode. For used pins, say IO, I2C and SPI pins, output pins, please tell me what should I ...
user avatar
  • 2,448
17 votes
5 answers
7k views

Are BJTs suitable for level-shifters? It seems FETs are more common,how do they compare?

I'm a hobbyist, and never got past the datasheets/tutorials for FET transistors; I'm a BJT man. I never found discussions dealing with BJT vs. FET and specific applications best suited for each type. ...
user avatar
9 votes
3 answers
22k views

Using GPIO in PC

I've got a simple project on host device that should drive 2 pins with high logic level (voltage 3.3V, 5V or 12V - doesn't matter) and wait for 2 others pins become driven high level by the peripheral ...
user avatar
16 votes
3 answers
4k views

Why do I first need to set a value and then direction of the GPIO in an embedded processor?

I have a full time job as a firmware engineer. I've recently been given a task to review GPIO configurations and change the settings as needed. I found a few pins that were incorrectly configured so ...
user avatar
  • 287
6 votes
3 answers
19k views

Max switching frequency of GPIO pins of modern cheap FPGA

How can we estimate maximum switching frequency of GPIO FPGA pins? What is maximum data rate achievable when connecting two FPGAs together without using of integrated high-speed transceivers? Or when ...
user avatar
  • 665
2 votes
2 answers
8k views

How to create USB toggle switch controled by GPIO

I have Raspberry Pi setup as NAS. The storage is external HDD powered through USB. I would like to encase this whole thing in some nice box and still be able to easily use the HDD, without ...
user avatar
  • 179
12 votes
3 answers
3k views

12 V input on 3.3 V GPIO, TVS pulled down or Schottky pull up?

I am building my own PLC that has to accept permanent inputs of up to 30 V DC into a STM32F with 3.3 V inputs. The switched input will have to work with 8-30 V, but 90% of the time the ...
user avatar
10 votes
4 answers
4k views

1.5V-rated MOSFET doesn't react to a gate input of 1.8V

I am not really an electronics specialist, but a software engineer (so excuses if I 'm asking stupid questions). I am trying to use a microcontroller GPIO output rated at 1.8V. When this pin becomes ...
user avatar
8 votes
5 answers
2k views

When IO is limited on a uC, how do you move the logic away from the uC?

For instance, if you had an Arduino with 4 digital IO pins, how could you independently light > 4 LEDs, or read the state of > 4 buttons?
user avatar
  • 191
6 votes
4 answers
10k views

Proper usage of a MOSFET to control USB

On the RaspberryPi.SE it was suggested that one can use MOSFET BS170 to switch a USB device on and off by a GPIO pin (3.3V). I need to get 500mA to power a GSM dongle; the voltage drop should ...
user avatar
  • 308
4 votes
1 answer
4k views

N-Channel MOSFET as on-off switch between battery and load

I'd like to use 3v microcontroller to activate a small fan after the microcontroller wakes from sleep. I'm not quite clear on the placement of the load (i.e. fan) and the LiPo battery in a MOSEFT ...
user avatar
8 votes
3 answers
4k views

DHT21 / AM2301 sensor not measuring humidity

I am trying to use a DHT21 with a Lamobo R1 aka Banana PI R1 to read temperature and humidity, with Armbian/Jessie and a 4.5.2 kernel. A Lamobo R1 is basically an A20 board raspberry pi compatible, ...
user avatar
5 votes
3 answers
875 views

Dump Flash Memory through a single GPIO pin

I'm working with Infineon's XMC4500 Relax Kit and I'm trying to extract the firmware through a single GPIO pin. My very naive idea is to dump one bit at a time through the GPIO pin and somehow "sniff"...
user avatar
4 votes
1 answer
4k views

Manual SPI interface on Raspberry PI

I am trying to control a MCP4131 digital pot from my Raspberry Pi using this library. Using the GPIO pins, I am "emulating" an SPI interface. I bring the ChipSelect pin to low, write my byte, then ...
user avatar
3 votes
3 answers
6k views

Simple circuit with transistor using Raspberry Pi

I'm trying to use a Raspberry Pi to control a set of 4 LEDs. I'd like to control the LEDs in software by using a ...
user avatar
3 votes
2 answers
4k views

Are I/O pin internal resistances equal to the Thevenin resistance?

I'm trying to find the Thevenin resistance of an I/O pin for the ATmega644. I see on the datasheet that there is a 20-50 kohm range of internal pull-up resistance. So with that, I can create a ...
user avatar
  • 171
2 votes
3 answers
9k views

Driving a high power (200mA) LED with a GPIO and NPN transistor

I'm trying to get my head around how to properly use NPN transistors to limit the needed current from my Raspberry PI GPIO. I want to drive a Luxeon Rebel LED from Phillips (https://www.sparkfun.com/...
user avatar
  • 287
1 vote
1 answer
1k views

need for external i/o interfacing like in 8086 for latest processors

I am a student now currently learning about interfacing 8255 with 8086. For me the doubt is that, is there a need for external i/o interfacing like in 8086 for latest processors? what is GPIO ?
user avatar
1 vote
2 answers
1k views

Multiple buttons connected to reset pin

I'm building a battery powered device based on ESP8266. There are few buttons (lets say 4 at the moment). After pushing any of them ESP should perform some action ...
user avatar
1 vote
1 answer
354 views

Powering ILI9341 LCD from MCU IO pin

Looking at the ILI9341 datasheet Electrical Characteristics, I just can't find information about power consumption. The information is also missing from the LCD module datasheet (ER-TFT024-3). I know ...
user avatar
5 votes
1 answer
3k views

AVR Pin Dual Use: Input and Output at (seemingly) the same time

I have been working on a few different versions of a bicycle light control circuit which reads in various buttons and sets various outputs accordingly such as headlight, taillight, blinkers, etc. My ...
user avatar
3 votes
1 answer
2k views

Managing I2C address conflicts with multiple MCP23017 on the same bus

I'm using a Raspberry Pi with the I2C master and I successfully wired 8 different MCP23017 chips, each with their respective addresses by setting the last 3 bits of their 7 bit addresses. They are all ...
user avatar
3 votes
1 answer
3k views

Confused between push-pull and open-drain

I am planning to use i2c based port expander (earlier I was using atmega328P's GPIO) for inputs and outputs. On a digikey search, I found MCP23008, MCP23009 and MCP23017 as possible replacements. Out ...
user avatar
  • 7,532
2 votes
2 answers
4k views

internal circuitry of IO ports in MCU [closed]

Could anyone share the internal circuit(transistor level circuit) of GPIO section in a microcontroller? I am curious to see how a pin can serve as both input or output(of course only one at a time). ...
user avatar
  • 1,116
2 votes
1 answer
805 views

How to control PcDuino pins from Java?

When I had Raspberry Pi I used to control the GPIO (pins) from a Java application using the Pi4J library. Is there any library to control the GPIO (pins) on the PcDuino using the Java language?
user avatar