8 years, 2 months ago.

What is a port?

I vaguely recall something about ports from PICs, but what are ports and how are they organised on the LPC1768?

This is what is said about PortInOut: "The PortInOut Interface can use any pins with a blue label, as long as they are in the same port.".

Question relating to:

1 Answer

8 years, 2 months ago.

A port is a group of pins that can be set or read in a single operation. On NXP they are typically called Port0, Port1, Port2, etc... on ST and other ARM Cortex they are called Port A, B, C,D, ... Ports are 32 bits wide in Cortex ARM

Pins in different ports must be accessed in subsequent operations.

Typically ports are only accessed as a group if they are GPIO pins. Pins that are operated in their alternate function (example: I2C, SPI, Ethernet, CAN) are excluded from the port operation and can be ignored during the GPIO access.

Does that help?

Do you happen to have a mapping of ports on the LPC1768 board (so not just the chip itself)? I'd actually need to know what pins belong to a certain port.

posted by George DeB 01 Feb 2016

The schematic for the board is here. The main CPU is on page 3.

To save you looking: Pins 19 & 20 are port 1, Pins p21 to p26 are on port2. All other GPIO pins are port0.

Also port1 can't be used as an interrupt source which means p19 & p20 can't be used as an InterruptIn, that's caught me out in the past.

posted by Andy A 01 Feb 2016