Batteries are the typical power sources for portable-system applications, and it is not unusual these days to find microcontroller-based portable systems. A variety of microcontrollers operates at low power-supply voltages, such as 1.8V. Thus you can employ two AA or AAA cells to power the circuit. However, if the circuit requires higher voltage—for LED backlighting for an LCD, for example, which requires approximately 7.5V dc—you must employ a suitable dc/dc converter to boost the power-supply voltage from, for example, 3V to the required voltage. However, you can also employ a microcontroller to develop a suitable dc/dc-boost-voltage converter (Reference 1) with the help of a few additional discrete components.

This Design Idea shows how to create not just one, but two dc/dc converters with just a tiny eight-pin microcontroller and a few discrete components. The design is scalable, and you can adapt it for a wide range of output-voltage requirements just by changing the control software for the microcontroller. You can even program the microcontroller to generate any required output-voltage start-up rate. Figure 1 shows the basic topology of a boost switching regulator. The output voltage in such a regulator is more than the input voltage. The boost switching regulator operates in either CCM (continuous-conduction mode) or DCM (discontinuous-conduction mode). It is easier to set up a circuit for DCM operation (Reference 2). The name comes from the fact that the inductor current falls to 0A for some time during each PWM period in DCM; in CCM, the inductor current is never 0A. The maximum current passes through the inductor at the end of high period of the PWM output (when the switch is on) and is:

The total period of the PWM wave is T and is a system constant. D is the duty cycle of the PWM wave, and TR is the time during which the diode conducts. At the end of TR, the diode current falls to 0A. The period of the wave is T>D×T+TR for DCM. The difference of the PWM period, T, and (D×T+TR) is the dead time.

The switch that operates the inductor is usually a BJT (bipolar-junction transistor) or a MOSFET. A MOSFET is preferable because of its ability to handle large current, better efficiency, and higher switching speed. However, at low voltages, a suitable MOSFET with low enough gate-to-source threshold voltage is hard to find and can be expensive. So, this design uses a BJT (Figure 2).

Microcontrollers offer PWM frequencies of 10 kHz to more than 200 kHz. A high PWM frequency is desirable because it leads to a lower inductor value, which translates to a small inductor. The Tiny13 AVR microcontroller from Atmel has a “fast” PWM mode with a frequency of approximately 37.5 kHz and a resolution of 8 bits. A higher PWM resolution offers the ability to more closely track the desired output voltage. The maximum inductor current from Equation 1 is 0.81A for a 20-µH inductor. The transistor that switches the inductor should have a maximum collector current greater than this value. A 2SD789 NPN transistor has a 1A collector-current limit, so it is suitable for this dc/dc converter. The maximum load current achievable with these values, from Equation 4, is 54 mA and thus meets the requirement of maximum required load current for an output voltage of 7.5V.

The Tiny13 microcontroller boasts two high-speed PWM channels and four 10-bit ADC channels. Another PWM channel and an ADC channel create the second dc/dc converter for an output voltage of 15V and a maximum load current of 15 mA. The inductor for this converter has a value of 100 µH. To calculate the output-capacitor value, use Equation 6. For a 5-mV ripple, the value of the capacitor for 7.5V output voltage is 270 µF, because the output current is 50 mA and the PWM-time period is 27 µsec, so this circuit uses the nearest larger value of 330 µF. Similarly, for the 15V output voltage, the required capacitor value is 81 µF, so the design uses a 100-µF capacitor.

The programs for the microcontroller are in C and use the open-source AVR GCC compiler. The AVR Tiny13 microcontroller operates at an internal clock frequency of 9.6 MHz without an internal-clock-frequency divider, so the PWM frequency is 9.6 MHz/256=37.5 kHz. The internal reference voltage is 1.1V. The main program alternately reads two channels of ADCs that monitor the output voltages in an interrupt subroutine. The main program executes an endless loop, monitoring the output voltage by reading the ADC values and adjusting the PWM values accordingly.

 #include<avr/interrupt.h>
