r/embedded•
QuiteMoist

Peripheral device being powered by GPIO and SPI connections

I am working on a learning/hobby project where I have a USB-UART module connected to an STM32 MCU.

I receive serial data on the USB-UART module from the PC, transmit it via UART to the MCU for processing and information is then sent back to the USB-UART module via both UART and SPI for transmission back to the PC.

I am using a GPIO input on the MCU to detect whether or not the USB-UART module has power (which should only occur when a USB cable is connected) by reading the module's 3.3v pin. The problem is that the module remains powered (although the LEDs are significantly less bright) even when the USB cable is removed. Although it is clearly not fully powered, it is enough for the GPIO input to register as high.

If I disconnect all inputs except for the SPI clock, the LED on the module starts pulsing as if powered by the clock signal. Other inputs (SPI data, chip select or UART RX for example) also all apparently provide some power to the module, even when connected by themselves.

Does anybody have any ideas how I can solve this? Could it be a problem with my grounding? Or do I need some additional circuit on all of my inputs to correct this behaviour?

Cheers

Posted Sep 19, 2023, 1:44 PM UTC

19
Loading comments…