A year ago I started to use my new digital PSU and the early logs are there : https://hackaday.io/project/20733-hot-logic/log/56927-and-the-psu. Today I have set it up again and these logs and the files are very helpful :-)
But first I had to connect my computer to the lab PSU, which are more than 2m apart. Fortunately I found in my stock a hub and enough AtoB USB cables to connect the PSU and the mouse close to the bench. It should be moderately practical :-)
Plugging the PSU through the hub :
[1069116.978946] usb 2-1.3: new full-speed USB device number 28 using ehci-pci [1069117.058694] usb 2-1.3: New USB device found, idVendor=03eb, idProduct=3301 [1069117.058708] usb 2-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [1069117.058714] usb 2-1.3: Product: Standard USB Hub [1069117.061972] hub 2-1.3:1.0: USB hub found [1069117.062213] hub 2-1.3:1.0: 4 ports detected [1069117.348953] usb 2-1.3.2: new full-speed USB device number 29 using ehci-pci [1069117.461864] usb 2-1.3.2: New USB device found, idVendor=0416, idProduct=5011 [1069117.461878] usb 2-1.3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1069117.461884] usb 2-1.3.2: Product: USB Virtual COM [1069117.461889] usb 2-1.3.2: Manufacturer: USB Vir [1069117.461894] usb 2-1.3.2: SerialNumber: NT2009101400 [1069117.465957] cdc_acm 2-1.3.2:1.0: ttyACM3: USB ACM device
yup, the same /dev/ttyACM3 as before :-)
From now on, everything must be done by root, or the user should be added to the relevant group.
export TTY=/dev/ttyACM3
Then configure the serial port : file serial9600.sh
#!/bin/bash #1 start, 8 data, 1 stop, no parity TTY=/dev/ttyACM3 stty 9600 cs8 raw -echo -echoe -echonl -echoprt -echoctl -echoke -parenb -F $TTY
And now we can talk !
on one terminal, display the port's output with
# od -An -v -w1 -t c /dev/ttyACM3
In another terminal, send a SCPI command :
echo -n "*IDN?" > $TTY
I get the following result :
[root@localhost yg]# od -An -v -w1 -t c /dev/ttyACM3 K O R A D K A 6 0 0 2 P V 2 . 0 \0
It's working !
The relevant vocabulary is quite simple :
- Identify :
echo -n "*IDN?" > $TTY
- Turn output off :
echo -n "OUT0" > $TTY
- Turn output on :
echo -n "OUT1" > $TTY
- Set max. current to 0.42A :
echo -n "ISET1:0.42" > $TTY
- Read back the max. current setting :
echo -n "ISET1?" > $TTY
- Read the actual output current :
echo -n "IOUT1?" > $TTY
- Set the output voltage to 12.34V :
echo -n "VSET1:12.34" > $TTY
- Read back the voltage setting :
echo -n "VSET1?" > $TTY
- Read the measured output voltage :
echo -n "VOUT1?" > $TTY
-
Read the status :
echo -n "STATUS?" > $TTY
(the result is binary and the bits must be interpreted)
- Some more commands exist (see the references in the previous log) but I'll only play with the voltage.
.
.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.