Script interface (ddcp-script) support for windows
[digitaldcpower] / README.htm
1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
2 Software for version the version 3 hardware.
3 <pre>
4
5 Compiling the software and programming 
6 the microcontroller (atmega8 or atmega8a):
7 ==========================================
8
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
14
15 2) load and compile:
16 make 
17 make load
18
19 3) set the fuse bytes to 8MHz internal with BOD:
20 make fuse
21
22 This should result in the following settings:
23
24   Device signature = 0x1e9307
25    lfuse reads as A4
26    hfuse reads as D9
27
28 Fuse Low Byte details
29
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
38
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). 
43
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).
48
49 Compile under windows
50 =====================
51 Please use the provided Makefile.
52
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
57 on those batch files.
58
59  winmake.bat  -- comile, this is mandatory to use
60
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.
64
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.
68
69 Calibration
70 ===========
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.
73
74 In general you should only need to change 
75 U_DIVIDER and I_RESISTOR by very small amounts. 
76
77
78 Overview
79 ========
80 This is the software for the tuxgraphics.org electronic digital DC power supply. 
81 A microncontroller controlled bench DC power supply unit. 
82
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.
87
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.
93
94 The software is prepared for 2 versions:
95 - 0-22V 0-2.5A
96 - 0-30V 0-2A
97
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.
101
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).
110
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
117 to use than putty.
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/
123
124 Serial port settings for the terminal:
125
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.
132              
133 baudrate   : 9600
134 parity     : none
135 flowcontrol: none
136 stopbits   : 1
137 databits   : 8
138
139 </pre>
140 <br>
141 <img src=screenshot-cmd-interface.gif>
142 <br>
143 <br>
144 <pre>
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:
150
151
152 ddcp-script-ttyinit   - initialize the COM port (run this once at
153                         at the beginning)
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
156
157 ddcp-script-example.sh  - an example unix shell script showing how to use 
158                           the above commands
159
160 To compile the ddcp-script commands under linux and on the mac
161 use the command:
162
163 make ddcp-script
164
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:
168
169 make
170
171 Pre-compiled binaries are available for winXP.
172
173 -------------------------------------------------------------------
174 Copyright: GPL V2
175 Author: Guido Socher
176 Homepage: http://www.tuxgraphics.org/electronics/
177 -------------------------------------------------------------------
178 Change history:
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.
182
183 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
184                          improved.
185                          Basic uart interface prompt, no remote control yet
186
187 digitaldcpower-0.6.2 -- 2010-06-26 Full UART command interface
188
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 :
198 </pre>