keybrd library is an open source library for creating custom-keyboard firmware.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

tutorial_4c_split_keyboard_with_IOE.md 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. keybrd Tutorial 4c - split keyboard with I/O Expander
  2. ====================================================
  3. 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.
  4. Overview of split keyboard with I/O Expander
  5. --------------------------------------------
  6. The breadboard in the following picture models a split keyboard.
  7. The green rectangle on the left is a Teensy LC micro controller.
  8. The black rectangle on the right is a MCP23S17 I/O expander.
  9. The two ICs communicates via SPI protocol, where Teensy LC is the master and MCP23S17 is slave.
  10. The two ICs are connected via six jumper wires.
  11. The breadboard's four bus strips are used as matrix rows.
  12. Two rows (blue buses) are connected to the microcontroller.
  13. Two rows (red buses) are connected to the I/O expander.
  14. ![breadboard keyboard with IOE](keybrd_4c_split_keyboard_with_IOE/front.JPG "breadboard keyboard with IOE")
  15. I/O expanders
  16. -------------
  17. The MCP23S17 I/O expander has two ports with 8 I/O pins each.
  18. I/O expander input/output pins are connected to a switch matrix.
  19. Port B strobes one row at a time.
  20. Port A reads the columns.
  21. SPI and I2C communication protocols
  22. -----------------------------------
  23. SPI and I2C are popular communication protocols.
  24. Either one can be used to connect split keyboards.
  25. I2C is fast enough for scanning up to 5 rows.
  26. The keybrd_DH (DodoHand) sketch polls 5 rows over I2C at 7.5ms per keyboard scan.
  27. SPI is much faster, but requires 2 additional wires.
  28. Use SPI if your key matrix has more then 5 rows.
  29. | connection type | controller pins | wire count |
  30. |------------------------|:---------------:|:----------:|
  31. | I/O expander SPI | 4 | 6 |
  32. | I/O expander I2C | 2 | 4 |
  33. The example in this tutorial uses the SPI protocol.
  34. Building a split keyboard with I/O Expander
  35. -------------------------------------------
  36. Starting with the basic breadboard keyboard described in [tutorial_1_breadboard_keyboard.md](tutorial_1_breadboard_keyboard.md), add parts as described above.
  37. Refer to the MCP23S17 datasheet to locate its pins.
  38. In the picture, MCP23S17 pin 1 is on the left end, towards the controller.
  39. The MCP23S17 I/O expander has two ports. Each port has eight pins.
  40. Port B is connected to the matrix's rows (red bus).
  41. Port A is connected to the matrix's columns (jumpers).
  42. MCP23S17's device address is configured by hardware pins.
  43. All three address pins are grounded.
  44. The MCP23S17's /RESET pin is connected to VDD.
  45. This table lists the six wires connecting Teensy LC to MCP23S17:
  46. |CONNECTION |Teensy LC|MCP23S17|
  47. |:------------------:|---------|--------|
  48. |ground | GND | VSS |
  49. |power | 3.3v | VDD |
  50. |Serial Clock | SCK0 | SCK |
  51. |Master Out, Slave In| MOSI0 | SI |
  52. |Master In, Slave Out| MISO0 | SO |
  53. |Chip Select | CS0 | /CS |
  54. A decoupling capacitor between the power and ground wires suppresses noise.
  55. <!-- todo schematic with IOE power decoupling capacitor
  56. This schematic was written by consulting the I/O expander's datasheet and using the ?? tool. -->
  57. Sketch for split keyboard with I/O Expander
  58. -------------------------------------------
  59. The [keybrd_4c_split_with_IOE.ino](keybrd_4c_split_with_IOE/keybrd_4c_split_with_IOE.ino)
  60. sketch explains how the I/O Expander works on a keyboard.
  61. <a rel="license" href="https://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/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="https://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="https://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="https://creativecommons.org/ns" href="https://github.com/wolfv6/keybrd/issues/new" rel="cc:morePermissions">https://github.com/wolfv6/keybrd/issues/new</a>.