#include<avr/io.h> #define vref 931 // 931 is 1V for a 1.1 internal reference
#define MAX_A 70
#define MAX_B 128 volatile unsigned int adc_val[]; SIGNAL (SIG_ADC)
{
unsigned int temp, temp1;
unsigned char ch; ADCSRA &= ~(<<ADEN);//ADC disabled
temp1=ADCL;
temp = ADCH;
temp = temp << ;
temp =temp | temp1; ch = ADMUX & 0x01;//channel number
//ch = ch ^0x01;
//ADMUX = ch | 0x40; if(ch==)
adc_val[]=temp;
else adc_val[]=temp; ADMUX = ADMUX ^ 0x01; // toggle last bit of MUX to change ADC channel ADCSRA = 0b11101100; //enable ADC
ADCSRA = 0b11101100; ch = PORTB ^ 0b00000100;
PORTB = ch; } int main(void)
{ unsigned int ad_temp, temp; DDRB = 0b00000111; TCCR0A = 0b10100011;
//Fast PWM on OC0A and OC0B
// TCCR0A - Timer/Counter Control Register A
// ---------------------------------------------------------
// |COM0A1|COM0A0|COM0B1|COM0B0| ? | ? | WGM01| WGM00|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// --------------------------------------------------------- TCCR0B = 0b00000001;
//Fed by System Clock of 9 600 000 divided by 1 = 9.6 MHz
// TCCR0B - Timer/Counter Control Register B
// -------------------------------------------------
// |FOC0A|FOC0B| ? | ? |WGM02| CS02| CS01| CS00|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// ------------------------------------------------- ADMUX = 0b01000010; //ADC2 is input to ADC
// ADMUX - ADC Multiplexer Selection Register
// -------------------------------------------------
// | - |REFS0|ADLAR| - | - | - | MUX1| MUX0|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// ------------------------------------------------- ADCSRA = 0b11101100; //Sampling rate is system clock divided by 16
// ADCSRA - ADC Control and Status Register A
// -------------------------------------------------
// |ADEN |ADSC |ADATE| ADIF| ADIE|ADPS2|ADPS1|ADPS0|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// ------------------------------------------------- ADCSRB=; DIDR0 = 0b00011000; //Disable Digital input buffer on PB3 and PB4
// DIDR0 - Digital Input Disable Register 0
// -------------------------------------------------
// | ? | ? |ADC0D|ADC2D|ADC3D|ADC1D|AIN1D|AIN0D|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// -------------------------------------------------
adc_val[]=;
adc_val[]=;
sei(); OCR0A =MAX_A;
OCR0B = MAX_B; while()
{
ad_temp = adc_val[]; if(ad_temp < vref)
{ OCR0A++; if( OCR0A > MAX_A)
OCR0A = MAX_A; }
ad_temp = adc_val[];
if(ad_temp > vref)
{
OCR0A--; if( OCR0A > MAX_A)
OCR0A = ; } ad_temp = adc_val[]; if(ad_temp < vref)
{ OCR0B++; if( OCR0B > MAX_B)
OCR0B = MAX_B; }
ad_temp = adc_val[];
if(ad_temp > vref)
{
OCR0B--; if( OCR0B > MAX_B)
OCR0B = ; } for(temp=; temp <; temp++)
{ temp = temp +;
temp = temp -;
} }
}
 #include<avr/interrupt.h>
