CNI widgets
The firmware code for the devices is stored in our git repository. This repository is currently restricted for internal CNI use only. But if you are interested in seeing the source code, just ask.
Serial port scan trigger device


We are using a [Teensy board] programmed using a simple [teensyduino] sketch. The device generates TTl pulses when told to do so through a serial port command ("[t]"). This device will also listen for input pulses and send out a serial port character ("p") whenever one is detected. It uses an external interrupt, so it can reliably detect very brief pulses. We use this to detect the GE 3.3v scope trigger pulses (~4 usec pulse duration).
See the CNI trigger code for serial port.
GE physiological data monitor

We also built a device to read serial data from the GE MR750 physiological monitoring port in the PGR cabinet. We need to detect the pulses in real-time for EEG balistocardiogram artifact removal. Unfortunately, the pulses are not available in the GE system, but they do provide the raw PPG data (along with respiration belt and ECG data).
The data come in 12-byte (96-bit) packets delivered at 115200 bps. A packet comes every 5ms, with silence between packets. This produces data bursts of 96bits / 115.2bits/ms = .8333ms with 5 - .8333 = 4.1667ms of silence. (This timing pattern was confirmed with a scope.) So we can detect the start of a data packet by waiting for the silent period before the data arrives. Here we only care about the PPG value. But the code could be easily modified to do something with the other physiological readings.
To detect a pulse, we compute a running mean and standard deviation and compute a z-score for each new data point. When several consecutive data point z-scores are above threshold, we signal that a pulse was detected. With a Teensy 2++ (which has 8k SRAM), we can maintain a buffer size of 1024, which is 1024 * 0.005 = 5.12 seconds. This seems to be enough to give a very stable pulse detection.
Circuit tidbits
- Outputs are protected from reverse voltages with a diode
- We used a little monochrome [OLED display] to show what is happening.
- We need a little circuit to take the scanner data stream (-12v to +12v) and allow it to be safely ready by our 5v microprocessor. We just took the Tx part of this simple RS232 level converter. We used a 2N3904 transistor with emitter to ground, collector to the UART Rx pin on the microcontroller with a 10k pull-up resistor to the 5v line, and the base connected to the Tx line coming from the scanner via a 4.7K resistor, with a 4.7k pull-down to ground.