Hi,
First of all, I am using a MSP430F5438A and MSP-EXP430f5438 board.
I have to realize a project in low power mode, so I need a long stand-by period with Real Time Clock enable to wake up temporarily the CPU, proccess some information, and come back to stand-by again.
To measure ONLY the current consumption during this stand-by period and following the Users' Guide instructions, section 1.6, I have writen a little code:
#include "msp430x54x.h"
#define YEAR 0x07DC // 2012
#define DATE 0x0817 // 23th august
#define HOUR 0x0009 // 9 a.m
void down_ports();
void RTC_conf();
void down_ports()
{
P1OUT = 0x00; /* All pins with low values */
P2OUT = 0x00;
P3OUT = 0x00;
P4OUT = 0x00;
P5OUT = 0x00;
P6OUT = 0x00;
P7OUT = 0x00;
P8OUT = 0x00;
P9OUT = 0x00;
P10OUT = 0x00;
P11OUT = 0x00;
PJOUT = 0x00;
P1DIR = 0xFF; /* Configurate pins as ouputs */
P2DIR = 0xFF;
P3DIR = 0xFF;
P4DIR = 0xFF;
P5DIR = 0xFF;
P6DIR = 0xFF;
P7DIR = 0xFF;
P8DIR = 0xFF;
P9DIR = 0xFF;
P10DIR = 0xFF;
P11DIR = 0xFF;
PJDIR = 0xFF;
}
void RTC_conf()
{
RTCCTL0 |= 0x00; /* Reset register ( flags & individual enable )*/
RTCCTL1 &= 0xB0; /* Binary input mode, run, ACLK as clock source*/
RTCCTL1 |= 0x20; /* Calendar Mode */
RTCYEAR = YEAR; /* Write year */
RTCDATE = DATE; /* Write date */
RTCTIM1 = HOUR; /* Write hour */
RTCTIM0 = 0x3900; /* Write minutes & seconds */
}
void main(void)
{
WDTCTL = WDTPW+WDTHOLD;
down_ports();
RTC_conf();
__bis_SR_register( LPM3_bits + GIE );
/* infinte loop */
for(;;)
{
}
}
As I have to use a clock, I have selected LPM3.
The pin voltage of Avcc,Avss, RST/NMI matchs with the section 1.6 of Users' Guide. I do not found LCDCAP and TEST pins in the board or schematic. The rest of pins showed in the guide are definide as "for USB device only", I supposse I do not have to work with them.
After this "little" introduction, my problems are these:
- When I measured with a common multimeter to get a initial value, only the msp430 consumption, not the entire board, I obtain a value of 0.004 mA, is to say, 4 uA, value aproximated to device datahseet. Measured between TP27 point and opened JP1 jumper, serial of course.
-But if I use a power supply, with high accuracy amperimeter included, it shows about 50 uA.
Both cases are powered with about 3.3 V.
If you know some configuration register or pin configuration I have forgotten or some advice or to tell me something that it is wrong, I would be glad to hear you.
Thanks for your time.