Look a few posts down from this one, titled “CTC Machine Build.”
The main idea was to eliminate almost all of the messy point-to-point wiring. I certainly wasn’t going to deal with a rats nest of wires between C/MRI hardware and individual switches and lamps.
Everything that can attach directly to the PCB does so. The power of multiplexing was used to distill all wiring between the panel and the controller to just 4 CAT5 cables carrying power and I2C buses. Each of the CAT5 cables controls up to 128 I/Os, although not all are needed.
Each column PCB is a PCA9555 I2C chip with 16 programmable I/Os. This part has 3 address pins so there can be up to 8 on a single I2C bus. I use the interrupt output pin as a fast way to determine if a code button has been pressed. There’s no need to constantly poll all the code buttons.
The machine controller has a PCA9545 4-way I2C mux. The processor is a $20 PJRC Teensy 3.1 (current model is 3.2) with all code written in object-oriented C++ using the Arduino development environment. I didn’t follow Chubb’s code examples. Instead of reading the entire layout, calculating everything, then writing the whole layout, the code reads one SMINI, calculates, and writes it back. It then checks to see if any code button was pressed by testing the interrupt output pin of the I2C mux. The worst-case time spent in the Arduino loop() routine takes about 15 mS, so there’s no need for a resistor+capacitor on the back of each code button.
Based on what I learned, today I would add two 6-32 standoffs to hold the board rigidly to the panel instead of relying primarily on one or two switches.
Also, today I’d look into the Model Railroad Control Systems cpNodes instead of SMINI hardware or build something similar using the $10 Arduino Pro Mini. I recently replaced all the PIC processors on SMINIs with Teensy 3.5s. These add CRC error-detection on all data transmissions. Today we run error-free at 115,200 baud.