GPIO Direction vs Output_Enable

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GPIO Direction vs Output_Enable

ソリューションへジャンプ
972件の閲覧回数
deniscollis
Contributor V

I just need some clarity here.  I am porting some code to a K8x from an ARM MCU from another manufacturer.  They have a GPIO Data Output Enable Register. There is no concept of 'direction', as the GPIO Data Input Register always reflects the state of the pins, whether output is enabled or not.

Does the Kinetis GPIO Data Direction Register work in the same way?  That is, does the Kinetis GPIO Data Input Register reliably reflect the state of the pin, without regard to the GPIO Data Direction Register setting? 

Background: The pin connects to an open drain bus control rail. Output register is normally high. Reading input register indicates that another device has grabbed the bus.

Thanx,

Denis

タグ(2)
0 件の賞賛
返信
1 解決策
842件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Denis,

The Kinetis GPIO Data Input Register reliably reflect the state of the pin, without regard to the GPIO Data Direction Register setting.

Here you can see the test result of example gpio_led_output:

This example toggle led(GPIOC pin 8 configured as as output), we are able to see the GPIOC_PDIR[8] toggle during debug.

PDIR 0 after PDDR output 0.png

PDIR 1 after PDDR output 1.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
843件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Denis,

The Kinetis GPIO Data Input Register reliably reflect the state of the pin, without regard to the GPIO Data Direction Register setting.

Here you can see the test result of example gpio_led_output:

This example toggle led(GPIOC pin 8 configured as as output), we are able to see the GPIOC_PDIR[8] toggle during debug.

PDIR 0 after PDDR output 0.png

PDIR 1 after PDDR output 1.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信