keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

tutorial_4b_split_keyboard_with_shift_registers.md 4.9KB

7 jaren geleden
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. keybrd Tutorial 4b - split keyboard with shift registers
  2. ========================================================
  3. When you finish this tutorial you will be able to be able to modify a split keybrd sketch with 10 to 24 keys on the shift registers.
  4. Overview of split keyboard with shift registers
  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 rectangles in the middle are two SN74HC165N shift registers daisy chained together.
  9. The micro controller and shift registers are connected via 5 jumper wires.
  10. Only the right matrix is shown. The left matrix is not needed for this demonstration and was omitted to reduce clutter.
  11. The right-matrix layout has 2 rows and 7 columns.
  12. Electronically, there is only one row of keys.
  13. Diodes are not needed because there is only one row.
  14. ![breadboard keyboard with shift_registers](keybrd_4b_split_keyboard_with_shift_registers/front.JPG "breadboard keyboard with shift_registers")
  15. Building a split breadboard keyboard with shift registers
  16. ---------------------------------------------------------
  17. Add components to the breadboard as shown in the picture.
  18. Refer to the SN74HC165N datasheet to locate its pins.
  19. In the picture, SN74HC165N pin 1s are on the left end, towards the controller.
  20. Shift registers are chained together by colored wires that lay flat on the breadboard.
  21. Each shift register has 8 parallel input pins, 4 on each side.
  22. 14 input pins and their keys are connected to 10k pull-down resistor which are grounded (blue bus).
  23. 2 input pins are not used, they are grounded (blue bus).
  24. Switches are connected to power (red bus) and shift register input pins (jumpers).
  25. This table lists what gets connected to the 74HC165 pins:
  26. **74HC165 left (lower half of breadboard)**
  27. |NAME |PIN#|DESCRIPTION |TO TEENSY LC PIN#|CHAIN |
  28. |:-------|:--:|:-------------------|:----------------|:----------|
  29. |SH/LD |1 |shift or load input |CS0 10 |green wire |
  30. |CLK |2 |clock input |SCK0 13 |yellow wire|
  31. | D4 |3 |parallel input | | |
  32. | D5 |4 |parallel input | | |
  33. | D6 |5 |parallel input | | |
  34. | D7 |6 |parallel input | | |
  35. |/QH |7 |~serial output | | |
  36. |GND |8 |ground |gnd |blue bus |
  37. **74HC165 right (upper half of breadboard)**
  38. |NAME |PIN#|DESCRIPTION |TO TEENSY LC PIN#|CHAIN |
  39. |:-------|:--:|:-------------------|:----------------|:------------------------|
  40. |VCC |16 |power pin |3.3V |red wire |
  41. |CLK INH |15 |clock inhibit | |blue bus |
  42. | D3 |14 |parallel input | | |
  43. | D2 |13 |parallel input | | |
  44. | D1 |12 |parallel input | | |
  45. | D0 |11 |parallel input | | |
  46. |SER |10 |serial input | |blue wire to next QH |
  47. | QH | 9 |serial output |MISO0 12 |blue wire to previous SER|
  48. ![breadboard keyboard with shift_registers](keybrd_4b_split_keyboard_with_shift_registers/overhead.JPG )
  49. ![breadboard keyboard with shift_registers](keybrd_4b_split_keyboard_with_shift_registers/back.JPG )
  50. A decoupling capacitor between the power and ground wires suppresses noise.
  51. I apologize for not providing a schematic.
  52. Sketch for split keyboard with shift registers
  53. ----------------------------------------------
  54. [keybrd_4b_split_keyboard_with_shift_registers.ino](keybrd_4b_split_keyboard_with_shift_registers/keybrd_4b_split_keyboard_with_shift_registers.ino) is a simple sketch with two shift registers.
  55. It will run on the above breadboard keyboard.
  56. Exercises
  57. ---------
  58. 1. Guess what happens if an unused input pin is not grounded? Try it.
  59. <br>
  60. <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>.