Other Parts Discussed in Thread: TPS65835, MSP430G2553
HI everyone:
we are working on 3D Glass with TI's new chip TPS65835. In Datasheet of TPS65835 , a high to low transition on P3.0 will put the chip into SLEEP mode,and the current
will decrease to about 9uA.
I use the following code but it can't help make the chip into SLEEP mode.
//====================================================
#include "msp430g2553.h"
#define SLEEP BIT0
#define LED BIT5
unsigned int count;
void main( void )
{
WDTCTL = WDTPW + WDTHOLD;
P2SEL |= BIT6 + BIT7; //LFXT1晶振口第2功能
DCOCTL = 0x22 ;
BCSCTL1 = 0x8D ;
BCSCTL2 = 0 ; //MCLK,SMCLK均没有分频 且为8MHz
BCSCTL3 = XCAP_0 ; //LFXT1来自外部,ACLK=32768Hz 且匹配电容为6pF
do
{
BCSCTL3 &=~ LFXT1OF;
IFG1 &= ~OFIFG;
__delay_cycles(2000);
}while(IFG1 & OFIFG); //确保低频晶振32768起振
IFG1 = 0;
//=======================================
TA0CTL = TASSEL_1 + TAIE ;
TA0CCR1 = 32000;
TA0CCTL1 = CCIE;
TA0CTL |= MC_2; //continuse mode
//========================================
P3OUT |= SLEEP ;
P3DIR |= SLEEP ;
P3SEL &=~SLEEP ;
//======================================
P3OUT |= LED ;
P3DIR |= LED ;
P3SEL &=~LED ;
_EINT();
while(1);
}
#pragma vector = TIMER0_A1_VECTOR
__interrupt void TA(void)
{
switch(TA0IV)
{
case 0x02:
P3OUT ^= LED;
TA0CCR1 +=30000;
break;
case 0x04:
break;
case 0x0A:
count++;
if(count == 4)
{
P3OUT &= ~SLEEP ;
P3DIR |= SLEEP ;
P3SEL &=~SLEEP ;
}
break;
default: break;
}
}//================================
ACLK = 32768Hz TACLK = ACLK;
After 8 senconds ,the LED is still frashing... and the current is still in 2mA but not 9uA.
so is there anyone can help explain this? Thanks in advance.