Controlling GPIO output volt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Controlling GPIO output volt

1,651 Views
SyaZ
Contributor I

Greetings.

 

When I set a GPIO to output and set it to high, it appears to output the same voltage as it receive from input, which is an overkill for what I need.

 

Is there any way to control this? Is this related with Slew Rate control?

 

Thanks in advance.

Labels (1)
0 Kudos
4 Replies

475 Views
peg
Senior Contributor IV

Hi SyaZ,

 

Are you saying that you want some other voltage other than something approaching VDD?

If it is then the answer is no.

The voltage on an output pin set to high will be very close to VDD for a light load and will droop down to a slightly lower voltage as it is loaded higher. See specs for full details.

You may be able to use some form of PWM to simulate another voltage depending on the load.

Other than that you will need additional circuitry.

Slew rate control refers to the speed at which the voltage level changes - not its final level.

 

0 Kudos

475 Views
SyaZ
Contributor I
Yes Peg that is what I am saying and thank you for the suggestions.
0 Kudos

475 Views
alexod
Contributor I

If you go with a PWM, depending on your application, you may need extra hardware to change the square wave to something approximating a DC level.

 

I'm not a hardware guy, but the PWM designs I've worked with typically are one of two types, the square wave into a forgiving target component, or a smoothing circuit of a couple of resistors and a coil of some sort.

 

Plenty of reference designs out there.

 

Good luck

0 Kudos

475 Views
bigmac
Specialist III

Hello,

 

It is not clear what you are trying to achieve, and what you perceive to be the problem.

 

You can set the MCU port pin as an output by setting to 1 the corresponding bit within the data direction register (DDR) for the port.  You can then control the output state of the pin by setting or clearing the associated bit in the port register.

 

However, if the MCU pin is driven externally, the DDR setting for the pin must remain as an input to avoid a conflict, and potentially damaging current at the pin (unless there are special circumstances where the external device provides a very weak drive, that may be over-ridden).

 

Regards,

Mac

0 Kudos