Hamamatsu mini-spec Firmware could be faster if rewritten

I have indeed rewritten the GroupGets firmware for the C12880MA “microspec” to be faster and easier to configure independently of this project. My main goal was to enable shorter integration times so that even bright light sources wouldn’t saturate the microspec. You can find the (poorly documented) open source repo here: https://github.com/open-eio/arduino-microspec
The Arduino code is only optimized for the Teensy 3.x boards but should work at slower speed with most other Arduino compatible boards. The optimized clock half-pulse delay is close to 100ns which allows the processor to approach the 5MHz clocking limit of the microspec, yes still using the “bit-banging” approach. But in reading out the pixel values subsequently, the overhead of Arduino’s analogRead function was still a big time sink, taking ~3500 microseconds for the 288 pixels at 16-bit and about ~2200 us at 12-bit. In talking with @gbathree I decided it wouldn’t be too hard to optimize the ADC sampling phase further, so using Pedvide’s ADC library, which is optimized for the Teensy ecosystem, I was able to get the pixel readout to complete in a total of 360 us for 16-bit and 300 us for 12-bit, both using the minimal integration time of around ~30-40 microseconds. By using a continuous sampling mode you can avoid most of the overhead of single-shot ADC reads and you can further save time by clocking out the next pixel while the native ADC peripheral is performing the conversion in parallel (assuming the sampling of the current pixel has completed). In practice the ADC sampling and conversion times might need to be slowed down a little (or not) depending on how low impedance the microspec’s VIDEO pin source is, or whether it has been buffered with further circuitry. Also, you might need to use longer integration times in low light settings.

3 Likes