|
| 1 | +Hardware Test Harness |
| 2 | +===================== |
| 3 | + |
| 4 | +There is an implementation of the hardware testing design which is a small 4in x 4in board with positions for |
| 5 | +two Wemos D! Mini ESP8266 boards, a breadboard area and a number of positions for peripherals. The schematics |
| 6 | +are in [schematic](Test-harness-schematic-v1.pdf) and a rendering of the board is . |
| 7 | + |
| 8 | + |
| 9 | +The test harness runs from a dedicated host computer, which is expected |
| 10 | +to have reset- and programming-capable UART links to both ESP8266 |
| 11 | +devices, as found on almost all ESP8266 boards with USB to UART |
| 12 | +adapters, but the host does not necessarily need to use USB to connect, |
| 13 | +so long as TXD, RXD, DTR, and RTS are wired across. |
| 14 | + |
| 15 | +The alternate pins on the primary D1 Mini (DUT0) are cross wired to the |
| 16 | +RX and TX pins on the secondary D1 Mini (DUT1) and these are enabled by |
| 17 | +a pin on the MCP23017. |
| 18 | + |
| 19 | +Build Notes |
| 20 | +----------- |
| 21 | + |
| 22 | +The only thing that needs to be done is to solder on 0.1" headers at the required |
| 23 | +positions. Typically D1 Minis come with 2 sets of 8 pin headers, both male and female. |
| 24 | +I solder the female headers to the board, and the maie headers to the D1 minis. Other, |
| 25 | +mostly 4 pin, headers can be soldered at the other positions. The 7 pin header for |
| 26 | +the color sensor (TCS34725) requires some care as the board needs to be mounted |
| 27 | +upside down so that the sensor is directly above the WS2812. |
| 28 | + |
| 29 | +The screw holes at the corners are for M3 screws. A standard adhesive rubber foot can |
| 30 | +also be used. There are no components on the underside of the test board, so not much clearance |
| 31 | +is required (only the length of the various headers soldered on the board). |
| 32 | + |
| 33 | +Power |
| 34 | +----- |
| 35 | + |
| 36 | +The board is powered by either (or both) D1 Mini USB connection. Given the cross connects |
| 37 | +between the two D1 Minis, I think that all the tests can be conducted from DUT0, but |
| 38 | +it is probably easier to connected both of the D1 Minis via USB to the test runner. |
| 39 | + |
| 40 | +There is a small resistor between the two 5 volt rails to prevent large currents |
| 41 | +if the two USB feeds are at slughtly different voltages. The 3.3 volt rails are |
| 42 | +directly connected together. If the regulators produce slightly different voltages, |
| 43 | +then the one producing the higher voltage will end up providing all the power for the |
| 44 | +3.3 volt devices. |
| 45 | + |
| 46 | +Peripherals |
| 47 | +----------- |
| 48 | + |
| 49 | +### I2C Bus |
| 50 | + |
| 51 | +There is an I2C bus hanging off DUT 0. Attached hardware is used both as |
| 52 | +tests of modules directly and also to facilitate testing other modules |
| 53 | +(e.g., gpio). |
| 54 | + |
| 55 | +Most of the positions on the board are connected to the DUT1 I2C bus. |
| 56 | + |
| 57 | +#### MCP23017: I/O Expander |
| 58 | + |
| 59 | +At address 0x20. An 16-bit tristate GPIO expander, this chip is used to |
| 60 | +test I2C, GPIO, and ADC functionality. This chip's interconnections are |
| 61 | +as follows: |
| 62 | + |
| 63 | +MPC23017 | Purpose |
| 64 | +---------|-------------------------------------------------------------- |
| 65 | +/RESET |DUT0 reset. This resets the chip whenever the host computer resets DUT 0 over its serial link (using DTR/RTS). |
| 66 | +B 0 |4K7 resistor to DUT 0 ADC. |
| 67 | +B 1 |2K2 resistor to DUT 0 ADC. |
| 68 | +B 2 |Direct to DUT1 RST |
| 69 | +B 3 |Direct to DUT1 D3 |
| 70 | +B 4 |When low, connects the alternate UART pins on DUT0 to RX,TX on DUT1 |
| 71 | +B 5 |DUT1 GPIO16/WAKE via 4K7 resitor |
| 72 | +B 6 |DUT0 GPIO13 via 4K4 resistor and DUT1 GPIO15 via 4K7 resistor (also feeds in the primary TX from DUT1 when enabled by B4) |
| 73 | +B 7 |DUT0 GPIO15 via 4K7 resistor and DUT1 GPIO13 via 4K7 resistor (also feeds the primary RX on DUT1 when enabled by B4) |
| 74 | + |
| 75 | +Notes: |
| 76 | + |
| 77 | +- DUT 0's ADC pin is connected via a 2K2 reistor to this chip's port |
| 78 | + B, pin 1 and via a 4K7 resistor to port B, pin 0. This gives us the |
| 79 | + ability to produce approximately 0 (both pins low), 1.1 (pin 0 high, |
| 80 | + pin 1 low), 2.2 (pin 1 high, pin 0 low), and 3.3V (both pins high) |
| 81 | + on the ADC pin. |
| 82 | +- Port B pins 6 and 7 sit on the UART cross-wiring between DUT 0 and |
| 83 | + DUT 1. The 23017 will be tristated for inter-DUT UART tests, but |
| 84 | + these |
| 85 | +- All of port A, remain available for expansion and are routed to the breadboard area. |
| 86 | + |
| 87 | +#### WS2812s |
| 88 | + |
| 89 | +There are three WS2812s connected on DUT1/D4. The last Ws2812 is positioned so that a TCS34725 module |
| 90 | +can be mounted upside down over it to read out the color of the WS2812. That device is connected to |
| 91 | +the I2C port on DUT0. A suitable board is [CJMCU-34725 TCS34725 Color Sensor RGB color sensor development board module](https://www.aliexpress.com/item/32412698433.html). The illuminating |
| 92 | +LED is connected to the INT pin and so you can disable the LED under software control. |
| 93 | + |
| 94 | +#### Oled Displays |
| 95 | + |
| 96 | +Each of the D1 Minis is connected to a position for a 128x64 OLED display, again on the primary I2C bus. |
| 97 | + |
| 98 | +#### Servo |
| 99 | + |
| 100 | +On DUT1 pin D4/GPIO 2 there is a connection to a position for a small servo. The servo is powered by the |
| 101 | +5V voltage rail. |
| 102 | + |
| 103 | +#### DHTxx |
| 104 | + |
| 105 | +On DUT1 pin D6/GPIO 12 there is a connection to a position for a DHTxx device. The silk screen indicates the |
| 106 | +orientation of the device. |
| 107 | + |
| 108 | +#### DS18B20 |
| 109 | + |
| 110 | +There are two positions for DS18B20s -- one with the VCC pin connected and one without. The data pin is |
| 111 | +connected to DUT1 pin D5/GPIO 14. |
| 112 | + |
| 113 | +#### I2C devices with VCC/GND/SCL/SDA pin order |
| 114 | + |
| 115 | +There are three positions for I2C devices which have the pins in the VCC/GND/SCL/SDA order. These |
| 116 | +are on the DUT1 I2 bus. |
| 117 | + |
| 118 | +#### I2C devices with other pin orders |
| 119 | + |
| 120 | +There are three positions for I2C devices with other pin orders. Each of these positions is next |
| 121 | +to a crossbar switch and so four blobs of solder can configure each of these headers into any |
| 122 | +desired pin order. As far as I can tell, most of the cheap modules use the VCC/GND/SCL/SDA order. |
| 123 | + |
| 124 | + |
| 125 | +Breadboard Area |
| 126 | +=============== |
| 127 | + |
| 128 | +All the pins on each D1 Mini and the A port of the MCP23017 are brought out to a breadboard |
| 129 | +area. This can be used to solder components and/or wires, or even a header could be soldered |
| 130 | +on to transfer all the signals to a conventional breadboard. |
| 131 | + |
| 132 | + |
| 133 | +ESP8266 Device 0 Connections |
| 134 | +---------------------------- |
| 135 | + |
| 136 | +ESP | Usage |
| 137 | +----------|---------------------------------------------------------- |
| 138 | +D3/GPIO 0 |Used to enter programming mode; otherwise unused in test environment. |
| 139 | +TX/GPIO 1 |Primary UART transmit; reserved for host communication |
| 140 | +D4/GPIO 2 |[reserved for 1-Wire] [+ reserved for 23017 INT[AB] connections] |
| 141 | +RX/GPIO 3 |Primary UART recieve; reserved for host communication |
| 142 | +D2/GPIO 4 |I2C SDA. Connected to MCP23017, Oled display and the TCS34725 if present. |
| 143 | +D1/GPIO 5 |I2C SCL |
| 144 | +GPIO 6 |[Reserved for on-chip flash] |
| 145 | +GPIO 7 |[Reserved for on-chip flash] |
| 146 | +GPIO 8 |[Reserved for on-chip flash] |
| 147 | +GPIO 9 |[Reserved for on-chip flash] |
| 148 | +GPIO 10 |[Reserved for on-chip flash] |
| 149 | +GPIO 11 |[Reserved for on-chip flash] |
| 150 | +D6/GPIO 12 | |
| 151 | +D7/GPIO 13 |Secondary UART RX; DUT 1 GPIO 15, I/O expander B 6 |
| 152 | +D5/GPIO 14 | |
| 153 | +D8/GPIO 15 |Secondary UART TX; DUT 1 GPIO 13, I/O expander B 7 |
| 154 | +D0/GPIO 16 | |
| 155 | +A0/ADC 0 |Resistor divider with I/O expander |
| 156 | + |
| 157 | +ESP8266 Device 1 Connections |
| 158 | +---------------------------- |
| 159 | + |
| 160 | +ESP | Usage |
| 161 | +----------|---------------------------------------------------------- |
| 162 | +D3/GPIO 0 |Used to enter programming mode; otherwise unused in test environment. |
| 163 | +TX/GPIO 1 |Primary UART transmit; reserved for host communication |
| 164 | +D4/GPIO 2 |Connected to chain of 3 WS2812s. Also connected to the servo position. |
| 165 | +RX/GPIO 3 |Primary UART recieve; reserved for host communication |
| 166 | +D2/GPIO 4 |I2C SDA. Connected to all the other I2C positions on the board |
| 167 | +D1/GPIO 5 |I2C SCL |
| 168 | +GPIO 6 |[Reserved for on-chip flash] |
| 169 | +GPIO 7 |[Reserved for on-chip flash] |
| 170 | +GPIO 8 |[Reserved for on-chip flash] |
| 171 | +GPIO 9 |[Reserved for on-chip flash] |
| 172 | +GPIO 10 |[Reserved for on-chip flash] |
| 173 | +GPIO 11 |[Reserved for on-chip flash] |
| 174 | +D6/GPIO 12 |Connected to data pin for DHTxx |
| 175 | +D7/GPIO 13 |Secondary UART RX; DUT 0 GPIO 15, I/O exp B 7 via 4K7 Also used as HSPI MOSI for SPI tests |
| 176 | +D5/GPIO 14 |Connected to data pin for DS18B20s. |
| 177 | +D8/GPIO 15 |Secondary UART TX; DUT 0 GPIO 13, I/O exp B 6 via 4K7 Also used as HSPI /CS for SPI tests |
| 178 | +D0/GPIO 16 |I/O expander B 5 via 4K7 resistor, for deep-sleep tests |
| 179 | +A0/ADC 0 | |
| 180 | + |
| 181 | + |
0 commit comments