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
Solved! Go to Solution.
Hi,
Make sure Input buffer enable[bit 6]. The input buffer is disabled by default at reset and must be enabled for receiving.
Thanks,
Kushal
Hi,
Make sure Input buffer enable[bit 6]. The input buffer is disabled by default at reset and must be enabled for receiving.
Thanks,
Kushal
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.
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
Can you please measure PB_0 with multimeter, what's the voltage ?