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.
Figure 2-24. Make and Program the Device - 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.
Figure 2-25. Hardware Setup - 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.
Figure 2-26. Data Gateway Interface - 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.
Figure 2-27. DGI Connect Figure 2-28. Power Settings - 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.
Figure 2-29. Start Monitoring - After the reading has stabilized, press Stop and then disconnect. The box with the power measurement will remain open.
- 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.
- 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.
Figure 2-30. Make and Program the Device - 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.
Figure 2-31. DGI Connect - Check the power box and edit
the settings to disable the B channel.
Figure 2-32. Power Settings - Press Start and a new
box that displays the real-time power consumption will appear. Disable Show
zero for a better picture.
Figure 2-33. Start Monitoring - 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.
Figure 2-34. Software Accumulation Compared to Hardware Accumulation 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.