Refer to my earlier blog on working with OM13088-LPC4367 LPCXpresso development board; i am using the same project executable of peripheral timer which blinks LED at every 1 second interrupt for demonstrating the PMT
The Power measurement tool enables the measurement of power usage on the
LPCXpresso boards that incorporate the power measurement circuit – for example the
LPCXpresso 54102 board. The power measurement tool is composed of three parts:
1. An LPCXpresso board featuring the power measurement circuit
2. The Power measurement firmware
3. LPCXpresso Power Measurement plug-in (part of LPCXpresso IDE 7.7.2 and above)
The Power Measurement Tool enables you to visualize the current usage of the LPCXpresso54102 board from within the LPCXpresso IDE (v7.7.2 or later). It is able to capture a burst of samples of the target current usage, the target supply voltage or the shield current at up to 200ksps. This information is displayed in a graph and can be exported for further analysis. The average values of the collected data can also be displayed.
Built-in current measurement
The LPCXpresso4367 includes an on-board current measurement system consisting of a pair of amplifiers and a fast, 2 channels ADC, which is controlled by the on-board Link2 debug probe. Each amplifier measures the voltage drop across of two series resistors, one pair of resistors being in line with the Target MCU supply and one in line with the I/O supply. By default, one of the series resistors in each of these circuits is shorted by (JP7 for Target supply, JP9 for I/O supply) in order to allow the ADC to measure up to 235mA (Target supply) / 32mA (I/O supply) without the ADC input saturating. JP7 can be removed to make more accurate measurements when the Target MCU is consuming 52mA or less, and/or JP9 can be removed if the I/O supply current is 32mA or less. Note that the current measurement system will not be damaged if the amplifier outputs saturate.
Current measurement system range selection
Jumper | Position | Supply | Current range |
JP7 | Shunted (default) | Target | 58uA-235mA |
JP7 | Open | Target |
|
JP9 | Shunted (default) | I/O | 8uA-32mA |
JP9 | Open | I/O | 4uA-16mA |
The ADC can sample the amplifier out at up to 200k samples/second, configurable under control of the Link2 probe.
The current measurement system is supported by version 8.0 and later versions of the LPCXpresso IDE, which includes controls to select sample rate and enter the sense resistor values selected by JP7 and JP9.
JP7, JP9 | The on-board current measurement circuitry includes a choice of two sense resistors for both the Target and I/O supplies in order to enable more accurate current measurement when the Target MCU is running in low power modes. JP7 and JP9 are used to select short a second sense resistor in the path of the current supplies of the Target and I/O supplies respectively. |
A current meter may be installed across JP10 terminals to measure the Target MCU I/O current consumption. Pin 1 (square pad) is positive and pin 2 is negative. By default JP7 is shunted by a 0Ω resistor installed at JS15. Remove the resistor at JS15 to measure current at JP7.
A current meter may be installed across JP7 to measure the Target MCU I/O VDD input current. The 0Ω resistor at JS14 must be removed and the current meter connected at the positive input at JP7 pin 1 (square pad) and negative input at JP7 pin 2.
Power Measurement Firmware
The power measurement tool requires the latest version of the Link2 firmware to be installed on the probe. This firmware provides a data channel through which the power usage information is sent to be displayed in LPCXpresso. The firmware is downloaded via the DFU mechanism. Since it resides in RAM you need to re-download it every time the board is power cycles. LPCXpresso will perform this step automatically, but first you need to choose the version of the probe to use.
The power measurement firmware comes in two flavors of the “bridge probes”: the CMSISDAP and the RedLink firmware. The “non-bridged” version of these firmwares does not support power measurement. The non-bridged versions are provided for customers who experience USB bandwidth issues. If you are unable to debug your part with the bridged firmware try switching back to the standard firmware – you will not be able to use the power Measurement tool, but should be able to do everything else.
There are four firmware choices:
1. CMSIS-DAP (Default)
2. CMSIS-DAP (Non-bridged – Debug only)
3. Redlink
4. Redlink (Non-bridged – Debug only)
Choose the CMSIS-DAP (Default) option if you want to use the power measurement or SWO trace. If you debug in another tool chain, this option will allow LPCXpresso to capture the power data – even without a debug connection. Note that LPCXpresso does not need to be debugging the target to be able to use the power tool with this option. For example you could be tracking the power usage in LPCXpresso and debugging your code in Keil uVision using this firmware. It also includes the SWO functionality and the serial I/O bridge.
The CMSIS-DAP (Non-bridged – Debug only) option excludes the power tool, SWO trace and Serial I/O bridge extensions. This version uses less USB bandwidth and should be used if you experience USB issues. Power measurement and SWO trace will be unavailable.
The Redlink firmware is similar to the CMSIS-DAP (Default) but only works in LPCXpresso. In some cases it can perform faster than the CMSIS-DAP version.
The Redlink (Non-bridged – Debug only) is the Redlink equivalent of the CMSIS-DAP (Non-bridged – Debug only) firmware, and should be used if you want to use Redlink, but are having USB issues.
Let us start the procedure to measure the Current/Volltage:
1) On the LPCXpresso board or Link2 make sure that the jumper beside the Link USB socket is closed. This jumper puts the Link into DFU mode and allows new firmware to be downloaded.
2) Connect the Link USB socket on the board to your computer.
Open the LPCXpresso preferences page from the main menu bar
Window -> Preferences
Locate the Redlink Options page by expanding the LPCXpresso item.
• Select “CMSIS-DAP (Default)” from the Redlink boot type options.
Download the firmware to the probe by pressing the Boot Debug Probe button
If there is a probe in DFU mode the following dialog box will appear.
It will initialise LinkServer with CMSIS DAP ~bin.hdr file as shown below:
Double check that the board is connected using the USB socket labeled Link (not Target) and that the jumper JP5 is closed, then power cycle the board and retry.
Note: the firmware must be re-downloaded every time the probe is power cycled.
This will be done automatically if you are using debugging with the LPCXpresso IDE Once the firmware is downloaded you can download your code to the target if it is not already in flash.
Click on Power measurement tool as shown below:
Note: i am using the Periph_timer project from my earlier blog Working on with LPCXpresso development board OM13088 with LPC4367 MCU
Now we need to configure the power probe, click on the configure icon as shown below:
Now select the option “other boards” for power probe circuit as shown as we are using LPC4367 dev board
Now select the Capture detail as shown below:
Data Source: Target Current (we are measuring current), 200KSPS and capture for 10 seconds
Then finally start the process by clicking 'start'
You can see the current consumption graph which shows 13mA
You can see the minimum, Maximum and average current consumption:
Now we will change the LED colour from blue to Green and the blink rate from 10 seconds to 1 seconds
Changing to Green LED and timer interval
Now let’s change this to blink at 1 Hz i.e at interval of 1 sec
Change TICKRATE_HZ to 1 in timers.c
#define TICKRATE_HZ 1
And we will change instead of blue LED to green LED by changing
Board_LED_Set(0, On); to Board_LED_Set(1, On); which is connected to Port-0, pin- 7 (defined in board.c)
Build the project again and execute the project
Reload the changed project to observe the change in current consumption:
Hence with the power measurement tool it has made easy to measure the current/voltage consumption of the project.
Below is the video on how to make the settings to change Green LED and perform Power Measurement Tool on LPCXpresso tool:
Happy Power measurement using LPCXpresso on OM13088OM13088 LPC4367 development board