Read value from GPIO input

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

Read value from GPIO input

3,400 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sgtengxiao on Tue Oct 16 02:39:06 MST 2012
Hi guys,

I set a gpio as input, and i connect a variable voltage (0.5V ~ 3.3V) to the gpio. How can I read it? I use GPIO_ReadValue function but can only get two different values.
0 Kudos
Reply
9 Replies

3,106 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Wed Oct 17 01:17:52 MST 2012
Your first post said


Quote:
i connect a variable voltage (0.5V ~ 3.3V) to the gpio. How can I read  it? I use GPIO_ReadValue function but can only get two different values.



Now I think 0.5V ~ 3.3V to most people represents a voltage that varies between 0.5 and 3.3v, then you said


Quote:
but can only get two different values.


Well a digital input can only provide two different values by definition, so we assumed you were needing an analogue input, hence the talk about ADCs.
0 Kudos
Reply

3,106 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ju2low on Wed Oct 17 00:40:41 MST 2012
OK ! Thks
0 Kudos
Reply

3,106 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Oct 17 00:38:17 MST 2012

Quote:

Why ADC ? I don't understand....

Because this is an GPIO/ADC thread and you are asking something different (?) without starting a new thread :p


Quote:

Maybe my question was not clear sorry...

It's still not clear...


Quote:

But my problem is: I don't succeed to configure of GPIO inputs.

:confused:

Reading a simple GPIO is described several times here, last time 4 days ago ;)

See #4 of http://knowledgebase.nxp.com/showthread.php?p=19385#post19385
0 Kudos
Reply

3,105 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ju2low on Wed Oct 17 00:02:37 MST 2012

Quote: Zero
Come on, is that so difficult :confused:

Use Search function and search for "ADC AND LPC1769"

and Voilà ;)

a nice sample at #5 of http://knowledgebase.nxp.com/showthread.php?t=2858



Why ADC ? I don't understand....

Maybe my question was not clear sorry...

I want to control a lighting system by pwm; at the end of my timer MR0, i read on gpio input and the "word" permit to modulate my pwm... But my problem is: I don't succeed to configure of GPIO inputs.

That's why I ask help.... not hoax ...


I configure in my main GPIO and I try to read input on IRQ in timer
0 Kudos
Reply

3,105 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Tue Oct 16 23:11:01 MST 2012
I think this thread must be a joke or otherwise a hoax... :(
0 Kudos
Reply

3,105 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Oct 16 07:57:02 MST 2012
Come on, is that so difficult :confused:

Use Search function and search for "ADC AND LPC1769"

and Voilà ;)

a nice sample at #5 of http://knowledgebase.nxp.com/showthread.php?t=2858
0 Kudos
Reply

3,105 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ju2low on Tue Oct 16 07:24:59 MST 2012
Hello everyone,

I know there is a lot of posts about this subject but I'm really lost...:confused:

What do I need to read the voltage ( 0 or 3V3 ) applied in input on lpc1769 board, port1 for example?

I accept links, code, topics....
0 Kudos
Reply

3,105 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Tue Oct 16 05:16:36 MST 2012
It's a DIGITAL input, how do you expect to read analogue values from it?

I think you should do at least a little research.
0 Kudos
Reply

3,105 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Tue Oct 16 04:07:44 MST 2012
A) which controller are we speaking of?
B) ever heard of ADC?
C) a normal GPIO pin has only two states: on (3.3V) and off (0V) so it is perfectly normal that you only get two different values.
D) have you read the user manual?
0 Kudos
Reply