GPIO read pin issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,983件の閲覧回数
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 件の賞賛
返信
1 解決策
886件の閲覧回数
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

元の投稿で解決策を見る

4 返答(返信)
887件の閲覧回数
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,937件の閲覧回数
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 件の賞賛
返信
1,929件の閲覧回数
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 件の賞賛
返信
1,908件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

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

0 件の賞賛
返信