I took some notes while profiling the Low Power Mode 3.5 (LPM3.5) in MSP430FR2311IPW20 Microcontroller from Texas Instruments.
|
Fig 1. The Setup is very minimal. I used a TSSOP-20 breakout and powered it with CR2032 battery. The current line is monitored by µCurrent GOLD (custom made). |
|
Fig 2. Scope Setup: CH1 is connected to the µCurrent output. CH2-CH3 (differential) is used to probe the GPIO (P1.6). |
|
Fig 3. Complete Setup. MSP430FR4133 Launchpad is used for programming. |
The LPM3.5 example code provided by Texas Instruments is used for this experiment (
Available here).
The code is straightforward. To summarize, it initializes XT1 (32Khz) as the main clock, check if it is a cold start or waking up from Low Power mode. When it is a cold start, it initializes the RTC with clock source as XT1, and RTC issues wake up interrupt every One second. When waking up from the Low Power mode, it restores the state of the Port 1 from Backup memory and enables the interrupt. In the RTC ISR, P1.6 is toggled and the state of Port 1 is saved in the Backup memory.
The state of the required port (in this case Port 1) need to be saved before going into the LPM3.5, otherwise, the MCU will lose it state.
The idea is to measure the time taken for the microcontroller from sleep mode and time taken to serve the RTC interrupt service routine.
|
Fig 4. CH1 Shows the µCurrent output. µCurrent is in 1mV/µA mode. So 1mV indicates 1µA. Violet is CH2-CH3 to profile the GPIO Pin. |
|
Fig 5. Time taken for the Wakeup. |
From the above image, it is clear that the time taken from the wake is 292 us. The
datasheet Table 6-1. Operating Modes mentions the time taken is 350 us. While waking up, there is a peak current consumption of 1.352 mA.
|
Fig 6. After waking up from the Sleep mode, it takes around 600 uS to select the 32Khz crystal. The current consumption during this period is roughly 240 µA. |
|
Fig 7. It takes around 48 uS after entering the RTC ISR to toggle the GPIO. |
|
Fig 8. After toggling the GPIO, 38 uS is required to save the state of PORT1 to Backup memory and enter the LMP3.5 Sleep mode. |
You get more insights from the scenario when GPIO transition from High to Low.
|
Fig 9. Hi to Low transition of P1.6 |
Let me explain what's happening here. The default state of the GPIO is Low. So, when the MCU wakes up, P1.6 is pulled to low (resetting to its default state). So from the above image, it is clear that the time taken for the MCU to wake up is 262 uS, which is well within the limit (350 uS).
|
Fig 10. Time taken to restore the Port 1 state. |
The time taken to
restore the Port 1 GPIO state is 648 us. The in-between time is spent on selecting the crystal pin and
setting up the crystal. I assume that most of the time is spent on
checking for the oscillator flag.
|
Fig 11. Current spike before restoring the Port 1 state. |
There are some current spikes before restoring the Port 1 state. Probably, the spikes are due to the data read from the Backup memory. If this assumption is correct, then the time taken for the read is 14 uS.
|
Fig 12. After toggling the GPIO, 36 uS is required to save the state of PORT1 to Backup memory and enter the LMP3.5 Sleep mode. (Matches with Fig. 8) |
To summarize, let's highlight the events.
|
Fig 13. |
0 - MCU in LPM 3.5 Sleep mode.
1 - MCU wakes up from the Sleep mode, resets the Watchdog timer.
2 - Initializes the GPIO and selects the crystal pins.
3 - Sets the main oscillator clock to XT1.
4 - Reads the state from Backup memory and restores it.
5 - RTC ISR serviced.
6. Saves the state in Backup memory and goes back to LPM3.5.
So far, I focused on the time taken for the various event. Let's focus on the Y-Axis (Current). Which is the important feature of the MPS430 series.
As mentioned earlier in the setup, custom-made µCurrent GOLD is used in 1mV/µA mode. So, 1mV division in the scope represents 1µA current consumption in the Device under test (DUT).
|
Fig 14. Current spikes occur every second, which indicates the device waking up every one second. |
The violet line shows the integration of current over the time (Area under the yellow curve). It is measured around 28 mVs which indicates a current consumption of 28 µA over a period of
one second 2.4 seconds, which indicates that the current consumption is 11.83 µA/sec. But this measurement might be deceiving as the scope has an error due to the offset. (Explained in the
comments of this EEVBlog video).
In the following figure, you can notice the time scale is set at 100ms and the microcontroller is set to wake up every 10 seconds.
|
Fig 15. Integration using Math and Measurement functions. |
The Math function shows the Area under the curve is 11.6 mVs (Vs because the BX-AX is 1s) and at the bottom, the Area over the full screen is measured as 12.9 mVs (over 1.2s) which is matches our previous measurement.
|
Fig 16. Zoomed in position of LPM current consumption. |
Going on, in the above image, you can notice the current spikes at around 36 Hz frequency. This indicates the
RTC counter counting up (It is supposed to be 32 Hz, but I am not sure why I am getting 36 Hz, maybe the crystal is not compensated which causes a drift? 🤔 ) During the RTC count up, the current consumption is around 15 µA.
|
Fig 17. During the sleep mode, the current peaks are around 7 µA. |
Finally, I made the RTC interrupt every 10 seconds to measure the average current consumption during the LPM 3.5 mode with the multimeter.
|
Fig 18. 1mV/nA is selected. Hence the average consumption is 531 nA. |
I could measure 531nA during the LPM 3.5 sleep mode which is well within the limit mentioned in the datasheet (0.71 µA) See Table 6-1. Operating Modes in the
datasheet.
Overall, the measurements are well within the limits mentioned in the datasheet.