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. ASP.NET Core 2.0 MVC 发布部署--------- linux安装.NET CORE SDK具体操作链接以及操作总细节

    具体链接:https://www.microsoft.com/net/learn/get-started/linuxubuntu 如下图:

  2. AC日记——[CQOI2009]DANCE跳舞 洛谷 P3153

    [CQOI2009]DANCE跳舞 思路: 二分+最大流: 代码: #include <cstdio> #include <cstring> #include <iost ...

  3. gcc编译器参数

    [gcc编译步骤] 1.预处理,生成.i的文件[预处理器cpp] 2.将预处理后的文件转换成汇编语言,生成文件.s[编译器egcs] 3.由汇编变为目标代码(机器代码)生成.o的文件[汇编器as] 4 ...

  4. Webpack, VSCode 和 Babel 组件模块导入别名

    很多时候我们使用别人的库,都是通过 npm install,再简单的引入,就可以使用了.     1 2 import React from 'react' import { connect } fr ...

  5. JS 汉字与Unicode码的相互转化

    js文件中,有些变量的值可能会含有汉字,画面引入js以后,有可能会因为字符集的原因,把里面的汉字都变成乱码.后来发现网上的一些js里会把变量中的汉字都表示成”\u“开头的16进制编码,这样应该可以解决 ...

  6. vue操作本地存储

    const ls = window.localStorage const ss = window.sessionStorage export const LStorage= { getItem(key ...

  7. ref:Web Service 渗透测试从入门到精通

    ref:https://www.anquanke.com/post/id/85910 Web Service 渗透测试从入门到精通 发布时间:2017-04-18 14:26:54 译文声明:本文是翻 ...

  8. 20169211《Linux内核原理与分析》第三周作业

    假期中抽时间学习了一下linux内核的启动过程,在此做一下学习总结. Linux启动过程描述: 1.启动BootLoader 2.Linux系统的初始化 3.Linux的应用程序的初始化 通用寄存器的 ...

  9. Sublime 编译运行JavaScript

    Tools > Build System > New Build System... { "cmd": ["node", "$file&q ...

  10. BeanFactoryAware和BeanNameAware

    实现 BeanFactoryAware 接口的 bean 可以直接访问 Spring 容器,被容器创建以后,它会拥有一个指向 Spring 容器的引用. BeanFactoryAware 接口只有一个 ...