The main goals of this emulator are:
- to provide the exact same USB interface that the Tenma-72-2710 power supply.
- to run on a RaspberryPi Pico H to be cheap and easily integrated on a test bench.
Why not virtual USB interfaces ?
To have a solution independent from OS and their implementation specificities
It does not have many requirements, so you might just clone the repo and run it. install the following package first.
sudo apt update
sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib build-essential
pip install pyserial
pip install robotframework
This project has a github actions workflow that build the Pico firmware.
Othewise the project can be build with the following commmand, the cmake
may take a couple of minutes.
cd pico-firmware
mkdir build
cd build
cmake ..
make -j8
Drag and drop the src/serial.uf2 on the Pico in bootsel mode, or use the following command:
cp src/serial.uf2 /media/<user>/RPI-RP2/
Get the tty port of the pico in /dev, and set the variable ${PORT_NAME} of the file tenma-control/tenma.robot with the right port.
To lunch the tests run:
robot -d results/ tenma.robot
Use the script tenma-control/tenma_72_2710 to test the pico firmware, you can use the same script to control the Tenma-72-2710 power supply.
tenma-control/tenma_72_2710.py -h
tenma-control/tenma_72_2710.py -v /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py -s /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py --on /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py --off /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py -sv 5000 /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py -gv /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py -sc 3500 /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00
tenma-control/tenma_72_2710.py -gc /dev/serial/by-id/usb-Nuvoton_USB_Virtual_COM_E6614C311B888B35-if00