0
\$\begingroup\$

I'm using an STM32L053 MCU to interface to a poorly-documented PCB module (DRA818V). There are a couple of GPIO driven signals as well as a UART involved, and I want to make sure I'm doing things safely. It seems that I can connect the UARTs directly (RXD to TXD) and nothing else is needed there. For the GPIOs, I'm not so sure. I believe, in the module, the GPIOs just go directly to the MCU inside it. I'm concerned that, when I pull the lines low in the STM32, the other module might source too much current (though, configured as input, I would hope not). Should I have a current-limiting resistor in line on the GPIOs? Would there be any harm in putting a 1k? (i.e., preventing the input from seeing "low")

Additionally, I'd like to drive an LED from one of these lines. I'd just planned to connect the base of a PNP in addition to the connection to the module (the other MCU) -- do I need to do anything special here, beyond the normal base resistor? Specifically, I would branch the GPIO to drive the transistor base and also signal the other MCU.

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

You can and probably want to put these 1k resistors in series with your GPIO lines. Remember that if you need blazing speeds series resistors can be a problem because it creates a low pass filter together with the input capacitance of the pins.

About your second question, you can't put the base of a PNP in parallel with anything because you need two terminals to speak of parallel. This site and the whole internet is full of examples on how to turn on a led with a transistor so please try to search a bit and ask another question if you have problems. Nothing more than a base resistor should be needed, you will also need a resistor for the LED obviously.

You probably do not need a BJT at all though, and I don't see any additional safety that comes from it.

\$\endgroup\$
2
  • \$\begingroup\$ The BJT is because the pins on the STM32L0 are specified to sink or source 8mA only. The LED alone requires 10mA. By parallel, I mean split the GPIO both to the other MCU and to turn on the LED, from a single GPIO signal. \$\endgroup\$
    – David
    Commented May 2, 2015 at 22:44
  • \$\begingroup\$ that's a huge led you've got. if you need only to signal something you can throttle down the current a lot and still see light. you can do so to save power (and components) \$\endgroup\$ Commented May 3, 2015 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.