GPIO read pin issue

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

GPIO read pin issue

897 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
3 Replies

851 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

843 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

822 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

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

0 Kudos