Default (initial) output value on GPIO2

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

Default (initial) output value on GPIO2

847 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by satyendra_sss on Thu Mar 03 00:28:58 MST 2016
Hi,
I was wondering if there is a way to set the initial value of a GPIO pin to be configured as output pin to high(or low).
I am using GPIO2.0 of lpc1769 for switching a relay using a PNP switch.
Whenever I configure the pin as output, the switch gets turned on immediately. I am assuming this happens since the GPIO pin goes low the moment I configure it as an output pin.


Thanks and Regards,
SSS
Labels (1)
0 Kudos
Reply
3 Replies

815 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos
Reply

815 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Thu Mar 03 01:59:59 MST 2016
You are allowed to set the value of a GPIO _before_ you switch the direction to Output.
0 Kudos
Reply

815 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Mar 03 01:07:15 MST 2016

Quote: satyendra_sss
I am assuming this happens since the GPIO pin goes low the moment I configure it as an output pin.



:quest:

Then debug your code to see which value this pin has before you change it to output...

Default is HIGH  :O
0 Kudos
Reply