Q: Why didn’t you use an arduino to drive the TCD1304?
A: Arduinos are great, but here’s why the Arduino Uno/Nano is not suitable for driving the TCD1304:
- The ADC is (way) too slow.
- There’s not enough timers.
- There’s no DMA
The Arduino Due is a completely different animal, and from looking at the datasheet it looks like it’s comparable to the STM32F103. So if you want to use the Arduino universe with the TCD1304, use the Due.
Q: What’s the difference between the SPI and the UART firmware?
A: A nucleo running the UART-fw can be connected to any computer through the nucleo board’s USB connection. The data-rate is 115.2 kbps so transmission a full dataset takes 640 ms to complete.
A nucleo running the SPI-fw requires a Raspberry Pi. The nucleo and the rpi must be connected through SPI. The data-rate is 16 Mbps so transmission of a full dataset takes 4 ms.
Needless to say, the firmware and the software interface must use the same communication protocol.
Q: I have an STM32Fxxx, will the firmware run directly on it?
A: Probably not. You need to port the code to make sure the timers are prescaled correctly and can be tied to the GPIOs you want to use. The DMA-channels and streams are probably also different. Confer with the datasheet for your MCU.
Q: I have an STM32Fxxx, can the firmware be ported to it?
A: It’s a good question. The firmware relies on the following peripherals:
- 4 timers (3 for the driving pulses, 1 for triggering the ADC)
- 1 ADC (with a conversion time < 2µs)
- DMA-controller (1 stream for the ADC, and 1 for UART/SPI)
Q: Is it possible to drive other CCDs with the firmware?
A: No. Different CCDs have different driving pulses and timing requirements. You’ll need to tailor the firmware to your CCD.
There is one exception: The TCD1305P / TCD1305DG is compatible with the firmware. However, it’s an inferior chip compared to the TCD1304, and it’s more expensive.