2.3 Programming the Device and Comparing Power Efficiency
Todo: Load the
project onto the microcontroller and get power readings.
- Program the device and get power
consumption readings from the software implementation program.
- Connect the Curiosity Nano board to the computer. Connect the two soldered pins together. With the software accumulation program set as main program, press the Make and Program Device button from the toolbar. A pop-up might appear that asks to select the tool that will be programmed. Select the AVR128DA48 Curiosity Nano board.
- Open Atmel Studio and connect the Power Debugger to the computer. Connect the Curiosity Nano board to the channel A ammeter of the Power Debugger. Connect the pin closest to the Nano embedded debugger to the inward pointing arrow of the A ammeter and the pin closest to the microcontroller to the outward pointing arrow of the ammeter.
- In Atmel Studio, go to Tools → Data Visualizer.
- Two boxes will appear. Check the one called DGI (Data Gateway Interface) Control Panel. If this does not show up, the Configuration menu on the left side can be accessed and, in the Modules → External Connection section, the Data Gateway Interface can be found.
- Press Connect and a
box labeled ‘power’ will appear. Select it and then press the wheel to open
the menu. Disable the B channel.Warning: In case the Power field does not appear, disconnect the board and connect it again.
- When everything is correctly
configured, press Start and a new box that displays the power
consumption in real time will appear.Tip: To adjust the display, open the control panel on the left side of the box. Unchecking Show zero will provide a clearer picture.
- After the reading has stabilized, press Stop and then disconnect. The box with the power measurement will remain open.
- Get power consumption readings from
the hardware accumulation implementation program.
- Connect the two soldered pins on the Curiosity board together.
- With the hardware accumulation project set as main program, press the Make and Program Device button on the toolbar in MPLAB X.
- Connect two soldered pins of the Curiosity Nano Board to the Power Debugger. See Step 1.2.
- Go back to the Data Visualizer in Atmel Studio and in the DGI panel press Connect.
- Check the power box and edit the settings to disable the B channel.
- Press Start and a new box that displays the real-time power consumption will appear. Disable Show zero for a better picture.
- When the reading has stabilized, press Stop to have a fixed result.
- Compare the two measurements.
- Both power consumption graphs
are open on the same screen. They can now be analyzed to observe the way the
programs behaved.Info: The top part displays the software accumulation, while the bottom part, the hardware accumulation. As can be seen from the picture, there is a 3.1 mA difference between the two, making the hardware implementation almost twice as efficient.
- Both power consumption graphs
are open on the same screen. They can now be analyzed to observe the way the
programs behaved.