How to configure portE of LPC43xx for i/p or o/p for GPIO

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

How to configure portE of LPC43xx for i/p or o/p for GPIO

651件の閲覧回数
sauravsinha
Contributor I

Hi, 

I am using LPC4367JBD208 controller for my application. For one of my requirement i have interfaced portE to one of my peripheral (3x8 Keypad). So for this i need to configure few portpins as input and few as output. I know through DIR register we can configure portpins as input or output BUT it can configure only upto port8. What about PORTA to PORTF. 

Kindly guide me with this how to achieve this.

0 件の賞賛
1 返信

488件の閲覧回数
soledad
NXP Employee
NXP Employee

Hi,

1.- Please check carefully the pin descriptions

P0_0 corresponds to GPIO0[0]

P0_1 -> GPIO0[1]

PA_1 -> GPIO4[8]

PA_2 -> GPIO4[9]

PB_6 -> GPIO5[26]

PF_2 -> GPIO7[17]

PF_11 -> GPIO7[25]

 pastedImage_1.png

pastedImage_2.png

According with the user manual page 471,  “Each GPIO port n (n = 0 to 7) has one direction register for configuring the port pins as inputs or outputs.”

 

 pastedImage_3.png

 

2.- Please check the user manual pages 425-429, you will find information about how to select analog/digital functions.

pastedImage_4.png

In the following codes, it illustrate how to toggle the P2_10.

    Chip_SCU_PinMuxSet(0x2, 10, (SCU_MODE_FUNC5)) // P2.10: GPIO0[14]
    Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT,0, 14); //Set pin direction
    Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, 14, false); // Output low
    Chip_GPIO_SetPinState(LPC_GPIO_PORT, 0, 14, true); // Output high


Have a great day,
Sol

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

0 件の賞賛