This page describes how to connect the TCD1304 to the STM32F401, STM32F405 and STM32F103.
(Obviously) connect GND to GND, but make only one connection to avoid ground loops, regardless of the version of the TCD1304-PCB you have.
Connect +5 V to +5 V if you have a TCD1304-PCB with an LDO in place. If the voltage is not regulated on the TCD1304-PCB, use either the +3.3 V or the +5 V. The CCD’s output voltage is dependent on the input voltage, and you may experience output greater than 3.3 V (which is outside the range of the MCU’s ADC) with a 5 V supply.
To connect the TCD1304 to the Nucleo F401RE simply make the following connections:
- fM connects to PB0
- SH connects to PA1
- ICG connects to PA0
- Output connects to PC0
To connect the TCD1304 to the STM32F405 simply make the following connections:
- fM connects to PA6
- SH connects to PA3
- ICG connects to PA1
- Output connects to PC1
To connect the TCD1304 to the STM32F103 simply make the following connections:
- fM connects to PA15
- SH connects to PB4
- ICG connects to PA10
- Output connects to PA1
If you’re a low-noise freak, you may want to pull down unused GPIOs and connect them to GND. The following GPIOs are pulled down by default in the firmware:
PB1, PC1, PC4 and PC5
If you find the pins on the F401RE inconveniently positioned, it’s possible to choose other pins. It’s not an entirely free choice, confer with the alternate function mapping in the datasheet. And try to keep the driving pulses away from ADC-in.¹