40a985bd488f3862357b87073298a051a94a6956
[digitaldcpower] / README.htm
1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
2 <pre>
3
4 Compile the software and program the microcontroller:
5
6 1) edit and adapt the file hardware_settings.h 
7    (calibration and selection of the right hardware type).
8
9 2) load and compile:
10 make 
11 make load
12
13 3) set the fuse bytes to 8MHz internal:
14 make fuse
15
16 This should result in the following settings:
17
18 avrdude: Device signature = 0x1e9307
19 avrdude: safemode: lfuse reads as E4
20 avrdude: safemode: hfuse reads as D9
21
22
23 The make fuse needs to be done only once
24 unless you change the Atmega8 chip. make/make load
25 need to be repeated everytime you change something
26 in the software (e.g update of hardware_settings.h). 
27
28 The poweresupply must be powered up during programming
29 but nothing should be connected to the output. Make
30 sure that you do not accidently press any button
31 during the programming (loading the software into the uC).
32
33 Compile under windows
34 =====================
35 Please use the provided Makefile.
36
37 There are as well 3 batch files which you can use
38 to run the makefile. To use them edit them and change
39 the path as per your avr-gcc installation on your PC.
40 After that run them by double-clickin in the file manager
41 on those batch files.
42
43  winmake.bat  -- comile, this is mandatory to use
44
45  winload.bat  -- load software using avrdude, may also use
46                  some other means of loading the softare. In that
47                  case you do not need to use this batch file.
48
49  winsetfuse.bat -- set fuse bytes using avrdude, may also use
50                    some other means of loading the softare. In that
51                    case you do not need to use this batch file.
52
53 Calibration
54 ===========
55 To calibrate the display edit the file hardware_settings.h
56 Here you can change also the settings between the 30V and the 22V version.
57
58 In general you should only need to change 
59 U_DIVIDER and I_RESISTOR by very small amounts. 
60
61 ---------------------------------------------------------------
62
63 Overview
64 ========
65 This is the software for the tuxgraphics.org electronic digital DC power supply. 
66 A microncontroller controlled bench DC power supply unit. 
67
68 All of the control logic is implemented in software. This
69 saves a lot of parts compared to conventional lab-power 
70 supplies. This means it is cheaper, easier to build and
71 offers more functionallity.
72
73 Note however that this means also that the short circuit
74 protection is implemented in software. So be careful when
75 you change something in the software. If the microcontroller 
76 is not running properly due to a software fault then there
77 might not be any short circuit protection.
78
79
80 The software is prepared for 2 versions:
81 - 0-22V 0-2.5A
82 - 0-30V 0-2A
83
84 It is possible to build a different version without major
85 re-design. 
86
87 ---------------------------------------------------------------
88 How the software works
89 ======================
90
91 I have added a lot more comments to the software than usual. 
92 It should be possible even for somebody with little experience in
93 C programming to understand how this software works.
94
95 The circuit uses as internal units ADC steps. All external values
96 (Volt, Ampere) are converted to steps of the analog to digital 
97 converter (ADC). When you change the voltage then this is first
98 converted to ADC steps and then it will be further processed.
99
100
101 main.c -- this is the main program. All initialization starts here.
102  It contains a infinite while loop which will execute the slow tasks
103  one by one: 
104    + Convert ADC results to display values
105    + Update the LCD
106    + Check push buttons
107  
108 analog.c -- the analog to digital converter and the main control loop
109          for the power supply. Everything is interrupt based here as
110          it needs to be fast.
111          Voltage control, current limitation and short circuit protection
112          are all implemented here.
113
114 dac.c -- the digital to analog converter. Initalized from main.c but
115          used exclusivly from analog.c
116
117 kbd.c -- the keyboard driver
118
119 lcd.c -- the LCD driver. This is a special version which will not need
120          the rw pin of the display. It uses instead an internal timer
121          which should be long enough for the display to finish its task.
122          The RW pin which is normally used to poll the display to see
123          if it is ready is not needed.
124
125 -------------------------------------------------------------------
126 Copyright: GPL V2
127 Author: Guido Socher
128 Homepage: http://www.tuxgraphics.org/electronics/
129 -------------------------------------------------------------------
130 Change history:
131 digitaldcpower-0.6.0 -- 2010-05-22 first version of the new power V3.
132                         This version is made for a new type of hardware
133                         and will not run on any previous hardware version.
134
135 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
136                         improved.
137                      -- Basic uart interface prompt, no remote control yet
138
139                         
140 -------------------------------------------------------------------
141 </pre>