user15180: I am seeking HW.
I would like to make keyboard with enhanced functions (RGB backlite, macros, programmed profiles etc) driven by some small MCU (Arduino Micro Pro or something similar).
To support communication, it needs to use I2C and SPI(for display and other devices), use USB (to communicate with PC) and use Serial to communicate with other Arduinos/MCUs.
The main function would be scanning keyboard matrix (like from 8x8 to 16x8 in maximal variant). The matrix would use diodes for NKRO (not ghosting, any key combination possible).
It would be really nice to have HW, where I could use 3 full ports as input (or as output) with benefit of reading/writing them with only one assembly instruction for 8bit manipulation, not to cycle over array of pins and manipulate each one independently (digitalRead/digitalWrite, which use tons of instructions to determine ports and pin and then combine them together to obtain one 8bit variable). Something like:
byte dataout,datain1,datain2;
PORT_A=dataout;
datain1=PORT_B;
datain2=PORT_C;

Does anyone know, if there is such nonexpensive MCU and which type it is?
On typical Arduino each port is "poluted" by some importaint communications pins, so none of them can be used as full 8bit I/O.
Second question: Is there a reason, why are the most used communication pins spread over range of different ports and not collected on one port, while leaving other ports as full 8bit GPIO useable?
Thank for all answers.

user60518: The expander MCP23S17 (spi), with a CS, is a good extention (16 I/O configurable)
That should do it ! 

15180: <p><strong>I am seeking HW.</strong></p>

<p>I would like to make keyboard with enhanced functions (RGB backlite, macros, programmed profiles etc) driven by some small MCU (Arduino Micro Pro or something similar).</p>

<p>To support communication, it needs to use <strong>I2C</strong> and <strong>SPI</strong>(for display and other devices), use <strong>USB</strong> (to communicate with PC) and use <strong>Serial</strong> to communicate with other Arduinos/MCUs.</p>

<p>The main function would be scanning keyboard matrix (like from 8x8 to 16x8 in maximal variant). The matrix would use diodes for NKRO (not ghosting, any key combination possible).</p>

<p>It would be really nice to have HW, where I could use 3 full ports as input (or as output) with benefit of reading/writing them with only one assembly instruction for 8bit manipulation, not to cycle over array of pins and manipulate each one independently (digitalRead/digitalWrite, which use tons of instructions to determine ports and pin and then combine them together to obtain one 8bit variable). Something like:</p>

<pre><code>byte dataout,datain1,datain2;
PORT_A=dataout;
datain1=PORT_B;
datain2=PORT_C;
</code></pre>

<p><strong>Does anyone know, if there is such nonexpensive MCU and which type it is?</strong></p>

<p>On typical Arduino each port is "poluted" by some importaint communications pins, so none of them can be used as full 8bit I/O.</p>

<p><strong>Second question: Is there a reason, why are the most used communication pins spread over range of different ports and not collected on one port, while leaving other ports as full 8bit GPIO useable?</strong></p>

<p>Thank for all answers.</p>
 60518: <p>The expander MCP23S17 (spi), with a CS, is a good extention (16 I/O configurable)
That should do it ! </p>
