Difference between revisions of "RPI-I2C-HUB"
Jump to navigation
Jump to search
Blwikiadmin (talk | contribs) |
Blwikiadmin (talk | contribs) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
* I2C Hub / Repeater / Replicator / Multiplexer / De-multiplexer | * I2C Hub / Repeater / Replicator / Multiplexer / De-multiplexer | ||
** PCA9544A IC | ** PCA9544A IC | ||
− | * Controlled via I2C | + | ** Controlled via I2C |
− | * Multiple part vendors | + | ** Multiple part vendors |
− | * Devices with the same address can be attached to different ports | + | ** Devices with the same address can be attached to different ports |
* Host I2 port goes to Raspberry Pi I2C lines | * Host I2 port goes to Raspberry Pi I2C lines | ||
− | * 3.3V host operation | + | ** 3.3V host operation |
* Four I2C slave ports | * Four I2C slave ports | ||
− | * I2C ports can use the Raspberry Pi or have their own power (power source select jumper) | + | ** I2C ports can use the Raspberry Pi or have their own power (power source select jumper) |
− | * A Raspberry PI which runs 3.3V can control an I2C device which runs at 5V | + | ** A Raspberry PI which runs 3.3V can control an I2C device which runs at 5V |
* Voltage translation between the ports | * Voltage translation between the ports | ||
− | * I2C ports can be 3.3V or 5V | + | ** I2C ports can be 3.3V or 5V |
* Fits in any Raspberry Pi model | * Fits in any Raspberry Pi model | ||
− | * Cutout for Model B RCA video jack | + | ** Cutout for Model B RCA video jack |
* Interrupt controller on each channel and host 100KHz/400KHz operation | * Interrupt controller on each channel and host 100KHz/400KHz operation | ||
* On-board termination resistors | * On-board termination resistors | ||
+ | |||
+ | == Testing == | ||
+ | |||
+ | * PCA9544 Programming | ||
+ | * Run with DigIO16-I2C card on Hub Port #0 | ||
+ | * Verify that the Hub is seen from the Raspberry Pi | ||
+ | * Note should be -y 0 for the older revision Raspberry Pis | ||
+ | <pre> | ||
+ | pi@raspi3 ~ $ sudo i2cdetect -y 1 | ||
+ | 0 1 2 3 4 5 6 7 8 9 a b c d e f | ||
+ | 00: -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 70: -- 71 -- -- -- -- -- -- | ||
+ | </pre> | ||
+ | * Shows that there is an I2C part at 0x71 | ||
+ | * Next, set the mux to channel #0 | ||
+ | <pre> | ||
+ | pi@raspi3 ~ $ sudo i2cset -y 1 0x71 0x04 0x04 | ||
+ | </pre> | ||
+ | * Verify that the hub is set to the port | ||
+ | <pre> | ||
+ | pi@raspi3 ~ $ sudo i2cdetect -y 1 | ||
+ | 0 1 2 3 4 5 6 7 8 9 a b c d e f | ||
+ | 00: -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | ||
+ | 70: -- 71 -- -- -- -- -- -- | ||
+ | </pre> | ||
+ | * This shows the two addresses of the DigIO16-I2C | ||
+ | |||
+ | * [https://github.com/land-boards/RasPi/blob/master/RPI-I2C-Hub/RPI-I2C-Hub.py Raspberry Pi Code] - Bounce a light across 8 LEDs on a MCP23017 | ||
+ | |||
+ | === Interrupts === | ||
+ | |||
+ | * (4) Active Low Inputs | ||
+ | ** 3.3K pullups | ||
+ | * Active Low Output | ||
+ | ** 3.3K pullup | ||
+ | * On Raspberry Pi GPIO_17 | ||
+ | ** Per [https://www.raspberrypi.org/documentation/hardware/raspberrypi/gpio/README.md Raspberry Pi > GPIO] | ||
+ | * Each GPIO pin, when configured as a general-purpose input, can be configured as an interrupt source to the ARM. | ||
+ | * [https://github.com/land-boards/RasPi/tree/master/RPI-I2C-Hub/IntrTestRPiHub Test code is here] | ||
+ | |||
+ | == Power == | ||
+ | |||
+ | * Card power is 3.3V | ||
+ | |||
+ | == Connectors == | ||
+ | |||
+ | === J1-J4 - I2C Slave ports 0-3 === | ||
+ | |||
+ | # GROUND | ||
+ | # Power (see H1-H4 for explanation) | ||
+ | # SDA | ||
+ | # SCK | ||
+ | # Interrupt* | ||
+ | |||
+ | === H1-H4 - I2C power source selection === | ||
+ | |||
+ | * Installed - Raspberry Pi provides 3.3V power on the I2C connector power pin | ||
+ | * Not installed - External device provides power on the I2C connector power pin | ||
+ | |||
+ | == Factory Test == | ||
+ | |||
+ | === Test Setup === | ||
+ | |||
+ | [[File:I2C-RPT-01-Demo01-512px.jpg]] | ||
+ | |||
+ | === Test Steps === | ||
+ | |||
+ | * Hook up Raspberry Pi to Ethernet | ||
+ | * Ethernet is using static IP | ||
+ | * Connect (4) I2CIO-8 cards (Rev X2 or later add Interrupt line) | ||
+ | * Set I2CIO-8 cards addresses to 000 | ||
+ | * Terminator jumpers not present | ||
+ | * Use 5-pin 1:1 cables | ||
+ | * Power up the Pi (using puTTY) | ||
+ | * Verify all 4 I2CIO-8 cards have INT LEDs illuminated | ||
+ | * Log onto Pi | ||
+ | * Test code is here | ||
+ | * Enter | ||
+ | <pre> | ||
+ | cd ~/RasPi/RPI-I2C-Hub/R-Hub-Intr-4x8 | ||
+ | sudo python R-Hub-Intr-4x8.py | ||
+ | </pre> | ||
+ | |||
+ | * Will cycle through the LEDs on all four cards | ||
+ | * Insert/remove slowly (every 2 secs or so) shunts on input lines of I2CIO-8 cards | ||
+ | * Int light will go out momentarily until message is displayed | ||
+ | * Messages will be like | ||
+ | <pre> | ||
+ | Input changed on channel 0 value = 0 | ||
+ | Input changed on channel 0 value = 1 | ||
+ | Input changed on channel 1 value = 0 | ||
+ | Input changed on channel 1 value = 2 | ||
+ | Input changed on channel 2 value = 0 | ||
+ | Input changed on channel 2 value = 8 | ||
+ | Input changed on channel 3 value = 0 | ||
+ | Input changed on channel 3 value = 4 | ||
+ | </pre> | ||
+ | |||
+ | * Verify all channels show input change (values do not matter) | ||
== Schematic == | == Schematic == | ||
Line 33: | Line 144: | ||
* [https://github.com/land-boards/RasPi/tree/master/RPI-I2C-Hub Git Hub Repo] | * [https://github.com/land-boards/RasPi/tree/master/RPI-I2C-Hub Git Hub Repo] | ||
+ | |||
+ | == Checkout - Rev X1 == | ||
+ | |||
+ | * Changed base address to 0x71 | ||
+ | * Added some extra pins marking | ||
== Assembly Sheet == | == Assembly Sheet == | ||
* [[RPI-I2C-HUB Assembly Sheet]] | * [[RPI-I2C-HUB Assembly Sheet]] |
Revision as of 20:24, 26 January 2020
Contents
I2C Hub for the Raspberry Pi
Features
- I2C Hub / Repeater / Replicator / Multiplexer / De-multiplexer
- PCA9544A IC
- Controlled via I2C
- Multiple part vendors
- Devices with the same address can be attached to different ports
- Host I2 port goes to Raspberry Pi I2C lines
- 3.3V host operation
- Four I2C slave ports
- I2C ports can use the Raspberry Pi or have their own power (power source select jumper)
- A Raspberry PI which runs 3.3V can control an I2C device which runs at 5V
- Voltage translation between the ports
- I2C ports can be 3.3V or 5V
- Fits in any Raspberry Pi model
- Cutout for Model B RCA video jack
- Interrupt controller on each channel and host 100KHz/400KHz operation
- On-board termination resistors
Testing
- PCA9544 Programming
- Run with DigIO16-I2C card on Hub Port #0
- Verify that the Hub is seen from the Raspberry Pi
- Note should be -y 0 for the older revision Raspberry Pis
pi@raspi3 ~ $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- 71 -- -- -- -- -- --
- Shows that there is an I2C part at 0x71
- Next, set the mux to channel #0
pi@raspi3 ~ $ sudo i2cset -y 1 0x71 0x04 0x04
- Verify that the hub is set to the port
pi@raspi3 ~ $ sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- 71 -- -- -- -- -- --
- This shows the two addresses of the DigIO16-I2C
- Raspberry Pi Code - Bounce a light across 8 LEDs on a MCP23017
Interrupts
- (4) Active Low Inputs
- 3.3K pullups
- Active Low Output
- 3.3K pullup
- On Raspberry Pi GPIO_17
- Each GPIO pin, when configured as a general-purpose input, can be configured as an interrupt source to the ARM.
- Test code is here
Power
- Card power is 3.3V
Connectors
J1-J4 - I2C Slave ports 0-3
- GROUND
- Power (see H1-H4 for explanation)
- SDA
- SCK
- Interrupt*
H1-H4 - I2C power source selection
- Installed - Raspberry Pi provides 3.3V power on the I2C connector power pin
- Not installed - External device provides power on the I2C connector power pin
Factory Test
Test Setup
Test Steps
- Hook up Raspberry Pi to Ethernet
- Ethernet is using static IP
- Connect (4) I2CIO-8 cards (Rev X2 or later add Interrupt line)
- Set I2CIO-8 cards addresses to 000
- Terminator jumpers not present
- Use 5-pin 1:1 cables
- Power up the Pi (using puTTY)
- Verify all 4 I2CIO-8 cards have INT LEDs illuminated
- Log onto Pi
- Test code is here
- Enter
cd ~/RasPi/RPI-I2C-Hub/R-Hub-Intr-4x8 sudo python R-Hub-Intr-4x8.py
- Will cycle through the LEDs on all four cards
- Insert/remove slowly (every 2 secs or so) shunts on input lines of I2CIO-8 cards
- Int light will go out momentarily until message is displayed
- Messages will be like
Input changed on channel 0 value = 0 Input changed on channel 0 value = 1 Input changed on channel 1 value = 0 Input changed on channel 1 value = 2 Input changed on channel 2 value = 0 Input changed on channel 2 value = 8 Input changed on channel 3 value = 0 Input changed on channel 3 value = 4
- Verify all channels show input change (values do not matter)
Schematic
Example Code/Driver
Checkout - Rev X1
- Changed base address to 0x71
- Added some extra pins marking