Editing
I²C
From Deskthority Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
'''I²C''' is a serial interface for communication between electronic components. An I²C bus has a [[keyboard controller|microcontroller]] as master and one or more slaves components, of which there are many types. I²C is often used for connecting left and right sides of a split [[ergonomic keyboard]]. It requires two data lines (SDA = serial data, and SCLK = serial clock), plus DC power. A keyboard interconnect with I²C therefore needs four wires. Different devices support 3.3V or 5V operation, and many work with both. ==Signalling== The protocol is controlled by the master microcontroller. The master is clocking the bus on the SCLK line, and either device is sending a bit on the SDA line on each clock depending on that particular slave device's protocol. Each transaction begins with the master sending a START bit, followed by an ''address byte'' with the address to the slave device to receive the transaction. If the higher bits of the first byte is 1-1-1-1, the address is instead in encoded in two bytes. Only the slave with the matching address should act on a transaction. Multiple more bytes can then follow, followed by a STOP bit. Values are sent most-significant-bit first (multi-byte values are thus sent in big-endian byte order). ==Slave devices== Many chips supporting I²C have higher bits of the address fixed, and lower bits configurable through one or more pins. {|class="wikitable" |- ! Class !! Device !! Address byte !! Notes |- | Trackball || PIM447 || 0 0 0 0 1 0 1 A || Could be added to mini keyboards |- | Other hand || [[Pro Micro]] || 0 0 1 1 0 0 1 R/{{overline|W}} || Slave hand (left or right) on many split kit keyboards using [[QMK]] firmware. Unless overridden, the MCU makes itself slave if it does not detect VBUS. |- | I/O Expander || MCP23018 || 0 1 0 0 A2 A1 A0 R/{{overline|W}} || [[ErgoDox]] |- | I/O Expander || MCP23017 || 0 1 0 0 A2 A1 A0 R/{{overline|W}} || Functionally equivalent to MCP23018 but electrically less robust |- | OLED display || SSD1306 || 0 1 1 1 1 0 A0 R/{{overline|W}} || [[Lily58]] and others |- | EEPROM || Atmel AT24C16C || 1 0 1 0 B2 B1 B0 R/{{overline|W}} || Modified [[ErgoDox]]en and [[Kinesis Advantage]]. Not recommended for new devices. |- | EEPROM || Atmel AT24C164 || 1 A2 A1 A0 B2 B1 B0 R/{{overline|W}} || A1 is inverted so that A2-A1-A0 is 0-1-0 if all three address pins are connected to GND. B2-B2-B1 selects 256-byte block. |- | EEPROM || Microchip 24LC64 || 1 0 1 0 A2 A1 A0 R/{{overline|W}} || Not compatible with Atmel AT24C16x above |- | LED matrix || ISSI IS31FL3733 || 1 0 1 A3 A2 A1 A0 R/{{overline|W}} || [[Input Club K-Type]] (RGB) and others. 192 LEDs (64 RGB) |- | LED matrix || ISSI IS31FL3731 || 1 1 1 0 1 A1 A0 R/{{overline|W}} || [[Input Club]] Infinity60 and others. 144 charlieplexed LEDs. |- |} ==Connectors== ===TRRS=== A '''TRRS''' plug is a type of 3.5 mm phone connector used by many split ergonomic keyboards as interconnect. It is not considered very reliable for digital signals, but is inexpensive, common and relatively small. "TRRS" stands for "Tip-Ring-Ring-Sleeve", indicating that is has four contacts. It was defined in the Japanese standard JEITA/EIAJ RC-5325A, "4-Pole miniature concentric plugs and jacks", originally published in 1993. {|class="wikitable" |- ! Keyboard !! Tip !! Ring !! Ring !! Sleeve |- | [[ErgoDox]] || SDA || SCLK || Vcc || GND |- | [[Lily58]] || Vcc || GND || SDA || SCLK |- |} ===JST SH, JST PH and Grove=== Several vendors of microcontroller and sensor boards have made mostly-compatible cabling systems for connecting them with I²C and power without requiring soldering. A number of cables and adaptor cables are available with different connectors. Sparkfun's '''Qwiic''' uses compact four-pin JST SH connectors, always for I²C. Voltage is 3.3V. Seeed Studio's '''Grove''' uses four-pin JST PH-''like'' connectors for various purposes, of which some boards use them for I²C. The first two pins are always for power (3.3V '''or''' 5V) with the other two for signals. Adafruit's '''STEMMA''' system uses four-pin JST PH connectors, always for I²C, and the connectors are similar enough so at to fit those used by Grove in either direction.<br /> '''STEMMA QT''' uses the compact four-pin JST SH-connectors, in compatible pinout with Qwiic. However, STEMMA and STEMMA QT allow voltages between 3 and 5V, like Grove. The system also contains three-pin JST PH connectors for other purposes. Note that Sparkfun Qwiic is always 3.3V, but the others use either 3.3V or 5V. STEMMA boards from Adafruit are supposed to work with the full range of 3-5V. Cables are coloured: {|class="wikitable" |- ! Pin !! Qwiic/STEMMA QT !! STEMMA !! Grove !! Use |- | 1 || Black || Black || Black || GND |- | 2 || Red || Red || Red || VCC |- | 3 || Blue || White || White || SDA |- | 4 || Yellow || Green || Yellow || SCL |} ==External links== * [https://en.wikipedia.org/wiki/I%C2%B2C I²C on Wikipedia] * SparkFun Electronics—[https://www.sparkfun.com/qwiic qwiic] * Adafruit—[https://learn.adafruit.com/introducing-adafruit-stemma-qt What is STEMMA?] * Adafruit—[https://learn.adafruit.com/introducing-adafruit-stemma-qt/seeed-studio-grove Seed Studio Grove|STEMMA / Grove comparison] * Electric Imp—[https://developer.electricimp.com/resources/grovesystem Using The Grove Connector System] [[Category:Protocols and interfaces]]
Summary:
Please note that all contributions to Deskthority Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:Overline
(
edit
)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Deskthority forum
Support Deskthority
Search
Main categories
Guides
Keyboards
Keyboard switches
Keycaps
Keyboard modding
Pointing devices
Brands & companies
Group buys
Other topics
Wiki info & links
Recent changes
Random page
All pages
Deskthority wiki help
MediaWiki help
Tools
What links here
Related changes
Special pages
Page information