\documentclass[11pt]{article}
%Gummi|065|=)
\title{ProCAT Flash and Plover}
\author{Steak Electronics}
\date{2019}
\begin{document}

\maketitle
\section{Overview}
I want to use a ProCAT flash with Plover. The ProCAT Flash is a stenography machine. It allows for faster typing, and less strain. Plover is a FOSS Stenography project.
\section{Work Log}
\subsection{Not All ProCAT Flash's will work with Plover}
Some of the plover docs mention that a ProCAT flash will work with a RJ11 to DB9 cable, and that the protocol can be set to Baron. My device must be an older firmware as there is no option to change the protocol, and in fact the RJ11 appears to be only for outbound calling... There is a modem option, and it allows you to call a number. It appears to be for actually calling a phone line.

Instead, there is an arduino sketch of someone who has previously tapped into the serial out of the IO Expander (essentially the board that reads the keys), and helpfully outlined the process. By cutting the motherboard out of the picture, and driving the IO board directly from a 5V Arduino, one can use the ProCAT without the need for its built in modem. Neat.

\subsection{Reading from a ProCAT Flash with an Arduino}
There is a six pin ribbon cable that must be cut in half, and then the arduino connected to it. This is a minimally invasive hack. I can always put the cable back. Let's begin.

The ink ribbon can be easily removed to gain better access to the IO board. The Shift Registers are TI 74HC165 which means this board may be able to be repaired, if needed. There is a conformal coating on the board, both sides. Funny how laptops don't bother with conformal coatings for waterproofing.

Vcc is pin 16, and Gnd is 8. Tracing that back to the 6 pin cable to confirm the pinout of the arduino sketch is right,
\subsubsection{Never Believe the Internet}
The pinout of the sketch was wrong, for my flash. To be fair, my flash is not a Stentura 200, so that's why.
My pinout is:
\begin{verbatim}
On ribbon cable going from left to right looking from above.

RIBBON CABLE:
1 SH/LD (shift)
2 GND
3 CLK
4 PWR
5 Serial Out
6 ??? Goes to Resistor
(INSERT PICTURE)

On my IO board, the pins are staggered, so there is 1,2,3,
 then another column of 4,5,6 (columns start at the top, 
1 being a square pad). Confusing.

IO BOARD PADS
1 ??? Goes to Resistor
2 PWR
3 GND
4 Serial Out
5 CLK (goes underneath a resistor, then to all clocks)
6 SH/LD
(INSERT PICTURE)

\end{verbatim}
These pins on the IO board are also soldered to pads (not holes) and fragile. Shit design. Tiny wires. I disconnected one just trying to follow the wires. Also they put some tape w/grease on the wires, and have them in a different order on the PCB from what the ribbon cable wiring is. Shit. Nothing I can't handle, however.

There are three rails going on the top (bottom?) of the IO board. These are CLOCK, SH/LD, and Power. GND is a copper flood on the top (bottom?) of the IO board. Make sure to double check the pins line up with what you are connecting after building this.

If you look closely on the circuit board for the IO expander, you might see labels for the Pins. I have G for gnd, + for Pwr, C for clk, etc..
\subsection{Let's solder new wires on the IO board}
I don't need to use the ribbon cable. Instead, let's take off the wires and use my own cable. I still wish the pads were holes, but I'm not making a new PCB for the IO board (though that is feasible). I might however make a PCB to fit inside the Flash... I'll need to edit the Arduino sketch too.

Not only the IO board, but I'll also need to attach wires to the metal chassis or frame somewhere inside. The Pins of the Steno short the IO expander to ground so I need to have the Arduino connected to chassis as well.



\subsection{Arduino Sketch}

I made some edits to the Arduino sketch. One thing noteworthy to myself is the
\begin{verbatim}
 /*
             * All inputs are pulled up. Pressing a key shorts 
the circuit to
             * ground.
             *
             * We invert the logic here to convert to more
 conventional positive
             * logic.
             */
            pressed          = !digitalRead(DATA_IN);
\end{verbatim}
Haven't see the !variable logic before. Only in booleans, if(!true)...


\end{document}
