|
|
Line 1: |
Line 1: |
− | [[file:DIGIO32-I2C_P1994_720px.jpg]] | + | [[File:tindie-mediums.png|link=https://www.tindie.com/products/land_boards/i2c-8-bit-io-mcp23008-i2cio-8x/]] |
| | | |
− | <video type="youtube">yfm2ZRHHBAg</video> | + | <video type="youtube">omUSJpGLv4A</video> |
| | | |
− | == Hardware ==
| + | [[File:I2CIO-8X-6104-640px.jpg]] |
| | | |
− | * [[BLACK-PILL-HUB]] - Test Station Processing element
| + | == Features == |
− | ** [[STM32 Black Pill]] - CPU card
| |
− | *** Preferred choice due to nearly unlimited resources
| |
− | ** Previous CPU choices
| |
− | *** [[BLUE-PILL-HUB]]
| |
− | **** FTDI card required
| |
− | *** [[NANO-BKOUT]]
| |
− | * [[DIGIO32-I2C]] - 32-bits of Digital I/O for testing some cards
| |
− | * [[LED-32]] - 32 LEDS for bounce across LEDs tests
| |
− | * [[DB37RIBBON]] - DB-37 Male to right angle Ribbon cable header
| |
− | ** DB-37 plugs into Test Station [[DIGIO32-I2C]]
| |
− | ** Some UUT cards use a second [[DB37RIBBON]] card
| |
− | * [[DB25RIBBON]] - DB-25 Male or Female to Ribbon cable
| |
− | ** Some UUT cards have DB-25 connectors
| |
− | * UUT cable sets
| |
− | ** Connect to [[DB37RIBBON]], [[DB25RIBBON]], or [[LED-32]] cards in Test Station
| |
− | * PC running PuTTY
| |
− | ** 9600 baud
| |
− | ** USB-C cable
| |
− | *** USB connected to PC and USB-C connected to [[BLACK-PILL-HUB]]
| |
− | * Powered through the USB-C connector on the [[STM32 Black Pill]]
| |
| | | |
− | === BLACK-PILL-HUB === | + | * 8 bits of Digital I/O |
| + | * I2C interface |
| + | * MCP23008P |
| + | * Base address = 0x20 |
| + | * Address offset jumpers (0-7) |
| + | * Interrupt pin on I2C connectors |
| + | * I2C Daisy-chain connectors |
| + | * GVS (Ground/Voltage/Signal) pins for all 8-bits |
| + | * 2.7V to 5.5V |
| + | * 49x49mm form factor |
| + | * (4) #4-40 mounting holes |
| | | |
− | [[FILE:Black-Pill-Hub_P1383-720px.jpg]]
| + | == Drivers/Example Code == |
| | | |
− | <video type="youtube">3o0MC8F1onk</video>
| + | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/libraries/LandBoards_I2CIO8X Github repo] - Driver code |
| + | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/I2CIO8X Github repo] - Example code |
| | | |
− | === LED-32 === | + | == Factory Acceptance Test == |
| | | |
− | [[FILE:LED-32-P426-720px.jpg]]
| + | === Test Station Theory of Operations === |
| | | |
− | === DIGIO32-I2C ===
| + | * Test Station controls the I2C interface on the UUT |
| + | * Three tests |
| + | ** Internal Test |
| + | ** External Loopback Test |
| + | ** Bounce an LED Test |
| | | |
− | [[FILE:DIGIO32-I2C-P232-720px.jpg]]
| + | === Test Station Set-up === |
| | | |
− | <video type="youtube">fiyauoZw_Y4</video>
| + | * Uses [[Arduino_Based_Test_Station|ODAS Test Station V2]] |
− | | + | * Ribbon cable sets |
− | == Personality EEPROM ==
| + | ** Loopback cable Connector |
| + | ** [[LED-32]] cable |
| + | * Unit Under Test (UUT) |
| + | * Attach Host Computer USB to the Arduino NANO on the Test Station |
| + | * Run puTTY on the Host Computer |
| + | ** 9600 baud |
| | | |
− | * Tests cards without personality EEPROM
| + | === Card Selection === |
− | * Tests cards with personality EEPROM
| |
− | ** Personality EEPROM follows Raspberry Pi Hat EEPROM format
| |
− | ** Test station writes EEPROM
| |
− | ** Test station uses EEPROM contents (if present) to determine which test to run
| |
| | | |
− | === Example Personality EEPROM - DIGIO-128 ===
| |
| <pre> | | <pre> |
− | Reading EEPROM
| + | Checking if EEPROM is present on UUT...EEPROM is not present on UUT |
− | Family=ODAS
| + | Count of I2C devices in range 0x20-0x27 on UUT = 1 |
− | Company=land-boards.com
| + | Detected MCP23008 |
− | Product=DIGIO-128
| + | Select the board type (Other) |
| + | 1 - I2CIO8 board |
| + | 2 - I2CIO8X board |
| + | Select board > |
| </pre> | | </pre> |
| | | |
− | == Black Pill Setup ==
| + | * Select 2 |
− | | |
− | === Resources ===
| |
− | | |
− | * Plenty of resources | |
− | ** EEPROM - 524288 bytes
| |
− | ** SRAM - 131072 bytes
| |
| | | |
| <pre> | | <pre> |
− | Sketch uses 50316 bytes (9%) of program storage space. Maximum is 524288 bytes.
| + | Init I2CIO-8X card |
− | Global variables use 3828 bytes (2%) of dynamic memory, leaving 127244 bytes for local variables. Maximum is 131072 bytes.
| + | C=Card Tests, D=Direct, E=EEPROM, I=access Internal DIGIO32 |
| </pre> | | </pre> |
| | | |
− | == Programming == | + | === Running Loopback Card Test === |
− | | |
− | === Programming Setup ===
| |
− | | |
− | * Steps from [https://www.sgbotic.com/index.php?dispatch=pages.view&page_id=49 Programming|Program STM32 Black Pill (STM32F401 / F411) with Arduino IDE (Windows OS)]
| |
− | ** Add the URL to Additional Board Manager URLs text box:
| |
− | *** https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json
| |
− | ** Go to Tools > Board > Boards Manager
| |
− | ** Search for STM32, select latest version and click Install.
| |
− | ** Download and install STM32CubeProg from ST.com: [https://www.st.com/en/development-tools/stm32cubeprog.html]
| |
− | | |
− | === DFU Programming ===
| |
| | | |
− | [[file:STM32F4-Black-Pill-Board-oriented.jpg]]
| + | * Use loopback cable |
| + | * Select Card Tests = "C" |
| + | * Select Run Tests = "T" |
| + | * Observe test results |
| | | |
− | ** Start the STM32CubeProg
| + | === Running Internal Tests === |
− | ** From the Tools > Board > STM32 Board, select Generic STM32F4 series
| |
− | ** Select Tools > Board Part Number > BlackPill F411CE
| |
− | ** Under USB Support, select CDC (generic "Serial" supersede U(S)ART)
| |
− | ** Under Upload method, select SMT32CubeProgrammer(DFU)
| |
− | ** Use the onboard BOOT0 and NRST button to put the board into bootloader mode:
| |
− | *** press and hold the BOOT0 button
| |
− | *** press and release NRST (reset) button to power cycle the processor
| |
− | **** alternate is to press the Reset button on the [[BLACK-PILL-HUB]] card
| |
− | *** release BOOT0 button
| |
− | *** Sometimes removing the USB cable and plugging it back in while pressing BOOT0 button works better
| |
− | ** Upload sketch
| |
| | | |
− | [[file:BlackPill_Config.png]]
| + | * Remove loopback cable |
| + | * Select Card Tests = "C" |
| + | * Select Run Tests = "I" |
| + | * Observe test results |
| | | |
− | * Displays in IDE
| + | === Running Blink LED Test === |
− | | |
− | <pre>
| |
− | USB speed : Full Speed (12MBit/s)
| |
− | Manuf. ID : STMicroelectronics
| |
− | Product ID : STM32 BOOTLOADER
| |
− | SN : 348C35983539
| |
− | FW version : 0x011a
| |
− | Device ID : 0x0431
| |
− | Device name : STM32F411xC/E
| |
− | Flash size : 512 KBytes (default)
| |
− | Device type : MCU
| |
− | Device CPU : Cortex-M4
| |
− | | |
− | | |
− | | |
− | Memory Programming ...
| |
− | Opening and parsing file: ODASTESTER.ino.bin
| |
− | File : ODASTESTER.ino.bin
| |
− | Size : 49132 Bytes
| |
− | Address : 0x08000000
| |
− | | |
− | | |
− | Erasing memory corresponding to segment 0:
| |
− | Erasing internal memory sectors [0 2]
| |
− | erasing sector 0000 @: 0x08000000 done
| |
− | erasing sector 0001 @: 0x08004000 done
| |
− | erasing sector 0002 @: 0x08008000 done
| |
− | Download in Progress:
| |
− | | |
− | | |
− | File download complete
| |
− | Time elapsed during download operation: 00:00:02.263
| |
− | | |
− | RUNNING Program ...
| |
− | Address: : 0x8000000
| |
− | Start operation achieved successfully
| |
− | </pre>
| |
− | | |
− | === Other Programming === | |
− | | |
− | * ST-LINK V2
| |
− | * [https://www.st.com/en/development-tools/flasher-stm32.html FLASHER-STM32] - STM32 Flash loader demonstrator (UM0462)
| |
− | * From [https://www.st.com/content/ccc/resource/technical/document/application_note/51/5f/03/1e/bd/9b/45/be/CD00264342.pdf/files/CD00264342.pdf/jcr:content/translations/en.CD00264342.pdf AN3155]
| |
− | [[File:SerialPropogramming (AN3155).PNG]]
| |
− | | |
− | == Useful Arduino Code ==
| |
− | | |
− | Here's some useful pieces of Arduino code
| |
− | | |
− | === uint8_t checkI2CAddr(uint8_t addr) ===
| |
− | | |
− | <pre>
| |
− | ////////////////////////////////////////////////////////////////////////////
| |
− | // uint8_t checkI2CAddr(uint8_t addr) - Check that an I2C device is present
| |
− | // Pass: addr - I2C address
| |
− | // Returns:
| |
− | // 0 : success
| |
− | // 1 : data too long to fit in transmit buffer
| |
− | // 2 : received NACK on transmit of address
| |
− | // 3 : received NACK on transmit of data
| |
− | // 4 : other error
| |
− | ////////////////////////////////////////////////////////////////////////////
| |
− | | |
− | uint8_t checkI2CAddr(uint8_t addr)
| |
− | {
| |
− | Wire.beginTransmission(addr);
| |
− | return (Wire.endTransmission());
| |
− | }
| |
− | </pre>
| |
− | | |
− | === uint8_t checkIfMCP23017(uint8_t addr)===
| |
− | | |
− | <pre>
| |
− | ////////////////////////////////////////////////////////////////////////////
| |
− | // uint8_t checkIfMCP23017(uint8_t addr)
| |
− | // Check to see if the I2C part is a MCP23017
| |
− | // The GPU Pullup A register (internal register address 0x0c) is present
| |
− | // in a MCP23017 but not in a MCP23008.
| |
− | // Pass: addr - I2C address
| |
− | // Returns
| |
− | // 0 : Not an MCP23017
| |
− | // 1 : Likely an MCP23017
| |
− | ////////////////////////////////////////////////////////////////////////////
| |
− | | |
− | uint8_t checkIfMCP23017(uint8_t addr)
| |
− | {
| |
− | // Write 0x55 to MCP23017_GPPUA (0x0c)
| |
− | Wire.beginTransmission(addr);
| |
− | Wire.write(0x0c);
| |
− | Wire.write(0x55);
| |
− | Wire.endTransmission(1);
| |
− | // Read back
| |
− | Wire.beginTransmission(addr);
| |
− | Wire.write(0x0c);
| |
− | Wire.endTransmission();
| |
− | Wire.requestFrom(addr, 1);
| |
− | if (Wire.read() == 0x55)
| |
− | {
| |
− | Serial.println(F("Detected MCP23017"));
| |
− | return 1;
| |
− | }
| |
− | else
| |
− | {
| |
− | Serial.println(F("Detected MCP23008"));
| |
− | return 0;
| |
− | }
| |
− | }
| |
− | | |
− | </pre>
| |
− | | |
− | == Cards Supported ==
| |
− | | |
− | Goal is to have automated tests for as many cards as possible. The currently tested cars are.
| |
− | | |
− | * [[DigIO16-I2C]] board
| |
− | * [[DIGIO-128]] board
| |
− | * [[OptoIn8-I2C]] board
| |
− | * [[OptoOut8-I2C]] board
| |
− | * [[DIGIO32-I2C]] board
| |
− | * [[PROTO16-I2C]] board
| |
− | * [[ODAS-PSOC5]] board
| |
− | * [[ODAS-RELAY-16]] board
| |
− | * [[DIGIO-128]]/64 board
| |
− | * [[I2CIO-8]] board
| |
− | * [[I2CIO-8X]] board
| |
− | * [[SWLEDX8-I2C]] board
| |
− | * [[OPTOFAST-2]]/[[OptoSmall]] Non-Inverting board
| |
− | * [[OPTOFAST-2]]/[[OptoSmall]] Inverting board
| |
− | * [[I2C-RPT]] board
| |
− | * [[I2C-RPT-08]] board
| |
− | * [[OptoFastBi]] board
| |
− | | |
− | === Menu Options ===
| |
− | | |
− | <pre>
| |
− | Select the board type
| |
− | 1 - DIGIO16-I2C board
| |
− | 2 - DIGIO-128 board
| |
− | 3 - OptoIn8-I2C board
| |
− | 4 - OptoOut8-I2C board
| |
− | 5 - DIGIO32-I2C board
| |
− | 6 - PROTO16-I2C board
| |
− | 7 - ODAS-PSOC5 board
| |
− | 8 - ODAS-RELAY16 board
| |
− | A - DIGIO-128/64 board
| |
− | 9 - TBD board
| |
− | X - Boards without EEPROMs
| |
− | Select board > X
| |
− | Select the board type
| |
− | 1 - I2CIO8 board
| |
− | 2 - I2CIO8X board
| |
− | 3 - SWLEDX8-I2C board
| |
− | 4 - OPTOFast/Small Non-Inverting board
| |
− | 5 - OPTOFast/Small Inverting board
| |
− | 6 - I2C-RPT-01 board
| |
− | 7 - I2C-RPT-08 board
| |
− | 8 - OptoFastBi board
| |
− | </pre>
| |
| | | |
− | == Cable Sets == | + | * Attach [[LED-32]] cable |
| + | * Select Card Tests = "C" |
| + | * Select Run Tests = "B" |
| + | * Observe LEDs scanning in [[LED-32]] |
| | | |
− | [[FILE:ODTSTSTR_CBLS_P119_720pv.jpg]]
| + | === Reference === |
| | | |
− | * Particular cable sets for cards | + | * [[Arduino Based Test Station]] |
− | * Bounce LED and Loopback to Test Station Cables | + | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ODAS/ODASTESTER ODAS Tester Github Repo] |
| | | |
− | == Software == | + | == Assembly Sheet == |
| | | |
− | * [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ODAS/ODASTESTER ODAS Test Software Github Repo] | + | * [[I2CIO8-X Assembly Sheet]] |
− | * Bounce LEDs and loop test to [[DIGIO32-I2C]]
| |