shuzidianyuan

所属分类:单片机开发
开发工具:Visual C++
文件大小:571KB
下载次数:15
上传日期:2010-03-18 13:44:41
上 传 者xiaoxie3a
说明:  今天的微控制器速度已经可以通过软件轻而易举地实现这一切。而且更妙的是电压表和电流表成了免 费的副产品。微控制器的控制环无论如何都必须知道电压和电流值。你刚好也要显示它。我们要从微控制 器得到的是:一个在所有时间都用来测量电压和电流的A/D 转换器;一个根据命令为功率三极管提供基准 电压的D/A 转换器。问题是那个D/A 转换器的速度要非常快。如果在输出端检测到了短路,那么我们必 须立即减小三极管B 极上的电压,否则这个三极管就会损坏。“快速”意味着要达到毫秒级,如同运算放 大器一样。Atmega8 的A/D 转换器已经足够快了,但显然它没有D/A 转换器。使用脉宽调制和模拟低通滤 波器是可以得到一个D/A 转换器的,但是这样速度太慢了,无法通过软件立即实现短路保护。
(The speed of today s micro-controller has been easily achieved through software, all that. And even more interesting is the voltage meter and ammeter become free Charge by-product. Micro-controller control loop in any case have to be aware of voltage and current values. You have to show that it happened. We must microcontroller Device get is: 1 at all times be used to measure voltage and current of the A/D converter one under the command and provide the basis for the power transistor Voltage of D/A converter. The problem is that D/A converter to be very fast speed. If the output short circuit is detected, then we must Shall immediately reduce the voltage on the transistor B pole, otherwise the transistor will be damaged. "Fast" means to achieve milliseconds, as the operator put Like Da-qi. Atmega8 of the A/D converter has been fast enough, but apparently it does not D/A converter. The use of pulse-width modulation and analog low-pass filter Wave device be able to get a D/A)

文件列表:
数字电源\analog.c (5068, 2005-06-26)
数字电源\analog.h (653, 2005-06-08)
数字电源\avr_compat.h (1108, 2005-05-26)
数字电源\dac.c (881, 2005-06-05)
数字电源\dac.h (375, 2005-06-05)
数字电源\ddcp.c (5453, 2005-06-15)
数字电源\ddcp.hex (15817, 2005-06-26)
数字电源\ddcp_pre.hex (15817, 2005-06-26)
数字电源\hardware_settings.h (1425, 2005-06-11)
数字电源\kbd.c (1829, 2005-06-07)
数字电源\kbd.h (470, 2005-06-05)
数字电源\lcd.c (6586, 2005-06-05)
数字电源\lcd.h (4922, 2005-06-05)
数字电源\lcdtest.c (790, 2005-06-16)
数字电源\lcd_hw.h (1974, 2005-06-05)
数字电源\Makefile (4027, 2005-06-17)
数字电源\数字电源.pdf (658781, 2005-09-27)
数字电源 (0, 2009-04-19)

Digital DC Power ================ Compile the software and program the microcontroller: 1) edit and adapt the file hardware_settings.h 2) load and compile: make wrfuse4mhz make make load The make wrfuse4mhz needs to be done only once unless you change the Atmega8 chip. make/make load need to be repeated everytime you change something in the software (e.g update of hardware_settings.h). The poweresupply must be powered up during programming but nothing should be connected to the output. Make also sure that you do not accidently press any button during the programming (loading the software into the uC). --------------------------------------------------------------- Overview ======== This is the software and hardware description for the tuxgraphics.org electronic power supply. A microncontroller controlled DC power supply. All of the control logic is implemented in software. This saves a lot of parts compared to conventional lab-power supplies. This means it is cheaper, easier to build and offers more functionallity. Note however that this means also that the short circuit protection is implemented in software. So be careful when you change something in the software. If the microcontroller is not running properly due to a software fault then there might not be any short circuit protection. The software is prepared for 2 versions: - 0-24V 0-2A - 0-30V 0-2.5A It is possible to build a different version without major re-design. Check the article details for hardware limits and to extend them. The hardware has as of this release features which are not yet supported by the software: - store settings to survive a power off - i2c driver interface to linux PC The plan is that both features will be added in future versions of the software. It will be software only changes. --------------------------------------------------------------- How the software works ====================== I have added a lot more comments to the software than usual. It should be possible even for somebody with little experience in C programming to understand how this software works. The circuit uses as internal units ADC steps. All external values (Volt, Ampere) are converted to steps of the analog to digital converter (ADC). When you change the voltage then this is first converted to ADC steps and then it will be further processed. ddcp.c -- this is the main program. All initialisation starts here. It contains a infinite while loop which will execute the slow tasks one by one: + Convert ADC results to display values + Update the LCD + Check push buttons analog.c -- the analog to digital converter and the main control loop for the power supply. Everything is interrupt based here as it needs to be fast. Voltage control, current limitation and short circuit protection are all implemented here. dac.c -- the digital to analog converter. Initalized from ddcp.c but used exclusivly from analog.c kbd.c -- the keyboard driver lcd.c -- the LCD driver. This is a special version which will not need the rw pin of the display. It uses instead an internal timer which should be long enough for the display to finish its task. The RW pin which is normally used to poll the display to see if it is ready is not needed. ------------------------------------------------------------------- Copyright: GPL Author: Guido Socher Homepage: http://www.tuxgraphics.org/electronics/ ------------------------------------------------------------------- Change history: digitaldcpower-0.2.2 -- first public version 2005-06-16 limitations: no i2c, no permanent storage of settings digitaldcpower-0.2.3 -- 2005-06-25 update of circuit diagram -------------------------------------------------------------------

近期下载者

相关文件


收藏者