#include<avr/io.h> #define voltref 931 // 931 is 1V for a 1.1 internal reference
#define MAX_A 70
#define MAX_B 128 volatile unsigned int adc_val[]; SIGNAL (SIG_ADC)
{
unsigned int temp, temp1;
unsigned char ch; ADCSRA &= ~(<<ADEN);//ADC disabled
temp1=ADCL;
temp = ADCH;
temp = temp << ;
temp =temp | temp1; ch = ADMUX & 0x01;//channel number
//ch = ch ^0x01;
//ADMUX = ch | 0x40; if(ch==)
adc_val[]=temp;
else adc_val[]=temp; ADMUX = ADMUX ^ 0x01; // toggle last bit of MUX to change ADC channel ADCSRA = 0b11101100; //enable ADC
ADCSRA = 0b11101100; ch = PORTB ^ 0b00000100;
PORTB = ch; } int main(void)
{ unsigned int ad_temp, temp, vref; DDRB = 0b00000111; TCCR0A = 0b10100011;
//Fast PWM on OC0A and OC0B
// TCCR0A - Timer/Counter Control Register A
// ---------------------------------------------------------
// |COM0A1|COM0A0|COM0B1|COM0B0| ? | ? | WGM01| WGM00|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// --------------------------------------------------------- TCCR0B = 0b00000001;
//Fed by System Clock of 9 600 000 divided by 1 = 9.6 MHz
// TCCR0B - Timer/Counter Control Register B
// -------------------------------------------------
// |FOC0A|FOC0B| ? | ? |WGM02| CS02| CS01| CS00|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// ------------------------------------------------- ADMUX = 0b01000010; //ADC2 is input to ADC
// ADMUX - ADC Multiplexer Selection Register
// -------------------------------------------------
// | - |REFS0|ADLAR| - | - | - | MUX1| MUX0|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// ------------------------------------------------- ADCSRA = 0b11101100; //Sampling rate is system clock divided by 16
// ADCSRA - ADC Control and Status Register A
// -------------------------------------------------
// |ADEN |ADSC |ADATE| ADIF| ADIE|ADPS2|ADPS1|ADPS0|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// ------------------------------------------------- ADCSRB=; DIDR0 = 0b00011000; //Disable Digital input buffer on PB3 and PB4
// DIDR0 - Digital Input Disable Register 0
// -------------------------------------------------
// | ? | ? |ADC0D|ADC2D|ADC3D|ADC1D|AIN1D|AIN0D|
// | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
// -------------------------------------------------
adc_val[]=;
adc_val[]=;
sei(); OCR0A = ;
OCR0B = ; vref =; while()
{ ad_temp = adc_val[]; if(ad_temp < vref)
{ OCR0A++; if( OCR0A > MAX_A)
OCR0A = MAX_A; }
ad_temp = adc_val[];
if(ad_temp > vref)
{
OCR0A--; if( OCR0A > MAX_A)
OCR0A = ; } ad_temp = adc_val[]; if(ad_temp < vref)
{ OCR0B++; if( OCR0B > MAX_B)
OCR0B = MAX_B; }
ad_temp = adc_val[];
if(ad_temp > vref)
{
OCR0B--; if( OCR0B > MAX_B)
OCR0B = ; } vref=vref +;
if (vref > voltref)
vref = voltref; for(temp=; temp <; temp++)
{ temp = temp +;
temp = temp -;
} }
}

