Can you use all pins as a general purpose port?

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

Can you use all pins as a general purpose port?

335 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by GMO on Tue Aug 25 06:42:38 MST 2015
This is probably very easy to do but I am very new to coding and would like some help. I am using an 812 board. I want to create a simple demonstration where switches can turn LEDs on and off using an ‘if else’ command. I have written the code for the lights and the switches and it works fine for most pins.

However some pins have another function and I am having difficulty using them as a general purpose pin (and turn them high or low). The pins I am having difficulty with are:

PIO0_5: RESET function (pin is always HIGH)
PIO_2: SWDIO and TMS (pin always high)
PIO0_10 and PIO0_11: SDA and SCL (pins always low)

I want to know where the code is that controls these pins (which header file etc.) and how I should change it so that they are general ports.

Any help would be appreciated or a link to another thread on this topic 
Labels (1)
0 Kudos
2 Replies

324 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wojtkingson on Thu Aug 27 01:55:29 MST 2015
I think, that you have to disable fixed functions, but be aware before you disable SWD and SWCLK :D
0 Kudos

324 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Tue Aug 25 08:59:57 MST 2015
You can switch them to GPIO by using the switch matrix (see the chapter in the user manual). You may also need to change something for I/O configuration (IOCON).

Of course you lose their functionality (reset, debug).

PIO0_10 and PIO0_11 are true open-drain pins, so you will need an external pull-up resistor (see the pin description in the user manual).
0 Kudos