Other Parts Discussed in Thread: MSP430F5438, MSP430F169
I would like to get some guidelines regarding putting the MSP430 uC in a low-power mode. I am mostly interested in using the LPM3 and LPM4 modes. Let me first make a list of the peripherals that the uC uses :
- three SPI interfaces (connected to different peripherals, like a flash memory, digital sensor etc.)
- one I2C interface, connected to a digital sensor
- the ADC12
- the timers (A and B)
I use a 32768kHz crystal connected to XT1 and use this clock as the main clock source for all clocks needed. During normal operation the max clock (MCLK) can go up to 18MHz or more. Periodically, I would like to put the device in low power mode to save energy, either in LPM3 or LPM4. The points that trouble me are the following:
- When in low power mode, what should I do with the USCI peripherals that I have previously configured and initiated? Does it matter if I leave them running or should I put them in reset? What I haven't understand is whether these modules draw current when there are no active transactions in progress (they are actually idle). The USCI peripherals draw current through their BRCLK, isn't that correct? Hence, I am thinking that while there are no transactions no current should be required for them.
- Another concern of mine is the state of the pins of the device. The pins can be divided in 3 categories in terms of functionality:
- Unused pins: These pins have been left unconnected on the PCB. What is the best configuration for them for low power? Output direction or input direction with internal pullups (or pulldowns)?
- Pins used as analog inputs for the ADC: Do I have to treat these pins as unused pins during sleeping periods and configure them as inputs with internal pullups (or pulldowns) or they should be left at their alternative function (inputs for the ADC)?
- Pins used for the digital interfaces (connected to external peripheral devices). Do I have to change the functionality of these pins, configure them as GPIOs, with output or input direction with internal pullups (or pulldowns)? Or should I keep them as they are?
- Another concern is how to wake-up the device from LPM. My intention is to wake it up in a time based fashion, i.e. after 1 min or something like that, without any other external interrupt. What is the best way to do that, in order not to increase the current consumption? I was thinking of either using one of the timers available (Timer_A / Timer_B) or the Watchdog (in interval timer mode). The difference is that the Watchdog can use the VLOCLK, whereas the timers can only use the ACLK. Is there any observable difference in the power consumption of the two clocks? In fact, as far as I understand, the VLOCLK is active during LPM4 whereas ACLK is not, isn't that correct? Hence, I could put the MCU in LPM4, enable the VLO and wake it up with the WDG or put it in LPM and wake up using the Timers.
Additionally, I have some questions regarding the clock system of the uC.
- First of all can a board be fully operational without the need of an external crystal, just by using the REFO? What would be the drawback of such a solution?
- Moreover, which solution consumes less current, using the REFO or the XT1?
- And lastly, if I have an external crystal of 32.768kHz connected at the XT1 pins but the function of these pins is not changed to the analog function, what happens to the XT1? Does it remain disabled in that case? And where does the ACLK is sourced from? Because in my code, I haven't configured properly the XT1 pins ( I just start using the device after power-up ) and however no problem exists. I guess that in that case the XT1 is never enabled through-out the program? Can I use the device only at this mode, without enabling the XT1?
Apologizing for the length of my post, I would like to say that I would be really grateful if you could give me some directions towards minimizing the current consumption of the uC during sleep.
Thank you in advance for your help.
Nikos