5 years, 1 month 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

5 years, 1 month ago.

My web page

https://sites.google.com/site/johnkneenmicrocontrollers/input_output/io_f107#linkconfig_107

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.

JK

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
5 years, 1 month 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

https://developer.mbed.org/handbook/DigitalOut

posted by Erik - 29 May 2015