Tiny microcontroller hosts dual dc/dc-boost converters
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的更多相关文章
- PID DC/DC Converter Controller Using a PICmicro Microcontroller
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011794 ...
- [专业名词·硬件] 2、DC\DC、LDO电源稳压基本常识(包含基本原理、高效率模块设计、常见问题、基于nRF51822电源管理模块分析等)·长文
综述先看这里 第一节的1.1简单介绍了DC/DC是什么: 第二节是关于DC/DC的常见的疑问答疑,非常实用: 第三节是针对nRF51822这款芯片电源管理部分的DC/DC.LDO.1.8的详细分析,对 ...
- DC/DC与LDO的差别
转自:http://bbs.eetop.cn/thread-459121-1-1.html 在平时的学习中,我们都有接触LDO和DC/DC这一类的电源产品,但作为学生的我们队这些东西可能了解不够深刻, ...
- 电感式DC/DC变换器工作原理
http://www.amobbs.com/thread-3293203-1-1.html 首先必须要了解电感的一些特性:电磁转换与磁储能.其它所有参数都是由这两个特性引出来的. 电感回路通电瞬间 断 ...
- Practice safe dc/dc converter
Short-circuit protection is an obvious requirement for a power supply, especially when its load conn ...
- 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 ...
- 硬件设计--DC/DC电源芯片详解
本文参考:http://www.elecfans.com/article/83/116/2018/20180207631874.html https://blog.csdn.net/wangdapao ...
- DC DC降壓變換器ic 工作原理
目前DC/DC轉化器大致可分為:升壓型dc dc變化器.降壓型dc dc變化器及可升壓又可降壓dc dc變換器.我們今天主要提一下降壓型dc dc變換器的原理: 見下圖降壓變換器原理圖如圖1所示, 當 ...
- DC DC電路電感的選擇
注:只有充分理解電感在DC/DC電路中發揮的作用,才能更優的設計DC/DC電路.本文還包括對同步DC/DC及異步DC/DC概念的解釋. DCDC電路電感的選擇 簡介 在開關電源的設計中電感的設計為 ...
随机推荐
- selenium grid应用2-多节点执行用例
启动远程 node我们目前启动的 Hub 与 node 都是在一台主机.那么要在其它主机启动 node 必须满足以下几个要求: 1)本地 hub 主机与远程 node 主机之间可以相互 ping 通 ...
- 修改weblogic访问路径应用名称
第一种:在应用WEB-INF文件夹下创建weblogic.xml文件,内容如下,其中<context-root>/abc</context-root>为路径上的应用名 < ...
- MAC 文件被锁定
从windows拷贝到MAC的文件,有时候会被锁定.右键-简介-已锁定也是灰色的,无法取消: xattr -l 文件名 xattr -d com.apple.FinderInfo 文件名
- 服务器Java环境配置
/* 当要在服务器里搭建Java web项目时, 要先配置好Java需要的环境 */ //jdk [root@localhost ~]# cd /usr/local/src [root@localho ...
- POJ 2349 Arctic Network(最小生成树+求第k大边)
题目链接:http://poj.org/problem?id=2349 题目大意:有n个前哨,和s个卫星通讯装置,任何两个装了卫星通讯装置的前哨都可以通过卫星进行通信,而不管他们的位置. 否则,只有两 ...
- EF – 7.一对多关联
5.6.8 <一对多关联(上)> 5.6.9 <一对多关联(下)> 一对多的关联,可以说是整个数据库应用程序中最常见的一种关联类型了,因此,必须高度重视这种关联类型CRUD的实 ...
- MVC – 5.MVC设计模式和.NetMVC框架
MVC模式-设计模式 •控制器(Controller)- 负责转发请求,对请求进行处理. •视图 (View) - 界面设计人员进行图形界面设计. •模型 (Model)-业务逻辑.数据.验证规则.数 ...
- 从函数调用的角度,探讨JavaScript中this的用法
js函数调用方式大概可分为:函数调用,构造器调用,call或apply,方法调用四种方式.下面结合一些基础概念和实测代码,从函数调用的角度,探讨JavaScript中this的用法. 1. new对函 ...
- 前端canvas合并图片两种实现方式
---恢复内容开始--- 需求: 有一个固定的背景图,还有一个是随机生成的二维码,合并成一张图,让用户下载. 实现一:纯手写,这里为了省事生成图片我直接给的base64,其实使用qrcode.js生成 ...
- 易普优APS(高级计划排程)演绎饭局模型(通俗的告诉您ERP计划与APS计划的区别)
一天中午,老张突然回到家里对妻子说:“亲爱的老婆,晚上几个同事要来家里吃饭.这次我专门回家来要用最先进的ERP理念来完成咱家的请客过程了,要把这次宴会搞成一次ERP家宴.你看,我已经用CRM客户关系管 ...