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. web deploy 安装失败解决

    单独运行安装包,提示脚本运行失败. VS安装提示解包失败. 解决:检查Windows Management Instrumentation服务状态.需要非禁用.

  2. nginx同域名动静态分离

    公司需求是如果是app加载静态页面的话要通过应用服务直接请求指定的服务  由于机房迁移  不得不将该文件迁移到一个指定的地方  需要通过nginx配置检测到是访问该静态页面的就转到该静态页面上面进行加 ...

  3. PostGIS 操作geometry方法

    WKT定义几何对象格式: POINT(0 0) ——点 LINESTRING(0 0,1 1,1 2) ——线 POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2 ...

  4. NVIDIA DIGITS 学习笔记(NVIDIA DIGITS-2.0 + Ubuntu 14.04 + CUDA 7.0 + cuDNN 7.0 + Caffe 0.13.0)

    转自:http://blog.csdn.net/enjoyyl/article/details/47397505?from=timeline&isappinstalled=0#10006-we ...

  5. 木块问题(UVa101)

    题目具体描述见:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_prob ...

  6. oracle 内连接、外连接、自然连接、交叉连接练习

    oracle 内连接.外连接.自然连接.交叉连接练习 --查询员工信息 select * from emp; --查询部门信息 select * from dept; --需求:查询员工姓名.薪资和所 ...

  7. 通过 JS 实现错误页面在指定的时间跳到主页

    通过 JS 实现错误页面在指定的时间跳到主页 <!DOCTYPE html> <html> <head> <title>浏览器对象</title& ...

  8. Java经典设计模式之十一种行为型模式

    转载: Java经典设计模式之十一种行为型模式 Java经典设计模式共有21中,分为三大类:创建型模式(5种).结构型模式(7种)和行为型模式(11种). 本文主要讲行为型模式,创建型模式和结构型模式 ...

  9. 【C#】缓存数据

    namespace WpfCopy.Controls { public class CacheFileEventArgs : EventArgs { public bool IsFaulted { g ...

  10. 2017 计蒜之道 初赛 第五场 A. UCloud 机房的网络搭建

    贪心. 从大到小排序之后进行模拟,注意$n=1$和$n=0$的情况. #include <iostream> #include <cstdio> #include <cs ...