PIN is the chip external pin Ah, a chip at least VCC,GND pin, like 51 single-chip computer and IO PIN, serial pin, etc., PIN is a physical external pipe leg AH.
The port is the MCU internal (CPU unit) and external IO interface group, such as PA port, there are 8 pins, pa0~pa7. The port in the IO space map has a register, this register reflects the status of the current port, such as the input voltage on the PA0 port is a 0~5v signal, the microcontroller will be mapped into the register when the threshold (such as 1.8V), the corresponding bit below this threshold register is 0, above the threshold corresponding bit is 1. General ports also have other control registers, such as control port pin input and output registers, such as control port pin multiplexing registers and so on. When the port pin is set to output, write 1 to the corresponding output register, the corresponding IO pin of the port will output an approximate VCC level, when the corresponding bit write 0 o'clock, the corresponding IO pin of the port will output an approximate 0V level.
The difference between a port and a pin