Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/tutorials/tutorial_4_split_keyboard_with_IOE.md

69 lines
3.3 KiB
Markdown
Raw Normal View History

2016-05-09 14:05:08 +00:00
keybrd Tutorial 4 - split keyboard with I/O Expander
====================================================
2016-05-10 15:05:25 +00:00
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.
2016-05-09 14:05:08 +00:00
## Overview of split keyboard with I/O Expander
The breadboard in this picture models a split keyboard.
2016-05-10 15:05:25 +00:00
![breadboard keyboard with 2 rows and 4 columns of keys](images/breadboard_keyboard_2x5_labeled.jpg "2x5 breadboard keyboard")
2016-05-09 14:05:08 +00:00
2016-05-11 15:25:48 +00:00
There is a total of 4 matrix rows, each on a breadboard power rail.
2016-05-09 14:05:08 +00:00
The right matrix is connected to a microcontroller.
The left matrix is connected to a I/O expander.
2016-05-11 15:25:48 +00:00
The I/O expander has a small notch on one end, which identifies the end with pin 1.
In the picture, pin 1 is on the right end.
2016-05-09 14:05:08 +00:00
2016-05-11 15:25:48 +00:00
The microcontroller and I/O expander are connected by 4 jumper wires:
2016-05-09 14:05:08 +00:00
* ground
* power
2016-05-11 15:25:48 +00:00
* Serial CLock signal (SCL)
* Serial DAta signal (SDA)
2016-05-09 14:05:08 +00:00
2016-05-11 18:46:53 +00:00
A decoupling capacitor on the power pin dampens noise coming in through the power wire.
2016-05-09 14:05:08 +00:00
2016-05-11 15:25:48 +00:00
The microcontroller and I/O expander communicate via [I2C](http://en.wikipedia.org/wiki/I%C2%B2C) bus, which consists of two signals: SCL and SDA.
Two resistors pull-up voltage on the SCL and SDA.
2016-05-11 18:46:53 +00:00
I/O expander I2C address is configured by hardware pins.
The MCP23018 with all address pins grounded has an I2C address of ?? todo.
2016-05-11 15:25:48 +00:00
The I/O expander has two ports. Each port has eight pins.
One port is connected to the matrix's rows. The other port is connected to the matrix's columns.
2016-05-09 14:05:08 +00:00
## Building a split keyboard with I/O Expander
2016-05-11 18:46:53 +00:00
We will build a split keyboard adding parts to the basic breadboard keyboard described in [tutorial_1_breadboard_keyboard.md](tutorial_1_breadboard_keyboard.md)
2016-05-11 15:25:48 +00:00
2016-05-11 18:46:53 +00:00
todo add schematic
<!-- schematic with IOE power decoupling capacitor
2016-05-11 15:25:48 +00:00
This schematic was written by consulting the I/O expander's datasheet and using the ?? tool. -->
Continuing from the basic breadboard keyboard instructions:
2016-05-11 18:46:53 +00:00
<!-- At some point in the future, Markdown may support starting ordered lists at an arbitrary number. -->
2016-05-11 15:25:48 +00:00
4. Insert the I/O expander
5. Install I/O expander power
2016-05-11 18:46:53 +00:00
* ground
* power
* capacitor
2016-05-11 15:25:48 +00:00
6. Install I2C bus
2016-05-11 18:46:53 +00:00
* SCL
* SDA
* pull-up resistors on SCL and SDA
2016-05-11 15:25:48 +00:00
7. configure I2C address
8. Assemble key matrix as shown in the picture.
9. Connect I/O expander ports to matrix rows and columns
2016-05-09 14:05:08 +00:00
## Sketch for split keyboard with I/O Expander
2016-05-10 15:05:25 +00:00
The [keybrd_4_split_with_IOE_annotated.ino](keybrd_4_split_with_IOE_annotated/keybrd_4_split_with_IOE_annotated.ino)
sketch explains how the I/O Expander works on a keyboard.
2016-05-11 15:25:48 +00:00
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" /></a><br /><span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">keybrd tutorial</span> by <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/wolfv6/keybrd" property="cc:attributionName" rel="cc:attributionURL">Wolfram Volpi</a> is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.<br />Permissions beyond the scope of this license may be available at <a xmlns:cc="http://creativecommons.org/ns#" href="https://github.com/wolfv6/keybrd/issues/new" rel="cc:morePermissions">https://github.com/wolfv6/keybrd/issues/new</a>.