8 years, 12 months ago.

How to drive an output pin voltage?

Hi everyone, I wish to drive a voltage signal to an output pin of my STM32L053 Nucleo board. The intention is to keep such a pin tension high or low for a random time length, its duration no shorter than a minimum time, no longer than a maximum one. Before I get back browsing through hundreds pages of digital manuals, do you have a suggestion what to search for, what to focus on, what to code precisely? Thanks in advance for any hint and suggestion. Regards, ANdrea

Question relating to:

2 Answers

8 years, 12 months ago.

My web page


may give some ideas. The link is for a different STM device but may give you some ideas.

1. You need to enable the clock to the peripheral of interest 2. You need to configure the pin as an output. 3. You need to set/clear pin to required state.


Accepted Answer

Hallo John, and thanks for your answer. Your web page seems to be very exhaustive. I'll certainly find much usefull info while reading it. Best regards.

posted by Andrea NOTARI 29 May 2015
8 years, 12 months ago.

I would start with looking through the handbook pages, since just DigitalOut allows you to set a pin high or low.

Part 2 is creating a random number, and when you got that, map that to your minimum/maximum time.

Hallo Erik. First, thanks for your answer. Second: do you have any specific handbook in mind, you suggest to dive into?

posted by Andrea NOTARI 29 May 2015

The mbed handbook pages were the ones I meant: https://developer.mbed.org/handbook/Homepage


posted by Erik - 29 May 2015