Difference between revisions of "I2C-RPT"
Jump to navigation
Jump to search
Blwikiadmin (talk | contribs) |
Blwikiadmin (talk | contribs) |
||
(70 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[File:tindie-mediums.png|link=https://www.tindie.com/products/land_boards/4-channel-i2c-multiplexer-i2c-rpt-01/]] | [[File:tindie-mediums.png|link=https://www.tindie.com/products/land_boards/4-channel-i2c-multiplexer-i2c-rpt-01/]] | ||
− | [[File:I2C-RPT- | + | [[File:I2C-RPT-01_P1861_720PX.jpg]] |
+ | |||
+ | <video type="youtube">BzxSMwOYKiE</video> | ||
== Features == | == Features == | ||
− | * I2C Hub / Repeater / Replicator / Multiplexer / De-multiplexer | + | * I2C Hub / Repeater / Replicator / Multiplexer / De-multiplexer / Switch |
− | * Four I2C Ports | + | ** [https://www.ti.com/lit/ds/symlink/pca9544a.pdf PCA9544A Datasheet] IC Multiple vendors |
− | * Host port Controlled via I2C | + | ** Four I2C Ports |
− | * | + | ** 100KHz/400KHz operation |
− | * 3.3V or 5V | + | ** I2C Address fixed at 0x70 |
+ | * Host port | ||
+ | ** Controlled via I2C | ||
+ | ** 3.3V or 5V host operation | ||
+ | ** 3.3V or 5V slave ports operation | ||
+ | ** Can power slave cards if they are at the same voltage | ||
* 3.3V or 5V slave ports operation | * 3.3V or 5V slave ports operation | ||
+ | ** Removable jumper(s) to supply power from slave | ||
* Voltage translation between the ports | * Voltage translation between the ports | ||
− | * Example: A Raspberry PI which runs 3.3V can control an I2C device which runs at 5V | + | ** Example: A Raspberry PI which runs 3.3V can control an I2C device which runs at 5V |
* Interrupt line on each channel and host | * Interrupt line on each channel and host | ||
− | + | * On-board 2.2K termination resistors | |
− | * On-board termination resistors | ||
* 49x49mm form factor | * 49x49mm form factor | ||
* 4 solid 4-40 mounting holes | * 4 solid 4-40 mounting holes | ||
− | * Arduino driver and example code | + | * Drivers/Example Code |
− | * Raspberry Pi example code | + | ** Arduino driver and example code |
+ | ** Raspberry Pi example code | ||
+ | |||
+ | === I2C Termination Resistors === | ||
+ | |||
+ | * Card has 2.2K Termination resistors on SDA/SCL lines | ||
+ | |||
+ | [[file:PCA9544_TERM_LOADS.PNG]] | ||
+ | |||
+ | == Headers == | ||
+ | |||
+ | === H1-H4 - Headers === | ||
+ | |||
+ | * Jumpers | ||
+ | ** H1 = I2C #0 Power | ||
+ | ** H2 = I2C #1 Power | ||
+ | ** H3 = I2C #2 Power | ||
+ | ** H4 = I2C #3 Power | ||
+ | |||
+ | ==== Power Options ==== | ||
+ | |||
+ | * The card has flexible power options to power external I2C interfaces | ||
+ | * Power to the Host Interface comes in J5 Host I2C Interface | ||
+ | ** This power can be used to drive external devices on the 4 I2C slave ports | ||
+ | |||
+ | ===== Simple Method ===== | ||
+ | |||
+ | * The "simplest" option is to provide power to the external I2C from the I2C-RPT-01 card | ||
+ | ** Install jumper to power the particular I2C interface from the I2C-RPT-01 card | ||
+ | |||
+ | ===== External Power ===== | ||
+ | |||
+ | * External interface can also have independent power | ||
+ | ** External interfaces can be at different voltage level from the I2C-RPT-01 card | ||
+ | *** Example #1: Card Host voltage can be 5V (Arduino) and interface to 3.3V I2C interfaces | ||
+ | ** Remove Jumper to power from external interface (3.3V or 5V) | ||
+ | ** In this case, the terminators get pulled up from the external interface | ||
+ | |||
+ | == Connectors == | ||
+ | |||
+ | * 0.1" pitch connections | ||
+ | * [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313.TR2.TRC1.A0.H0.Xdupont+header.TRS0&_nkw=dupont+header&_sacat=0 Search ebay for Dupont headers] | ||
+ | * [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1311.R4.TR4.TRC1.A0.H0.Xdupont+jumper.TRS0&_nkw=dupont+wire+jumper+cable&_sacat=0&LH_TitleDesc=0&_osacat=0&_odkw=arduino+cable Search ebay for Dupontwire jumper cable] | ||
+ | * The slave I2C connectors are (4) 1x5 right angle 0.1" pitch headers | ||
+ | |||
+ | === J1-J4 - I2C Slave ports === | ||
+ | |||
+ | * Ports | ||
+ | ** J1 = I2C Port #0 | ||
+ | ** J2 = I2C Port #1 | ||
+ | ** J3 = I2C Port #2 | ||
+ | ** J4 = I2C Port #3 | ||
+ | * Pinout | ||
+ | # GND | ||
+ | # VCC (If Hx is installed, card powers this pin) | ||
+ | # SDA | ||
+ | # SCL | ||
+ | # INT* | ||
+ | |||
+ | === J5 - I2C to/from Host port === | ||
+ | |||
+ | * Power comes in this connector | ||
+ | ** Voltage matches signal levels | ||
+ | ** 2.2K Ohm terminated | ||
+ | ** I2C address is fixed at 0x70 | ||
+ | # GND (G) | ||
+ | # VCC (V) - Power into the card | ||
+ | # SDA (D) | ||
+ | # SCL (C) | ||
+ | # INT* (I) - Interrupt (active low) | ||
+ | |||
+ | == Schematic == | ||
+ | |||
+ | * [http://land-boards.com/I2C-RPT-01/I2C-RPT-01_RevX3_Schematic.pdf Schematic] | ||
+ | |||
+ | == Testing == | ||
+ | |||
+ | === Test Station Hardware === | ||
+ | |||
+ | [[File:I2C-RPT-01_P1858-720PX.jpg]] | ||
+ | |||
+ | * [[Arduino Based Test Station]] | ||
+ | ** Built in I2C mux on [[BLACK-PILL-HUB]] is set to offset=0x1 so it does not conflict with I2C address of UUT | ||
+ | ** Cabling | ||
+ | *** UUT J5 Host connects to I2C port (J7) on the [[BLACK-PILL-HUB]] | ||
+ | *** UUT J5 Host INT pin connects via jumper cable to PB6-SIG | ||
+ | * Uses 4x of [[I2CIO-8]] cards | ||
+ | ** Cabling 5 wire from [[I2CIO-8]] cards J1 to UUT I2C #0-#3 | ||
+ | ** Address jumpers are all installed for base address of 0x20 | ||
+ | * On Unit Under Test (UUT) | ||
+ | ** Card I2C address = 0x70 | ||
+ | ** Install H1-H4 shunts | ||
+ | *** Powers [[I2CIO-8]] cards from UUT | ||
+ | |||
+ | === Test Procedure === | ||
+ | |||
+ | * Run puTTY | ||
+ | ** COM port from Device Manager | ||
+ | ** 9600 baud | ||
+ | ** No parity | ||
+ | ** No handshake | ||
+ | * Menu will display | ||
+ | <pre> | ||
+ | Checking if EEPROM is present on UUT...EEPROM is not present on UUT | ||
+ | Count of I2C devices in range 0x20-0x27 on UUT = 0 | ||
+ | Found external I2C mux card | ||
+ | Select I2C Mux board type | ||
+ | 1 - I2C-RPT-01 board | ||
+ | 2 - I2C-RPT-08 board | ||
+ | </pre> | ||
+ | * Enter 1 | ||
+ | * Replies with | ||
+ | <pre> | ||
+ | Init I2C-RPT-01 card | ||
+ | I2CIO8 card #0 was detected | ||
+ | I2CIO8 card #1 was detected | ||
+ | I2CIO8 card #2 was detected | ||
+ | I2CIO8 card #3 was detected | ||
+ | C=Card Tests, D=Direct, E=EEPROM, I=access Internal DIGIO32 | ||
+ | </pre> | ||
+ | * Verify that all 4 I2CIO-8 cards were detected | ||
+ | * Select C to test card | ||
+ | * Select B to bounce LED across LEDs on all 4 [[I2CIO-8]] cards | ||
+ | * Verify all 16 LEDs blink | ||
+ | * Hit any key to stop blinking | ||
+ | * Hit T to test card | ||
+ | * Move jumper across [[I2CIO-8]] card input jumpers | ||
+ | * Verify action on the screen | ||
+ | * Hit any key to stop test | ||
+ | * Mark TEST block on rear of card if passed | ||
+ | |||
+ | === Test Station Software === | ||
+ | |||
+ | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ODAS/ODASTESTER ODAS Tester Github Repo] | ||
+ | |||
+ | == I2C Timing == | ||
+ | |||
+ | [[file:I2C_RPT_I2C-Cycle.PNG]] | ||
== Drivers/Example Code == | == Drivers/Example Code == | ||
− | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/libraries/LandBoards_I2CRPT01 GitHub Repo] - Driver code | + | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/libraries/LandBoards_I2CRPT01 GitHub Repo] - Arduino Driver code |
− | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/I2CRPT01 Github | + | ** [https://www.arduino.cc/en/Guide/Libraries#toc4 How to import a ZIP library] |
+ | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/I2CRPT01 Github Repo] - Example code | ||
+ | * [https://github.com/land-boards/RasPi/tree/master/RPI-I2C-Hub Raspberry Pi Example Code] | ||
+ | |||
+ | === Arduino Driver Functions === | ||
+ | |||
+ | <pre> | ||
+ | LandBoards_I2CRPT01(void) - Class Constructor | ||
+ | void begin() - Assumes I2C address = 0x70 | ||
+ | void begin(uint8_t addr) - Offset address (adds base) | ||
+ | void setI2CChannel(uint8_t) - #defines are I2CRPT01_CH0 - I2CRPT01_CH3, I2CRPT01_NONE | ||
+ | uint8_t getI2CChannel(void) | ||
+ | uint8_t getIntStatus(void) | ||
+ | </pre> | ||
+ | |||
+ | ==== PCA9544 Control Register ==== | ||
+ | |||
+ | [[file:PCA9544_CTRL_REG.PNG]] | ||
+ | |||
+ | ==== PCA9544 Status Register ==== | ||
+ | |||
+ | [[file:PCA9544_STAT_REG.PNG]] | ||
+ | |||
+ | == Issues == | ||
+ | |||
+ | === Rev X3 Issues === | ||
+ | |||
+ | * Fixed SCK silkscreen to be SCL | ||
+ | * No issues found | ||
+ | |||
+ | === Rev X2 Issues === | ||
+ | |||
+ | * Board functions fine | ||
+ | * Silkscreen SCK should be SCL | ||
+ | |||
+ | [[file:I2C-RPT-01-X2_Changes.png]] | ||
+ | |||
+ | == Rev X1 Issues === | ||
+ | |||
+ | * SDA/SCL pins are swapped from "normal" pinout | ||
== Assembly Sheet == | == Assembly Sheet == | ||
* [[I2C-RPT-01 Assembly Sheet]] | * [[I2C-RPT-01 Assembly Sheet]] |
Latest revision as of 13:15, 2 April 2022
Contents
Features
- I2C Hub / Repeater / Replicator / Multiplexer / De-multiplexer / Switch
- PCA9544A Datasheet IC Multiple vendors
- Four I2C Ports
- 100KHz/400KHz operation
- I2C Address fixed at 0x70
- Host port
- Controlled via I2C
- 3.3V or 5V host operation
- 3.3V or 5V slave ports operation
- Can power slave cards if they are at the same voltage
- 3.3V or 5V slave ports operation
- Removable jumper(s) to supply power from slave
- Voltage translation between the ports
- Example: A Raspberry PI which runs 3.3V can control an I2C device which runs at 5V
- Interrupt line on each channel and host
- On-board 2.2K termination resistors
- 49x49mm form factor
- 4 solid 4-40 mounting holes
- Drivers/Example Code
- Arduino driver and example code
- Raspberry Pi example code
I2C Termination Resistors
- Card has 2.2K Termination resistors on SDA/SCL lines
Headers
H1-H4 - Headers
- Jumpers
- H1 = I2C #0 Power
- H2 = I2C #1 Power
- H3 = I2C #2 Power
- H4 = I2C #3 Power
Power Options
- The card has flexible power options to power external I2C interfaces
- Power to the Host Interface comes in J5 Host I2C Interface
- This power can be used to drive external devices on the 4 I2C slave ports
Simple Method
- The "simplest" option is to provide power to the external I2C from the I2C-RPT-01 card
- Install jumper to power the particular I2C interface from the I2C-RPT-01 card
External Power
- External interface can also have independent power
- External interfaces can be at different voltage level from the I2C-RPT-01 card
- Example #1: Card Host voltage can be 5V (Arduino) and interface to 3.3V I2C interfaces
- Remove Jumper to power from external interface (3.3V or 5V)
- In this case, the terminators get pulled up from the external interface
- External interfaces can be at different voltage level from the I2C-RPT-01 card
Connectors
- 0.1" pitch connections
- Search ebay for Dupont headers
- Search ebay for Dupontwire jumper cable
- The slave I2C connectors are (4) 1x5 right angle 0.1" pitch headers
J1-J4 - I2C Slave ports
- Ports
- J1 = I2C Port #0
- J2 = I2C Port #1
- J3 = I2C Port #2
- J4 = I2C Port #3
- Pinout
- GND
- VCC (If Hx is installed, card powers this pin)
- SDA
- SCL
- INT*
J5 - I2C to/from Host port
- Power comes in this connector
- Voltage matches signal levels
- 2.2K Ohm terminated
- I2C address is fixed at 0x70
- GND (G)
- VCC (V) - Power into the card
- SDA (D)
- SCL (C)
- INT* (I) - Interrupt (active low)
Schematic
Testing
Test Station Hardware
- Arduino Based Test Station
- Built in I2C mux on BLACK-PILL-HUB is set to offset=0x1 so it does not conflict with I2C address of UUT
- Cabling
- UUT J5 Host connects to I2C port (J7) on the BLACK-PILL-HUB
- UUT J5 Host INT pin connects via jumper cable to PB6-SIG
- Uses 4x of I2CIO-8 cards
- Cabling 5 wire from I2CIO-8 cards J1 to UUT I2C #0-#3
- Address jumpers are all installed for base address of 0x20
- On Unit Under Test (UUT)
- Card I2C address = 0x70
- Install H1-H4 shunts
- Powers I2CIO-8 cards from UUT
Test Procedure
- Run puTTY
- COM port from Device Manager
- 9600 baud
- No parity
- No handshake
- Menu will display
Checking if EEPROM is present on UUT...EEPROM is not present on UUT Count of I2C devices in range 0x20-0x27 on UUT = 0 Found external I2C mux card Select I2C Mux board type 1 - I2C-RPT-01 board 2 - I2C-RPT-08 board
- Enter 1
- Replies with
Init I2C-RPT-01 card I2CIO8 card #0 was detected I2CIO8 card #1 was detected I2CIO8 card #2 was detected I2CIO8 card #3 was detected C=Card Tests, D=Direct, E=EEPROM, I=access Internal DIGIO32
- Verify that all 4 I2CIO-8 cards were detected
- Select C to test card
- Select B to bounce LED across LEDs on all 4 I2CIO-8 cards
- Verify all 16 LEDs blink
- Hit any key to stop blinking
- Hit T to test card
- Move jumper across I2CIO-8 card input jumpers
- Verify action on the screen
- Hit any key to stop test
- Mark TEST block on rear of card if passed
Test Station Software
I2C Timing
Drivers/Example Code
- GitHub Repo - Arduino Driver code
- Github Repo - Example code
- Raspberry Pi Example Code
Arduino Driver Functions
LandBoards_I2CRPT01(void) - Class Constructor void begin() - Assumes I2C address = 0x70 void begin(uint8_t addr) - Offset address (adds base) void setI2CChannel(uint8_t) - #defines are I2CRPT01_CH0 - I2CRPT01_CH3, I2CRPT01_NONE uint8_t getI2CChannel(void) uint8_t getIntStatus(void)
PCA9544 Control Register
PCA9544 Status Register
Issues
Rev X3 Issues
- Fixed SCK silkscreen to be SCL
- No issues found
Rev X2 Issues
- Board functions fine
- Silkscreen SCK should be SCL
Rev X1 Issues =
- SDA/SCL pins are swapped from "normal" pinout