|
电动牙刷控制器采用了德州仪器 (TI) 低电压 H 桥电机驱动器与集成式 LDO 电压稳压器和超低功耗微控制器 (MCU),旨在展示电池供电型电动牙刷的全面实施方案。
特性
• 电池电压范围从 2V 到 5.5V
• 提供 5A 连续电流和 8A 峰值驱动电流
• PCB 外形小巧:43.2 x 14.6mm
• 组件数量少,可降低成本
• 在关闭时电池漏电流小于 50nA
电动牙刷控制器电路框图:
Altium Designer画的原理图和PCB图如下:(51hei附件中可下载工程文件)
单片机源程序如下:
#include "msp430.h"
// Port 1 output definitions
#define IN1H BIT7 // P1.7
#define IN1L BIT2 // P1.2
#define IN2H BIT5 // P1.5
#define IN2L BIT6 // P1.6
// Define output PWM waveform parameters
#define t_OFF 750 // Time that both outputs maintain low; 5*150
#define t_ON 1350 // Time that one output maintains high; 9*150
volatile unsigned int count;
int main(void)
{
// Setup CLKs
// Stop watchdog timer
WDTCTL = WDTPW + WDTHOLD;
// 1MHZ DCO
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
// Configure all GPIO with pulldowns
P1REN = BIT7 + BIT6 + BIT5 + BIT4 + BIT3 + BIT2 + BIT1 + BIT0;
P2REN = BIT7 + BIT6;
// Set the four GPIO pins as OUTPUT
P1DIR = 0xE4;
// Set default GPIO settings
P1OUT = 0x00;
P2OUT = 0x00;
// Setup Timer
TACCTL0= CCIE; // Enable Interrupts on Timer
TACCR0 = 150-1; // Number of cycles in the timer
TACTL = TASSEL_2; // Use SMCLK as source for timer
TACTL |= MC_1; // Use UP mode timer
// Enters low power mode and enables interrupt
__bis_SR_register(LPM0_bits + GIE);
} // main
#pragma vector = TIMERA0_VECTOR
/* | ____ | | |
* IN1H | __| |_______ | | |
* | ____ | | ____ |
* IN1L | __________| || OUT1|__| |________|
* | ____ | | ____ |
* IN2H | __________| || OUT2|__________| ||
* | ____ | | |
* IN2L | __| |________| | |
*/
__interrupt void CCR0_ISR(void) {
count++; // Increment count upon every interrupt
if (count == 5) // 750 uS
P1OUT = IN1H + IN2L; // OUT1 high
else if (count == 14) // 2100 uS
P1OUT = IN1L+IN2L; // Slow decay
else if (count == 19) // 2850
P1OUT = IN2H + IN1L; // OUT2 high
else if (count == 28) { // 4200
P1OUT = IN1L+IN2L; // Slow decay
count = 0;
}
else {
// Do nothing
}
}//interrupt
|
评分
-
查看全部评分
|