Tiny microcontroller hosts dual dc/dc-boost converters的更多相关文章

  1. PID DC/DC Converter Controller Using a PICmicro Microcontroller

    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011794 ...

  2. [专业名词·硬件] 2、DC\DC、LDO电源稳压基本常识(包含基本原理、高效率模块设计、常见问题、基于nRF51822电源管理模块分析等)·长文

    综述先看这里 第一节的1.1简单介绍了DC/DC是什么: 第二节是关于DC/DC的常见的疑问答疑,非常实用: 第三节是针对nRF51822这款芯片电源管理部分的DC/DC.LDO.1.8的详细分析,对 ...

  3. DC/DC与LDO的差别

    转自:http://bbs.eetop.cn/thread-459121-1-1.html 在平时的学习中,我们都有接触LDO和DC/DC这一类的电源产品,但作为学生的我们队这些东西可能了解不够深刻, ...

  4. 电感式DC/DC变换器工作原理

    http://www.amobbs.com/thread-3293203-1-1.html 首先必须要了解电感的一些特性:电磁转换与磁储能.其它所有参数都是由这两个特性引出来的. 电感回路通电瞬间 断 ...

  5. Practice safe dc/dc converter

    Short-circuit protection is an obvious requirement for a power supply, especially when its load conn ...

  6. LT1946A-- Transformerless dc/dc converter produces bipolar outputs

    Dual-polarity supply provides ±12V from one IC VC (Pin 1): Error Amplifier Output Pin. Tie external ...

  7. 硬件设计--DC/DC电源芯片详解

    本文参考:http://www.elecfans.com/article/83/116/2018/20180207631874.html https://blog.csdn.net/wangdapao ...

  8. DC DC降壓變換器ic 工作原理

    目前DC/DC轉化器大致可分為:升壓型dc dc變化器.降壓型dc dc變化器及可升壓又可降壓dc dc變換器.我們今天主要提一下降壓型dc dc變換器的原理: 見下圖降壓變換器原理圖如圖1所示, 當 ...

  9. DC DC電路電感的選擇

    注:只有充分理解電感在DC/DC電路中發揮的作用,才能更優的設計DC/DC電路.本文還包括對同步DC/DC及異步DC/DC概念的解釋.   DCDC電路電感的選擇 簡介 在開關電源的設計中電感的設計為 ...

随机推荐

  1. linux系统磁盘挂载

    1.查看系统磁盘挂载情况 fdisk -l 2.格式化磁盘 mkfs -t ext3 /dev/sdb 3.挂在磁盘 mount /dev/sdb /disk2 4.查看磁盘挂载情况 df -h 5. ...

  2. 基于TCP协议的聊天室控制台版

    我之前写过一篇博客,主要是基于TCP协议实现的聊天室swing版,在此再写一个基于TCP协议实现的聊天室控制台版,便于学习和比较. package 聊天室console版.utils; import ...

  3. 创建文件和修改时间戳——touch

    linux的touch命令不常用,一般在使用make的时候可能会用到,用来修改文件时间戳,或者新建一个不存在的文件. 1.命令格式: touch [选项]... 文件... 2.命令参数: -a    ...

  4. Jmeter------将JDBC Request的查询结果作为另一个接口的请求参数

    一.前言 jmeter已配置连接成功数据库,不会的可查看:https://www.cnblogs.com/syw20170419/p/9832402.html 二.需求 将JDBC Request的r ...

  5. 所有依赖的jar将提取到lib目录

    1.在pom.xml添加如下内容: <build> <plugins> <plugin> <artifactId>maven-dependency-pl ...

  6. 【C#】数据类型(sbyte,byte,short,ushort,int,uint,long,ulong和char。、、、)

    C#的数据类型可以分为3类:数值类型,引用类型,指针类型.指针类型仅在不安全代码中使用. 值类型包括简单类型(如字符型,浮点型和整数型等),集合类型和结构型.引用类型包括类类型,接口类型,代表类型和数 ...

  7. 【WPF】Behavior的使用

    如何将一个行为附加到某个元素上呢?我们可以通过自定义一个Behavior! 我们首先看一下IAttachedObject接口,Behavior默认继承之这个接口 // 摘要: // 供可以附加到另一个 ...

  8. 【ASP.NET MVC】Scripts目录

    很多时候我们经常在用的东西我们可能不一定真正的了解,因为我们可能已经会用了,便不再对其进行探索,下面我们看一下在ASP.NET MVC3项目下的Scripts目录下的文件: Jquery核心库我们就不 ...

  9. VideoView视频缓冲进度条

    效果图: 需求: 刚进入视频播放页时,屏幕中间有加载进度条 视频播放过程中,视频界面不动了,正在缓冲时,屏幕中间有加载进度条 private ObjectAnimator rotate; ImageV ...

  10. luogu P2107 小Z的AK计划

    最近复习了一下堆,于是去luogu上找一些简单题写一写 贪心的想,小z不会到一半以后回头去Ak,因为这样从时间上想肯定是不优的,他可以早在之间经过时就AK所以我们可以将所有机房按照横坐标排序可以想到的 ...