keybrd Tutorial 4 - split keyboard with I/O Expander
====================================================
When you finish this tutorial you will be able to be able to modify a 2-matrix keybrd sketch to suite your own split keyboard design.
Overview of split keyboard with I/O Expander
--------------------------------------------
The breadboard in this picture models a split keyboard.
![breadboard keyboard with 2 rows and 4 columns of keys](images/breadboard_keyboard_2x5_labeled.jpg "2x5 breadboard keyboard")
The breadboard's four bus strips are used as rows.
Two rows (blue buses) are connected to the microcontroller.
Two rows (red buses) are connected to the I/O expander.
The I/O expander is a MCP23S17.
It has a small notch on one end, which identifies pin 1.
In the picture, pin 1 is on the left end.
The MCP23S17 communicates via SPI protocol, where Teensy LC is the master, and MCP23S17 is slave.
The Teensy LC and MCP23S17 are connected via 6 jumper wires:
|CONNECTION |Teensy LC|MCP23S17|
|:------------------:|---------|--------|
|ground | GND | VSS |
|power | 3.3v | VDD |
|Serial Clock | SCK0 | SCK |
|Master Out, Slave In| MOSI0 | SI |
|Master In, Slave Out| MISO0 | SO |
|Chip Select | CS0 | /CS |
A decoupling capacitor suppresses high-frequency noise from the power supply.
MCP23S17's I/O expander address is configured by hardware pins.
The MCP23S17 with all address pins grounded has an device address of 0x20.
The MCP23S17's /RESET pin is connected to VDD.
The MCP23S17 I/O expander has two ports. Each port has eight pins.
Port B is connected to the matrix's rows.
Port A is connected to the matrix's columns.
Building a split keyboard with I/O Expander
-------------------------------------------
Starting with the basic breadboard keyboard described in [tutorial_1_breadboard_keyboard.md](tutorial_1_breadboard_keyboard.md), add parts as described above.
Refer to the MCP23S17 datasheet to locate its pins.
Sketch for split keyboard with I/O Expander
-------------------------------------------
The [keybrd_4c_split_with_IOE.ino](keybrd_4c_split_with_IOE/keybrd_4c_split_with_IOE.ino)
sketch explains how the I/O Expander works on a keyboard.
keybrd tutorial by Wolfram Volpi is licensed under a Creative Commons Attribution 4.0 International License.
Permissions beyond the scope of this license may be available at https://github.com/wolfv6/keybrd/issues/new.