1.6 Programming the Device and Comparing Efficiency
Todo: Load the
project onto the microcontroller and get power readings.
- Get power consumption readings from
the software implementation program.
- Connect the Curiosity Nano board to the computer and the two soldered pins together.
- With the software implementation program set as the 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 used as a programmer. Select the AVR128DA48 Curiosity Nano board.
- Connect the Power Debugger to the computer. Connect the first pin (the one closest to the Nano embedded debugger) to the inward arrow of the A channel ammeter and the second pin (the one closer to the microcontroller) to the outward pointing arrow of the A channel 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: Open the control panel on the left side of the box to adjust the display. 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 Event System implementation program.
- Connect the two soldered pins on the Curiosity board together.
- With the Event System implementation project set as main program, press the Make and Program Device button on the toolbar in MPLAB X.
- Connect the Curiosity Nano Board to the Power Debugger. See Step 1.3 in this chapter for details and pictures.
- 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 power consumption of the Event System implementation, while the bottom part displays the power consumption of the Interrupts implementation. As can be seen from the picture, the difference is fairly small of about 1.5 uA. This is due to the long amount of time the microcontroller spends in Sleep.
- Both power consumption graphs
are open on the same screen. They can now be analyzed to observe the way the
programs behaved.