The CTC project that “keeps on giving” has me thinking again. At times that’s dangerous.
Long ago while testing the CTC machine controller board on the work bench, with only a 6" RS485 bus to a CMRI SMINI board, I was seeing a lot of read errors. The error rate was 0 (or nearly so) at 28,800 baud but went up exponentially at faster baud rates. An oscilloscope showed the bus signals to be perfectly clean. Errors happened with all 5 of the SMINI boards. It seemed odd that everyone I asked ran their CMRI RS485 buses at a slow 9600.
On the layout I was seeing more read errors even at 28,800, prompting the addition of a “unanimous vote” noise filter in the CTC machine. A specified number of SMINI reads in a row had to agree before the CTC machine would accept that an input pin changed state. That helped.
But twice I observed write errors, during which an OS signal and a maintainer call LED momentarily flashed when they shouldn’t. One of those times Vince and I were talking when the problem occurred. Vince asked me “Did you see that?” I did. It is not clear whether the cause was noise on the 485 bus or something else.
After a while my brain could no longer accept communication errors. This called for action. The decades-old CMRI protocol has no error detection. No parity, checksum, or CRC. A modern protocol needs a CRC so that 485 bus packets can be inspected, errors detected rejected and logged. However the SMINI PIC processor’s firmware is not open source.
Having no desire to reinvent the PIC’s presumed assembly language, I intend to make a small daughter board that plugs into the SMINI processor socket. On that board will be a Teensy 3.5 processor from Paul at PJRC. Available through Sparkfun and Adafruit, these small and inexpensive processor boards have lots of 5 Volt tolerant I/O pins and a fast 32-bit ARM M4 processor. They are a “big brother” to the Teensy 3.1 that runs the CTC machine. In this application an even less-expensive 8-bit Arduino Pro Mini would suffice, but would require external I2C I/O expander chips that would add bulk and complexity to the PC board layout.
This is the 3.5 board, in a photo from the PJRC.com web site:
Here’s preliminary artwork for the daughter board:
The red box shows the outline and pin designations of the SMINI’s PIC processor. Headers with round screw machine terminals will attach to these pads and plug into the PIC’s 40-pin socket. The blue box shows the outline and pins of the Teensy 3.5 that will plug into the daughter board. Note that the processor is rotated 180 degrees from the photo above, so the micro USB plug will on the right end.
A sort-of X-ray rendering of the daughter board as it will plug into into an SMINI:
The Teensy’s processor runs at 3.3 Volts with an on-board regulator, but the digital pins are all 5 Volt tolerant. The 5 Volt logic on the SMINI only requires a high level input voltage or Vih of 2 V, so it will work when being driven by the Teensy’s processor.