SWLEDX8-I2C

From Land Boards Wiki
Jump to navigation Jump to search

SWLEDX8-I2C-P119-Orth-720px.JPG

Features[edit]

  • 16-Bit Digital I/O card with a small form factor
  • Card can be used standalone or stacked together with the SWLEDX8 card
  • I2C Daisy-Chain (In/Out) connectors
  • (3) I2C Address select jumpers for up to 8 devices per I2C bus
  • SCL/SDA termination jumpers
  • 2x10 pins Digital I/O Header
    • 16 digital pins
    • 2 power, 2 ground pins
  • 59mmx38mm
  • (4) #4-40 mounting holes
  • Software Drivers

Build Options[edit]

  • There are a number of options for using the card
    • Stacked option with SWLEDX8 card
    • Small footprint option
    • Low height/profile option

Stacked option with SWLEDX8 card[edit]

  • SWLEDX8 card mounts above this card
  • Pins can be directly mounted to both cards or male/female connector pairs can be used

SWLEDX8-I2C FRONT(DOWN) REV2.png

Small footprint option[edit]

SWLEDX8-I2C FRONT(STRT) REV2.png

Low height/profile option[edit]

SWLEDX8-I2C FRONT(RT ANGL) REV2.png

Rear Side Marking[edit]

SWLEDX8-I2C REAR(STRT) REV2.png

Connectors[edit]

  • Connectors are as follows

SWLEDX8-I2C-CAD(REV2).PNG

P1 - GPIO Pins[edit]

SWLEDX8-I2C P1A.PNG

Connections to SWLEDX8 Card[edit]

  • When paired with SWLEDX8
    • MCP23017 Port A connects to SWITCHES 0-7 on SWLEDX8
    • MCP23017 Port B connects to LEDs 0-7 on SWLEDX8
  • Board Rev 2 reverses bit order for byte transfers can be used

SWLEDX8-I2C P1.PNG

P2 - I2C Interface[edit]

SWLEDX8-I2C P2A.PNG

  • 2X5 header
  • Pinout
  1. GND
  2. VCC
  3. SDA
  4. SCL
  5. INTA

SWLEDX8-I2C P2.PNG

P3 - I2C Terminators / I2C Address Offset Jumpers[edit]

SWLEDX8-I2C P3A.PNG

  • Install left 2 jumpers to terminate I2C bus
    • Typically, the "last" card in a chain
  • Install right 3 jumpers for I2C base address offset in range 0x20 (all installed) to 0x27 (all removed)

SWLEDX8-I2C P3.PNG

I2C Address J3(A2) J3(A1) J3(A0)
0x0 In In In
0x1 In In Out
0x2 In Out In
0x3 In Out Out
0x4 Out In In
0x5 Out In Out
0x6 Out Out In
0x7 Out Out Out

Drivers / Software Examples[edit]

  • Any MCP23017 library should work with this card
  • Here's our tested code

Arduino[edit]

  • LandBoards MCP23017
    • pinMode(uint8_t bit, uint8_t value) - Set bits 0-7=Input, 8-15=Output
    • readGPIOA() - Read the 8 Switches
    • writeOLATB(uint8_t baData) _ Write the 8 LEDs
    • digitalRead(uint8_t bit) - read a single Switch (bit=0-7)
    • digitalWrite(uint8_t bit, uint8_t wrVal) - write a single LED (nit=8-15)
  • SWLEDX8_01.ino - Read 8 Switches, Write 8 LEDs

MicroPython Drivers[edit]

ESP32 MicroPython Driver[edit]

PyBoard MicroPython Driver[edit]

CircuitPython[edit]

Raspberry Pi Pico[edit]

MMBASIC[edit]

I2C VHDL Code[edit]

Mechanicals[edit]

SWLEDX8-I2C-MECHS(REV2).PNG

Versions[edit]

Rev 2[edit]

  • Not functionally the same as Rev X1
    • Flips the data bits to match the SWLEDX8 card
      • Programs can read/write in bytes (no shuffling of bits needed)
  • Change resistors from SMT (0805) to through hole (1/8W)
  • Adds silkscreen Front/Rear
  • Added test block to rear
  • Moves "Rev 2" silkscreen to rear

Rev X1[edit]

  • Words, no issues

Assembly Sheet[edit]