This repository contains the firmware for the Keithley SCAN2000 STM32 SSR replacement PCB found here. Do note, this firmware only works with the 1.x revision of the PCB that uses an STM32 microcontroller.
The source code is based on the project by George Christidis. It uses CubeMX instead and it makes use of the STM32 HAL labraries instead of the low-level libraries. It can be built using a Makefile.
Two options to upload the firmware are detailed below. One uses the STM32CubeProgrammer programmer with a GUI and is provided by ST. The other option uses the open souce toolkit stlink and does the upload via the command line. The latter is recommended and simpler to use when building the binaries from the sources because both compiling and uploading can be done via the same Makefile script.
To flash the SMT32G0, I use an ST-Link programmer along with STM32CubeProgrammer.
To flash the firmware to the microcontroller do the following:
- If you want to build the firmare from its sources, you will need the
gcc-arm-none-eabi
compiler. Using Ubuntu, this can be done viaapt
.
sudo apt install gcc-arm-none-eabi
- Open a terminal and go to the source code folder. Compile the code using the Makefile. In Linux type
make
Alternatively use the pre-compiled firmware found here.
- Power the MCU via the 5V pin. It should draw about 40 mA @ 5V and the Power led should be lit.
- Connect the ST-link programmer via the header provided on the PCB.
- Open STM32CubeProgrammer and press connect
- Now open load the .hex file and press download. STM32CubeProgrammer should report success and the board current should now drop to < 10 mA.
- In the STM32CubeProgrammer window press disconnect. The board power typically increases by 1 mA.
- Disconnect the ST-Link.
- Reset the MCU. The Activity led now should flash three times to signal a successful boot. The board should now draw about 13-15 mA during idle and only the power LED should be lit.
Alternatively, you can use the open souce toolkit stlink which also requires the ST-Link programmer, but programming can be done from the CLI.
- If you want to build the firmare from its sources, you will need the
gcc-arm-none-eabi
compiler. Using Ubuntu, this can be done viaapt
.
sudo apt install gcc-arm-none-eabi stlink-tools
- Open a terminal and go to the source code folder. Compile the code using the Makefile. In Linux type
make
- Power the MCU via the 5V pin. It should draw about 40 mA @ 5V and the Power led should be lit.
- Connect the ST-link programmer via the header provided on the PCB.
- Open a terminal and go to the source code folder. Type
make upload
The Activity led should now flash three times to signal a successful boot.
- Disconnect the ST-Link.
- The board should now draw about 13-15 mA during idle and only the power LED should be lit.
A compiled version can be found on the the releases page.
If you want to read back what the MCU is doing, hook up a TTL to USB converter to the TX and GND pins. I use a Waveshare Industrial USB TO TTL Converter, but any of the cheap Ebay FT232RL modules works. The parameters are 115200 baud, 8 bits, no parity, 1 stop bit.
To configure a Linux tty, type the following commands. Do make sure to change the tty to your tty. This example uses /dev/ttyUSB5
.
stty -F /dev/ttyUSB5 115200 cs8 -cstopb -parenb echo -echoe -echok -echoctl -igncr -icanon
See the following repositories for more information
Keithley SCAN2000 Hardware 1.x: https://github.com/PatrickBaus/SCAN2000/tree/v1
I use SemVer for versioning. For the versions available, see the tags available for this repository.
- MAJOR versions in this context mean a breaking change to the external interface like changed commands or functions.
- MINOR versions contain changes that only affect the inner workings of the software, but otherwise the performance is unaffected.
- PATCH versions do not add, remove or change any features. They contain small changes like fixed typos.
This project is licensed under the GPL v3 license - see the LICENSE file for details