1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
2 Software for the version 3 hardware.
5 Compiling the software and programming
6 the microcontroller (atmega8 or atmega8a):
7 ==========================================
9 1) edit and adapt the file hardware_settings.h
10 (calibration and selection of the right hardware type).
11 You can as well just copy one of the pre-set versions
12 on top of hardware_settings.h.
13 Example: cp hardware_settings.h-22V hardware_settings.h
19 3) set the fuse bytes to 8MHz internal with BOD:
22 This should result in the following settings:
24 Device signature = 0x1e9307
30 BODLEVEL Brown out detector trigger level = 1
31 BODEN Brown out detector, 0=enable = 0
32 SUT1 Select start-up time = 1
33 SUT0 Select start-up time = 0
34 CKSEL3 Select Clock source = 0
35 CKSEL2 Select Clock source = 1
36 CKSEL1 Select Clock source = 0
37 CKSEL0 Select Clock source = 0
39 The "make fuse" needs to be done only once
40 unless you change the Atmega8/Atmega8a chip. make/make load
41 need to be repeated everytime you change something
42 in the software (e.g update of hardware_settings.h).
44 The poweresupply must be powered up during programming
45 but nothing should be connected on the output. Make
46 sure that you do not accidently press any button
47 during the programming (while loading the software into the uC).
51 Please use the provided Makefile.
53 There are as well 3 batch files which you can use
54 to run the makefile. To use them edit them and change
55 the path as per your avr-gcc installation on your PC.
56 After that run them by double-clicking on them in the
59 winmake.bat -- comile, this is mandatory to use
61 winclean.bat -- delete all files generated during compilation
63 winload.bat -- load software using avrdude, may also use
64 some other means of loading the softare. In that
65 case you do not need to use this batch file.
67 winsetfuse.bat -- set fuse bytes using avrdude. You may as well use
68 some other means of changing the fuse bytes. In that
69 case you do not need to use this batch file.
73 To calibrate the display edit the file hardware_settings.h
74 Here you can change also the settings between the 30V and the 22V version.
76 In general you should only need to change
77 U_DIVIDER and I_RESISTOR by very small amounts.
82 This is the software for the tuxgraphics.org electronic digital DC power supply.
83 A microncontroller controlled bench DC power supply unit.
85 All of the control logic is implemented in software. This
86 saves a lot of parts compared to conventional lab-power
87 supplies and means it is cheaper, easier to build and
88 offers more functionallity.
90 Note however that this means also that the short circuit
91 protection is implemented in software. Be careful when
92 you change something in the software. If the microcontroller
93 is not running properly due to a software fault then there
94 might not be any short circuit protection.
96 The software is prepared for 2 versions:
100 If you want to build a version that has a smaller output
101 range than any of the two version then you can just
102 modify the file hardware_settings.h.
104 Remote control from your PC
105 ===========================
106 The unit can be controlled remotely from a computer using
107 a USB serial interface. An add-on card is available from
108 http://shop.tuxgraphics.org which offers galvanic separation
109 such that you can use this power supply relative to
110 any reference point (e.g build two power supplies and use
111 one as negative and one as positive power supply).
113 Terminal settings for remote control via your computer
114 ======================================================
115 You can e.g use putty under windows
116 http://www.chiark.greenend.org.uk/~sgtatham/putty/
117 Putty supports as serial connections. The other common
118 option under windows is HyperTerminal but it is more complicated
120 For Linux I can recommend picocom
121 http://code.google.com/p/picocom/
122 (use command picocom -l -b 9600 /dev/ttyUSB0)
123 Another good serial terminal for linux is gtkterm
124 http://www.jls-info.com/julien/linux/
126 Serial port settings for the terminal:
128 port : Virtual com port (e.g /dev/ttyUSB1 or /dev/ttyUSB0
129 or COM5 under windows or ... whatever port the
130 virtual com-port maps to)
131 Under linux or Mac you can use the command dmesg
132 after you have plugged in the USB cable to see to
133 which com-port/device the new virtual com port maps to.
134 Under windows you look at Control Panel->Hardware->Devices
135 and click on FT232R USB UART->Hardware to see the COM
146 <img src=screenshot-cmd-interface.gif>
150 Controling the power supply with scriptable commands
151 ====================================================
152 You can control the digital power supply by commands. A number
153 of commands are provided for this purpose. They are at the moment
154 available for Linux, Mac and Windows:
157 ddcp-script-ttyinit - initialize the COM port (run this once at
159 ddcp-script-getval - get current values (same as you see on the LCD)
160 ddcp-script-setval - send a command to the power supply
162 ddcp-script-example.sh - an example unix shell script showing how to use
165 To compile the ddcp-script commands under linux and on the mac
170 The windows versions of those commands are available in the
171 sub-directory "ddcp-script-windows". The windows versions
172 are compiled in that sub-directory with the command:
176 Pre-compiled binaries are available for winXP.
178 -------------------------------------------------------------------
180 Copyright: GPL V2 (see http://www.gnu.org/licenses/old-licenses/gpl-2.0.html )
181 Author: Guido Socher (guidosocher@gmail.com)
182 Homepage: http://www.tuxgraphics.org/electronics/
183 -------------------------------------------------------------------
185 digitaldcpower-0.6.0 -- 2010-05-22 first version of the new power V3.
186 This version is made for a new type of hardware
187 and will not run on any previous hardware version.
189 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
191 Basic uart interface prompt, no remote control yet
193 digitaldcpower-0.6.2 -- 2010-06-26 Full UART command interface
195 digitaldcpower-0.6.3 -- 2010-07-03 Accelerate UART command polling to
196 not loose characters when copied/pasted at high speed.
197 Line editing with backspace if terminal supports it.
198 Set BOD (brown out detector enable) fuse.
199 Script interface (ddcp-script)
200 digitaldcpower-0.6.4 -- 2010-07-11 added ddcp-script interface
201 commands for windows.
202 digitaldcpower-0.6.5 -- 2012-04-14 There was a fault in the range setting
203 for the PWM (ICR1L in dac.c). Thanks to Weitao Li (james)
204 for reporting this. This fault reduced the precision
206 -- 2012-04-14 some minor improvemnents in main.c and analog.c to
207 regulate the voltage drop over the current measuremtns shunts
210 digitaldcpower-0.6.6 -- 2012-07-17 Adapt the code to compile clean with the latest
211 avr-libc (http://www.nongnu.org/avr-libc/changes-1.8.html)
212 prog_char is now depricated.
213 -------------------------------------------------------------------
214 vim: set sw=8 ts=8 si et :