1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
2 Software for version 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 (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-clickin in the file manager
59 winmake.bat -- comile, this is mandatory to use
61 winload.bat -- load software using avrdude, may also use
62 some other means of loading the softare. In that
63 case you do not need to use this batch file.
65 winsetfuse.bat -- set fuse bytes using avrdude, may also use
66 some other means of changing the fuse bytes. In that
67 case you do not need to use this batch file.
71 To calibrate the display edit the file hardware_settings.h
72 Here you can change also the settings between the 30V and the 22V version.
74 In general you should only need to change
75 U_DIVIDER and I_RESISTOR by very small amounts.
80 This is the software for the tuxgraphics.org electronic digital DC power supply.
81 A microncontroller controlled bench DC power supply unit.
83 All of the control logic is implemented in software. This
84 saves a lot of parts compared to conventional lab-power
85 supplies and means it is cheaper, easier to build and
86 offers more functionallity.
88 Note however that this means also that the short circuit
89 protection is implemented in software. Be careful when
90 you change something in the software. If the microcontroller
91 is not running properly due to a software fault then there
92 might not be any short circuit protection.
94 The software is prepared for 2 versions:
98 If you want to build a version that has a smaller output
99 range than any of the two version then you can just
100 modify the file hardware_settings.h.
102 Remote control from your PC
103 ===========================
104 The unit can be controlled remotely from a computer using
105 a USB serial interface. An add-on card is available from
106 http://shop.tuxgraphics.org which offers galvanic separation
107 such that you can use this power supply relative to
108 any reference point (e.g build two power supply and use
109 one as negative and one as positive power supply).
111 Terminal settings for remote control via your computer
112 ======================================================
113 You can e.g use putty under windows
114 http://www.chiark.greenend.org.uk/~sgtatham/putty/
115 it supports as well serial connections. The other common
116 option under windows is HyperTerminal but it is more complicated
118 For Linux I can recommend picocom
119 http://code.google.com/p/picocom/
120 (use command picocom -l -b 9600 /dev/ttyUSB0)
121 Another good serial terminal for linux is gtkterm
122 http://www.jls-info.com/julien/linux/
124 Serial port settings for the terminal:
126 port : Virtual com port (e.g /dev/ttyUSB1 or /dev/ttyUSB0
127 or COM5 under windows or ... whatever port the
128 virtual com-port maps to)
129 Under linux or Mac you can use the command dmesg
130 after you have plugged in the USB cable to see to
131 which com-port/device the new virtual com port maps to.
141 <img src=screenshot-cmd-interface.gif>
145 Controling the power supply with scriptable commands
146 ====================================================
147 You can control the digital power supply by commands. A number
148 of commands are provided for this purpose. They are at the moment
149 available for Linux, Mac and Windows:
152 ddcp-script-ttyinit - initialize the COM port (run this once at
154 ddcp-script-getval - get current values (same as you see on the LCD)
155 ddcp-script-setval - send a command to the power supply
157 ddcp-script-example.sh - an example unix shell script showing how to use
160 To compile the ddcp-script commands under linux and on the mac
165 The windows versions of those commands are available in the
166 sub-directory "ddcp-script-windows". The windows versions
167 are compiled in that sub-directory with the command:
171 Pre-compiled binaries are available for winXP.
173 -------------------------------------------------------------------
176 Homepage: http://www.tuxgraphics.org/electronics/
177 -------------------------------------------------------------------
179 digitaldcpower-0.6.0 -- 2010-05-22 first version of the new power V3.
180 This version is made for a new type of hardware
181 and will not run on any previous hardware version.
183 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
185 Basic uart interface prompt, no remote control yet
187 digitaldcpower-0.6.2 -- 2010-06-26 Full UART command interface
189 digitaldcpower-0.6.3 -- 2010-07-03 Accelerate UART command polling to
190 not loose characters when copied/pasted at high speed.
191 Line editing with backspace if terminal supports it.
192 Set BOD (brown out detector enable) fuse.
193 Script interface (ddcp-script)
194 digitaldcpower-0.6.4 -- 2010-07-11 added ddcp-script interface
195 commands for windows.
196 -------------------------------------------------------------------
197 vim: set sw=8 ts=8 si et :