0
\$\begingroup\$

I have used 8 bit microcontrollers and each of their ports has 8 pins. So, I thought a 32 bit microcontroller will have 32 pins in each port (i.e. 32 bit data bus). But today i saw STM32F070RB pin configuration and noticed that each of its port has only 16 pins (instead of 32). Why is that so? Am i missing something here or each port can have any number of pins (irrespective of microcontroller)?enter image description here

\$\endgroup\$
  • \$\begingroup\$ The processing architecture has nothing to do with how many I/O pins it has. Take a look at the ATtiny10 (microchip.com/wwwproducts/en/ATtiny10). 8-bit AVR microcontroller in a 6-pin SOT package, and two of those pins are used for power and ground. \$\endgroup\$ – Blair Fonville May 5 '18 at 17:22
  • 1
    \$\begingroup\$ Open up the datasheet and look at the block diagram of the internal architecture. \$\endgroup\$ – Voltage Spike May 5 '18 at 20:19
  • \$\begingroup\$ @BlairFonville No, I was responding to SHUBHAM \$\endgroup\$ – Voltage Spike May 8 '18 at 2:10
3
\$\begingroup\$

The simplest answer is: cost. More pins mean a larger, more expensive package. Since the number of applications which actually require a 32-bit port are vanishingly small, especially compared to the number of applications which might require 2, 16-bit ports or 4, 8-bit ports, no sane manufacturer is going to go that route.

Since the tiny minority can be addressed (usually) by driving multiple smaller ports, partitioning I/O pins into smaller ports makes excellent sense. Additionally, a processor with 32 I/O pins configured as a single port would be far less useful to most users than one with more, smaller ports. Such a device (a single 32-bit port) would occupy, and dominate, a fabulously small niche, and the manufacturer would lose money.

TL;DR - There just aren't enough people who want such a device to make it worth anybody's while to make them.

\$\endgroup\$
  • \$\begingroup\$ NordicSemi makes NRF5x with a single 32 pin GPIO port, and NXP LPC17XX has up to 32 pins/port, too. And those are only the two examples on top of my head. \$\endgroup\$ – Turbo J May 6 '18 at 17:50
5
\$\begingroup\$

STM32's port definition allow only 16 pins/port, because they re-use the upper 16 bits.

Look at how the BRR and BSRR registers work - the upper 16 bits have a complemantary function.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.