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. cmder中文显示相关问题解决方案(1.3以上版本)

    cmder虽然Windows命令行的进阶版,虽然好看易用,但其中文编码一直是个问题.网上有不少博客给出解决方案,大部分都已因为版本更新失效.本文解决方案针对1.3以上版本的cmder用户 中文字体重叠 ...

  2. go语言入门(三)

    条件语句 go语言的条件语句结构如下: go语言的条件语句和其他语言类似.简单列举下: 1.if 语句,布尔表达式不需要括号 if 布尔表达式 { /* 在布尔表达式为 true 时执行 */ } 2 ...

  3. acm专题---拓扑排序+优先队列

    struct node{ int id; int cnt; node(int _id,int _cnt):id(_id),cnt(_cnt){} bool operator<(node a) c ...

  4. Caffe学习系列(8):solver,train_val.prototxt,deploy.prototxt及其配置

    solver是caffe的核心. net: "examples/mnist/lenet_train_test.prototxt" test_iter: 100 test_inter ...

  5. 铁器 · Burp Suite

    Burp Suite 是用于攻击web 应用程序的集成平台.它包含了许多工具,并为这些工具设计了许多接口,以促进加快攻击应用程序的过程.所有的工具都共享一个能处理并显示HTTP 消息,持久性,认证,代 ...

  6. 洛谷P1554 梦中的统计 题解

    题目传送门 这道题暴力又让我过了...数据真的很水(luogu) 暴力枚举n~m的每个数,再统计一次,交付评测...AC #include<bits/stdc++.h> using nam ...

  7. function(函数)中的动态参数

    我们可向函数传递动态参数,*args,**kwargs,首先我们来看*args,示例如下:     1.show(*args) def show(*args): print(args,type(arg ...

  8. ASP.NET WebAPI 02-Action的选择(一)

    在WebAPI对于Action的选择主要经过:Action方法名匹配,Http方法匹配,参数匹配三步. Http方法匹配 WebAPI提供了三种Http方法的选择方式,分别是:方法前缀,AcceptV ...

  9. ul>li中自定义属性后取值的问题

    动态赋值的li: $.ajax({ type: "POST", url: "${base}/before/subDemand/listType", succes ...

  10. 不通过注册表使用ActiveX对象

    为了弄清楚COM库的运行原理,特意做了这个实验: #include "stdafx.h" #include "objbase.h" #include " ...