GPIO read pin issue

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

GPIO read pin issue

Jump to solution
1,295 Views
ketulpatel
Contributor II

Hello,

I'm using LPC1833. And set pin PB_0 ( GPIO5[20] ) as an output pin.
But when I read it using the PIN register, It showing 0 state even I set it to 1.

Thanks,
Ketul

0 Kudos
Reply
1 Solution
198 Views
Kushal_Panchal
Contributor II

Hi,

Kushal_Panchal_0-1731492575085.png

 

Make sure Input buffer enable[bit 6]. The input buffer is disabled by default at reset and must be enabled for receiving.

Thanks,

Kushal

View solution in original post

4 Replies
199 Views
Kushal_Panchal
Contributor II

Hi,

Kushal_Panchal_0-1731492575085.png

 

Make sure Input buffer enable[bit 6]. The input buffer is disabled by default at reset and must be enabled for receiving.

Thanks,

Kushal

1,249 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

You set the GPIO as output but you want to read it. Why do you operate IO in this way?

If you need to read pin state, please switch the IO setting as input then read it.

0 Kudos
Reply
1,241 Views
ketulpatel
Contributor II

Hello @ZhangJennie, thanks for the response,

Still getting 0 value, following steps are followed:

1. Pin Mux:
         Pin name - PB_0 with GPIO5[20]
         Mode - (0x2 << 3) //Enable Pull-up resistor
2. Set direction (DIR register) = Output
3. Set value (SET register)
4. Set direction (DIR register) = Input
5. Read Pin state (PIN register) = getting 0 value
6. Set direction (DIR register) = Output

Thanks,
Ketul

0 Kudos
Reply
1,220 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Can you please measure PB_0 with multimeter, what's the voltage ?

0 Kudos
Reply