Hi,
I've been designing microcontroller circuits for several years now and I have a pet peeve: the layout of microcontroller pins. And I'd like to understand if there's a rationale behind it.
For example, I'm currently working with a PIC16F1719 (but this issue applies to every uC I've ever used). Going around the chip, there's one pin for port C, then four pins from port D, 8 pins from port B, one from port E, 5 from port A, 3 from port E, 2 from port A, 4 from port C, four from port D, and 3 from port C.
Why break up the ports like this? Why not have all of port A followed by all of port B, etc.? It would make it easier when using a port as shift register (e.g. when multiplexing LEDs and enabling each of the Common pins in sequence) or when sending a binary number (e.g. an address) out of a port.
As it is, I frequently choose pins based on their physical location, regardless of what port they belong to, to make PCB routing easy, and then I have a layer of code that converts my nice binary numbers into individual bits that I send out whichever pin it needs to go on. Am I the only one who does this, or is it common?
There must be a good reason chips are laid out in this seemingly arbitrary way. Does anyone know what it is?
Thank you,
Bob