1 <h2>Tuxgraphics Digital DC Power Supply Unit</h2>
4 Compile the software and program the microcontroller:
6 1) edit and adapt the file hardware_settings.h
7 (calibration and selection of the right hardware type).
13 3) set the fuse bytes to 8MHz internal:
16 This should result in the following settings:
18 avrdude: Device signature = 0x1e9307
19 avrdude: safemode: lfuse reads as E4
20 avrdude: safemode: hfuse reads as D9
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).
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).
35 Please use the provided Makefile.
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
43 winmake.bat -- comile, this is mandatory to use
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.
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.
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.
58 In general you should only need to change
59 U_DIVIDER and I_RESISTOR by very small amounts.
61 ---------------------------------------------------------------
65 This is the software for the tuxgraphics.org electronic digital DC power supply.
66 A microncontroller controlled bench DC power supply unit.
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.
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.
80 The software is prepared for 2 versions:
84 It is possible to build a different version without major
87 ---------------------------------------------------------------
88 How the software works
89 ======================
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.
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.
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
104 + Convert ADC results to display values
108 analog.c -- the analog to digital converter and the main control loop
109 for the power supply. Everything is interrupt based here as
111 Voltage control, current limitation and short circuit protection
112 are all implemented here.
114 dac.c -- the digital to analog converter. Initalized from main.c but
115 used exclusivly from analog.c
117 kbd.c -- the keyboard driver
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.
125 -------------------------------------------------------------------
128 Homepage: http://www.tuxgraphics.org/electronics/
129 -------------------------------------------------------------------
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.
135 digitaldcpower-0.6.1 -- 2010-06-06 Number conversion to display string
137 -- Basic uart interface prompt, no remote control yet
140 -------------------------------------------------------------------